class ClosedIOModel {
  int? statusCode;
  Data? data;
  String? message;
  bool? success;

  ClosedIOModel({this.statusCode, this.data, this.message, this.success});

  ClosedIOModel.fromJson(Map<String, dynamic> json) {
    statusCode = json['statusCode'];
    data = json['data'] != null ? Data.fromJson(json['data']) : null;
    message = json['message'];
    success = json['success'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['statusCode'] = statusCode;
    if (this.data != null) {
      data['data'] = this.data!.toJson();
    }
    data['message'] = message;
    data['success'] = success;
    return data;
  }
}

class Data {
  int? totalItems;
  List<Rows>? rows;
  int? totalPages;
  int? currentPage;

  Data({this.totalItems, this.rows, this.totalPages, this.currentPage});

  Data.fromJson(Map<String, dynamic> json) {
    totalItems = json['totalItems'];
    if (json['rows'] != null) {
      rows = <Rows>[];
      json['rows'].forEach((v) {
        rows!.add(Rows.fromJson(v));
      });
    }
    totalPages = json['totalPages'];
    currentPage = json['currentPage'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['totalItems'] = totalItems;
    if (rows != null) {
      data['rows'] = rows!.map((v) => v.toJson()).toList();
    }
    data['totalPages'] = totalPages;
    data['currentPage'] = currentPage;
    return data;
  }
}

class Rows {
  int? id;
  String? ioId;
  int? investmentTypeXid;
  int? sponsorXid;
  int? ioStatusXid;
  String? investmentNameEnglish;
  String? investmentNameArabic;
  String? descriptionEnglish;
  String? descriptionArabic;
  String? goalAmount;
  String? closingDate;
  String? holdingPeriod;
  String? expectedReturn;
  String? originalValuation;
  String? currentValuation;
  String? iSIN;
  String? investmentDetails;
  String? comment;
  bool? isInvestedAmount;
  String? amountInvested;
  bool? isActive;
  Null createdBy;
  Null modifiedBy;
  String? createdAt;
  String? updatedAt;
  Null deletedAt;
  Sponsor? sponsor;
  IoStatus? ioStatus;
  InvestmentType? investmentType;
  List<String>? artifactsImage;
  List<MinInvestmentAmt>? minInvestmentAmt;

  Rows(
      {this.id,
      this.ioId,
      this.investmentTypeXid,
      this.sponsorXid,
      this.ioStatusXid,
      this.investmentNameEnglish,
      this.investmentNameArabic,
      this.descriptionEnglish,
      this.descriptionArabic,
      this.goalAmount,
      this.closingDate,
      this.holdingPeriod,
      this.expectedReturn,
      this.originalValuation,
      this.currentValuation,
      this.iSIN,
      this.investmentDetails,
      this.comment,
      this.isInvestedAmount,
      this.amountInvested,
      this.isActive,
      this.createdBy,
      this.modifiedBy,
      this.createdAt,
      this.updatedAt,
      this.deletedAt,
      this.sponsor,
      this.ioStatus,
      this.investmentType,
      this.artifactsImage,
      this.minInvestmentAmt});

  Rows.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    ioId = json['io_id'];
    investmentTypeXid = json['investmentType_xid'];
    sponsorXid = json['sponsor_xid'];
    ioStatusXid = json['ioStatus_xid'];
    investmentNameEnglish = json['investmentNameEnglish'];
    investmentNameArabic = json['investmentNameArabic'];
    descriptionEnglish = json['descriptionEnglish'];
    descriptionArabic = json['descriptionArabic'];
    goalAmount = json['goalAmount'];
    closingDate = json['closingDate'];
    holdingPeriod = json['holdingPeriod'];
    expectedReturn = json['expectedReturn'];
    originalValuation = json['originalValuation'];
    currentValuation = json['currentValuation'];
    iSIN = json['ISIN'];
    investmentDetails = json['InvestmentDetails'];
    comment = json['comment'];
    isInvestedAmount = json['isInvestedAmount'];
    amountInvested = json['amountInvested'];
    isActive = json['isActive'];
    createdBy = json['createdBy'];
    modifiedBy = json['modifiedBy'];
    createdAt = json['createdAt'];
    updatedAt = json['updatedAt'];
    deletedAt = json['deletedAt'];
    sponsor =
        json['sponsor'] != null ? Sponsor.fromJson(json['sponsor']) : null;
    ioStatus =
        json['ioStatus'] != null ? IoStatus.fromJson(json['ioStatus']) : null;
    investmentType = json['investmentType'] != null
        ? InvestmentType.fromJson(json['investmentType'])
        : null;
    if (json['artifactsImage'] != null) {
      artifactsImage = <String>[];
      json['artifactsImage'].forEach((v) {
        artifactsImage!.add(v);
      });
    }
    if (json['minInvestmentAmt'] != null) {
      minInvestmentAmt = <MinInvestmentAmt>[];
      json['minInvestmentAmt'].forEach((v) {
        minInvestmentAmt!.add(MinInvestmentAmt.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['id'] = id;
    data['io_id'] = ioId;
    data['investmentType_xid'] = investmentTypeXid;
    data['sponsor_xid'] = sponsorXid;
    data['ioStatus_xid'] = ioStatusXid;
    data['investmentNameEnglish'] = investmentNameEnglish;
    data['investmentNameArabic'] = investmentNameArabic;
    data['descriptionEnglish'] = descriptionEnglish;
    data['descriptionArabic'] = descriptionArabic;
    data['goalAmount'] = goalAmount;
    data['closingDate'] = closingDate;
    data['holdingPeriod'] = holdingPeriod;
    data['expectedReturn'] = expectedReturn;
    data['originalValuation'] = originalValuation;
    data['currentValuation'] = currentValuation;
    data['ISIN'] = iSIN;
    data['InvestmentDetails'] = investmentDetails;
    data['comment'] = comment;
    data['isInvestedAmount'] = isInvestedAmount;
    data['amountInvested'] = amountInvested;
    data['isActive'] = isActive;
    data['createdBy'] = createdBy;
    data['modifiedBy'] = modifiedBy;
    data['createdAt'] = createdAt;
    data['updatedAt'] = updatedAt;
    data['deletedAt'] = deletedAt;
    if (sponsor != null) {
      data['sponsor'] = sponsor!.toJson();
    }
    if (ioStatus != null) {
      data['ioStatus'] = ioStatus!.toJson();
    }
    if (investmentType != null) {
      data['investmentType'] = investmentType!.toJson();
    }
    if (artifactsImage != null) {
      data['artifactsImage'] = artifactsImage!.map((v) => v).toList();
    }
    if (minInvestmentAmt != null) {
      data['minInvestmentAmt'] =
          minInvestmentAmt!.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class Sponsor {
  int? id;
  String? sponsorName;
  String? sponsorNameArabic;
  String? email;
  Null profile;
  Null address;
  Null mobileNo;
  Null bankName;
  Null accountNumber;
  bool? isActive;
  Null createdBy;
  Null modifiedBy;
  String? createdAt;
  String? updatedAt;
  Null deletedAt;

  Sponsor(
      {this.id,
      this.sponsorName,
      this.sponsorNameArabic,
      this.email,
      this.profile,
      this.address,
      this.mobileNo,
      this.bankName,
      this.accountNumber,
      this.isActive,
      this.createdBy,
      this.modifiedBy,
      this.createdAt,
      this.updatedAt,
      this.deletedAt});

  Sponsor.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    sponsorName = json['sponsorName'];
    sponsorNameArabic = json['sponsorNameArabic'];
    email = json['email'];
    profile = json['profile'];
    address = json['address'];
    mobileNo = json['mobileNo'];
    bankName = json['bankName'];
    accountNumber = json['accountNumber'];
    isActive = json['isActive'];
    createdBy = json['createdBy'];
    modifiedBy = json['modifiedBy'];
    createdAt = json['createdAt'];
    updatedAt = json['updatedAt'];
    deletedAt = json['deletedAt'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['id'] = id;
    data['sponsorName'] = sponsorName;
    data['sponsorNameArabic'] = sponsorNameArabic;
    data['email'] = email;
    data['profile'] = profile;
    data['address'] = address;
    data['mobileNo'] = mobileNo;
    data['bankName'] = bankName;
    data['accountNumber'] = accountNumber;
    data['isActive'] = isActive;
    data['createdBy'] = createdBy;
    data['modifiedBy'] = modifiedBy;
    data['createdAt'] = createdAt;
    data['updatedAt'] = updatedAt;
    data['deletedAt'] = deletedAt;
    return data;
  }
}

class IoStatus {
  int? id;
  String? statusAdmin;
  String? statusInvest;
  String? statusPortfolio;
  bool? isActive;
  Null createdBy;
  Null modifiedBy;
  String? createdAt;
  String? updatedAt;
  Null deletedAt;

  IoStatus(
      {this.id,
      this.statusAdmin,
      this.statusInvest,
      this.statusPortfolio,
      this.isActive,
      this.createdBy,
      this.modifiedBy,
      this.createdAt,
      this.updatedAt,
      this.deletedAt});

  IoStatus.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    statusAdmin = json['statusAdmin'];
    statusInvest = json['statusInvest'];
    statusPortfolio = json['statusPortfolio'];
    isActive = json['isActive'];
    createdBy = json['createdBy'];
    modifiedBy = json['modifiedBy'];
    createdAt = json['createdAt'];
    updatedAt = json['updatedAt'];
    deletedAt = json['deletedAt'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['id'] = id;
    data['statusAdmin'] = statusAdmin;
    data['statusInvest'] = statusInvest;
    data['statusPortfolio'] = statusPortfolio;
    data['isActive'] = isActive;
    data['createdBy'] = createdBy;
    data['modifiedBy'] = modifiedBy;
    data['createdAt'] = createdAt;
    data['updatedAt'] = updatedAt;
    data['deletedAt'] = deletedAt;
    return data;
  }
}

class InvestmentType {
  int? id;
  String? investmentTypeName;
  String? investmentTypeNameArabic;
  String? note;
  String? noteArabic;
  bool? isActive;
  Null createdBy;
  Null modifiedBy;
  String? createdAt;
  String? updatedAt;
  Null deletedAt;

  InvestmentType(
      {this.id,
      this.investmentTypeName,
      this.investmentTypeNameArabic,
      this.note,
      this.noteArabic,
      this.isActive,
      this.createdBy,
      this.modifiedBy,
      this.createdAt,
      this.updatedAt,
      this.deletedAt});

  InvestmentType.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    investmentTypeName = json['investmentTypeName'];
    investmentTypeNameArabic = json['investmentTypeNameArabic'];
    note = json['note'];
    noteArabic = json['noteArabic'];
    isActive = json['isActive'];
    createdBy = json['createdBy'];
    modifiedBy = json['modifiedBy'];
    createdAt = json['createdAt'];
    updatedAt = json['updatedAt'];
    deletedAt = json['deletedAt'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['id'] = id;
    data['investmentTypeName'] = investmentTypeName;
    data['investmentTypeNameArabic'] = investmentTypeNameArabic;
    data['note'] = note;
    data['noteArabic'] = noteArabic;
    data['isActive'] = isActive;
    data['createdBy'] = createdBy;
    data['modifiedBy'] = modifiedBy;
    data['createdAt'] = createdAt;
    data['updatedAt'] = updatedAt;
    data['deletedAt'] = deletedAt;
    return data;
  }
}

class MinInvestmentAmt {
  int? id;
  int? ioXid;
  int? countryXid;
  String? minInvestmentAmt;
  String? maxInvestmentAmt;
  bool? isActive;
  Null createdBy;
  Null modifiedBy;
  String? createdAt;
  String? updatedAt;
  Null deletedAt;

  MinInvestmentAmt(
      {this.id,
      this.ioXid,
      this.countryXid,
      this.minInvestmentAmt,
      this.maxInvestmentAmt,
      this.isActive,
      this.createdBy,
      this.modifiedBy,
      this.createdAt,
      this.updatedAt,
      this.deletedAt});

  MinInvestmentAmt.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    ioXid = json['io_xid'];
    countryXid = json['country_xid'];
    minInvestmentAmt = json['minInvestmentAmt'];
    maxInvestmentAmt = json['maxInvestmentAmt'];
    isActive = json['isActive'];
    createdBy = json['createdBy'];
    modifiedBy = json['modifiedBy'];
    createdAt = json['createdAt'];
    updatedAt = json['updatedAt'];
    deletedAt = json['deletedAt'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['id'] = id;
    data['io_xid'] = ioXid;
    data['country_xid'] = countryXid;
    data['minInvestmentAmt'] = minInvestmentAmt;
    data['maxInvestmentAmt'] = maxInvestmentAmt;
    data['isActive'] = isActive;
    data['createdBy'] = createdBy;
    data['modifiedBy'] = modifiedBy;
    data['createdAt'] = createdAt;
    data['updatedAt'] = updatedAt;
    data['deletedAt'] = deletedAt;
    return data;
  }
}
