/*
 * @Author: WuWei
 * @Date: 2020-08-13 19:40:08
 * @LastEditors  : WuWei
 * @LastEditTime : 2023-06-16 10:15:13
 * @Description:
 */

class PayDetail {
  List<ReceiptModel>? receiptTickets;
  List<ReceiptModel>? invoiceTickets;
  List<ListOfPayDetailModel>? list;
  String? remark;
  num? totalPayFee;
  String? payAt;
  dynamic payWay;
  String? payer;
  String? payType;
  String? createBy;
  String? assetName;

  PayDetail({
    this.receiptTickets,
    this.invoiceTickets,
    this.list,
    this.remark,
    this.totalPayFee,
    this.payAt,
    this.payWay,
    this.payer,
    this.payType,
    this.createBy,
    this.assetName,
  });

  PayDetail.fromJson(json) {
    Map<String, dynamic> map = Map.from(json ?? {});

    receiptTickets = List<ReceiptModel>.from(
        (map["receiptTickets"] ?? []).map((x) => ReceiptModel.fromJson(x)));
    invoiceTickets = List<ReceiptModel>.from(
        (map["invoiceTickets"] ?? []).map((x) => ReceiptModel.fromJson(x)));
    list = List<ListOfPayDetailModel>.from(
        (map["list"] ?? []).map((x) => ListOfPayDetailModel.fromJson(x)));
    remark = map['remark'];
    totalPayFee = map['totalPayFee'];
    payAt = map['payAt'];
    payWay = map['payWay'];
    payer = map['payer'];
    payType = map['payType'];
    createBy = map['createBy'];
    assetName = map['assetName'];
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();

    json['receiptTickets'] = this.receiptTickets;
    json['invoiceTickets'] = this.invoiceTickets;
    json['list'] = List<dynamic>.from((list ?? []).map((x) => x.toJson()));
    json['remark'] = this.remark;
    json['totalPayFee'] = this.totalPayFee;
    json['payAt'] = this.payAt;
    json['payWay'] = this.payWay;
    json['payer'] = this.payer;
    json['payType'] = this.payType;
    json['createBy'] = this.createBy;
    json['assetName'] = this.assetName;

    return json;
  }
}

class ListOfPayDetailModel {
  String? feeType;
  String? fee;
  String? chargeYearMonth;

  ListOfPayDetailModel({
    this.feeType,
    this.fee,
    this.chargeYearMonth,
  });

  ListOfPayDetailModel.fromJson(json) {
    Map<String, dynamic> map = Map.from(json ?? {});

    feeType = map['feeType'];
    fee = map['fee'];
    chargeYearMonth = map['chargeYearMonth'];
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();

    json['feeType'] = this.feeType;
    json['fee'] = this.fee;
    json['chargeYearMonth'] = this.chargeYearMonth;

    return json;
  }
}

class ReceiptModel {
  String? ticketNo;
  num? fee;
  String? type;
  String? id;

  ReceiptModel({
    this.ticketNo,
    this.fee,
    this.type,
    this.id,
  });

  ReceiptModel.fromJson(json) {
    Map<String, dynamic> map = Map.from(json ?? {});

    ticketNo = map['ticketNo'];
    fee = map['fee'];
    type = map['type'];
    id = map['id'];
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();

    json['ticketNo'] = this.ticketNo;
    json['fee'] = this.fee;
    json['type'] = this.type;
    json['id'] = this.id;

    return json;
  }
}
