part of models;

class PayModel {
  PayModel({
    required this.type,
    required this.name,
    required this.icon,
    required this.selected
  });


  int type;
  String name;
  String icon;
  bool selected;

}

/// 可使用积分模型
class CreditPointModel {
  CreditPointModel({
    this.integral,
    this.onePointDeductionAmount,
    this.integralUseLimit,
    this.integralSwitch,
    this.deductibleAmount,
    this.deductibleIntegral,});

  CreditPointModel.fromJson(dynamic json) {
    integral = json['integral'];
    onePointDeductionAmount = json['one_point_deduction_amount'];
    integralUseLimit = json['integral_use_limit'];
    integralSwitch = json['integral_switch'];
    deductibleAmount = json['deductible_amount'];
    deductibleIntegral = json['deductible_integral'];
  }
  num? integral;
  String? onePointDeductionAmount;
  String? integralUseLimit;
  String? integralSwitch;
  String? deductibleAmount;
  num? deductibleIntegral;
  CreditPointModel copyWith({  num? integral,
    String? onePointDeductionAmount,
    String? integralUseLimit,
    String? integralSwitch,
    String? deductibleAmount,
    num? deductibleIntegral,
  }) => CreditPointModel(  integral: integral ?? this.integral,
    onePointDeductionAmount: onePointDeductionAmount ?? this.onePointDeductionAmount,
    integralUseLimit: integralUseLimit ?? this.integralUseLimit,
    integralSwitch: integralSwitch ?? this.integralSwitch,
    deductibleAmount: deductibleAmount ?? this.deductibleAmount,
    deductibleIntegral: deductibleIntegral ?? this.deductibleIntegral,
  );
  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['integral'] = integral;
    map['one_point_deduction_amount'] = onePointDeductionAmount;
    map['integral_use_limit'] = integralUseLimit;
    map['integral_switch'] = integralSwitch;
    map['deductible_amount'] = deductibleAmount;
    map['deductible_integral'] = deductibleIntegral;
    return map;
  }

}

/// 优惠券和 积分是否展示模型
class ShowModel {
  ShowModel({
    this.couponSwitch,
    this.integralSwitch,});

  ShowModel.fromJson(dynamic json) {
    couponSwitch = json['coupon_switch'];
    integralSwitch = json['integral_switch'];
  }
  String? couponSwitch;
  String? integralSwitch;
  ShowModel copyWith({  String? couponSwitch,
    String? integralSwitch,
  }) => ShowModel(  couponSwitch: couponSwitch ?? this.couponSwitch,
    integralSwitch: integralSwitch ?? this.integralSwitch,
  );
  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['coupon_switch'] = couponSwitch;
    map['integral_switch'] = integralSwitch;
    return map;
  }

}

class CouponListModel {
  CouponListModel({
    this.list,
    this.total,});

  CouponListModel.fromJson(dynamic json) {
    if (json['list'] != null) {
      list = [];
      json['list'].forEach((v) {
        list?.add(CouponModel.fromJson(v));
      });
    }
    total = json['total'];
  }
  List<CouponModel>? list;
  num? total;
  CouponListModel copyWith({  List<CouponModel>? list,
    num? total,
  }) => CouponListModel(  list: list ?? this.list,
    total: total ?? this.total,
  );
  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    if (list != null) {
      map['list'] = list?.map((v) => v.toJson()).toList();
    }
    map['total'] = total;
    return map;
  }

}