class ChargeModel {
  List<PaymentDataOfChargeModelModel>? paymentData;
  List<ArrearsTempOfChargeModelModel>? arrearsTemp;
  List<RateOfChargeModelModel>? rate;

  ChargeModel({
    this.paymentData,
    this.arrearsTemp,
    this.rate,
  });

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

    paymentData = List<PaymentDataOfChargeModelModel>.from(
        (map["paymentData"] ?? [])
            .map((x) => PaymentDataOfChargeModelModel.fromJson(x)));
    arrearsTemp = List<ArrearsTempOfChargeModelModel>.from(
        (map["arrearsTemp"] ?? [])
            .map((x) => ArrearsTempOfChargeModelModel.fromJson(x)));
    rate = List<RateOfChargeModelModel>.from(
        (map["rate"] ?? []).map((x) => RateOfChargeModelModel.fromJson(x)));
  }

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

    json['paymentData'] =
        List<dynamic>.from((paymentData ?? []).map((x) => x.toJson()));
    json['arrearsTemp'] =
        List<dynamic>.from((arrearsTemp ?? []).map((x) => x.toJson()));
    json['rate'] = List<dynamic>.from((rate ?? []).map((x) => x.toJson()));

    return json;
  }
}

class PaymentDataOfChargeModelModel {
  String? name;
  num? number;
  num? money;

  PaymentDataOfChargeModelModel({
    this.name,
    this.number,
    this.money,
  });

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

    name = map['name'];
    number = map['number'];
    money = map['money'];
  }

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

    json['name'] = this.name;
    json['number'] = this.number;
    json['money'] = this.money;

    return json;
  }
}

class ArrearsTempOfChargeModelModel {
  String? name;
  num? lastYearArrears;
  num? thisYearArrears;

  ArrearsTempOfChargeModelModel({
    this.name,
    this.lastYearArrears,
    this.thisYearArrears,
  });

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

    name = map['name'];
    lastYearArrears = map['lastYearArrears'];
    thisYearArrears = map['thisYearArrears'];
  }

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

    json['name'] = this.name;
    json['lastYearArrears'] = this.lastYearArrears;
    json['thisYearArrears'] = this.thisYearArrears;

    return json;
  }
}

class RateOfChargeModelModel {
  String? name;
  String? number;

  RateOfChargeModelModel({
    this.name,
    this.number,
  });

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

    name = map['name'];
    number = map['number'];
  }

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

    json['name'] = this.name;
    json['number'] = this.number;

    return json;
  }
}
