/*
 * @Author       : WuWei
 * @LastEditors  : WuWei
 * @Date         : 2022-03-31 17:00:03
 * @LastEditTime : 2023-02-08 17:39:20
 * @Description  : Do not edit
 */

class PayTypeModel {
  String? id;
  String? name;
  String? offLinePayTypeId;
  int? payWay;
  bool? enable;
  List<RelationBankAccountsOfPayTypeModel>? relationBankAccounts;

  PayTypeModel({
    this.id,
    this.name,
    this.offLinePayTypeId,
    this.payWay,
    this.enable,
    this.relationBankAccounts,
  });

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

    id = map['id'];
    name = map['name'];
    offLinePayTypeId = map['offLinePayTypeId'];
    payWay = map['payWay'];
    enable = map['enable'];
    relationBankAccounts = List<RelationBankAccountsOfPayTypeModel>.from(
        (map["relationBankAccounts"] ?? [])
            .map((x) => RelationBankAccountsOfPayTypeModel.fromJson(x)));
  }

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

    json['id'] = this.id;
    json['name'] = this.name;
    json['offLinePayTypeId'] = this.offLinePayTypeId;
    json['payWay'] = this.payWay;
    json['enable'] = this.enable;
    json['relationBankAccounts'] =
        List<dynamic>.from((relationBankAccounts ?? []).map((x) => x.toJson()));

    return json;
  }
}

class RelationBankAccountsOfPayTypeModel {
  String? id;
  String? bank;
  String? bankAccount;
  bool? enable;

  RelationBankAccountsOfPayTypeModel({
    this.id,
    this.bank,
    this.bankAccount,
    this.enable,
  });

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

    id = map['id'];
    bank = map['bank'];
    bankAccount = map['bankAccount'];
    enable = map['enable'];
  }

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

    json['id'] = this.id;
    json['bank'] = this.bank;
    json['bankAccount'] = this.bankAccount;
    json['enable'] = this.enable;

    return json;
  }
}
