import 'package:farm_tpf/custom_model/SuppliesUsing.dart'; import 'package:farm_tpf/custom_model/action_form/ActionUIField.dart'; class RequestActivity { int? id; int? tbActivityTypeId; int? tbCropId; num? totalCost; String? executeDate; String? externalTable; String? description; String? media; List? tbObjectUpdateDTOList; List? tbSuppliesUsingDetailsDTOs; List? tbNurseryDetailsDTOList; List? deletedImages; RequestActivity( {this.id, this.tbActivityTypeId, this.tbCropId, this.totalCost, this.executeDate, this.externalTable, this.description, this.media, this.tbObjectUpdateDTOList, this.tbSuppliesUsingDetailsDTOs, this.tbNurseryDetailsDTOList, this.deletedImages}); RequestActivity.fromJson(Map json) { id = json['id']; tbActivityTypeId = json['tbActivityTypeId']; tbCropId = json['tbCropId']; totalCost = json['totalCost']; executeDate = json['executeDate']; externalTable = json['externalTable']; description = json['description']; media = json['media']; if (json['tbObjectUpdateDTOList'] != null) { tbObjectUpdateDTOList = []; json['tbObjectUpdateDTOList'].forEach((v) { tbObjectUpdateDTOList?.add(new TbObjectUpdateDTO.fromJson(v)); }); } if (json['tbSuppliesUsingDetailsDTOs'] != null) { tbSuppliesUsingDetailsDTOs = []; json['tbSuppliesUsingDetailsDTOs'].forEach((v) { tbSuppliesUsingDetailsDTOs?.add(new SuppliesUsing.fromJson(v)); }); } if (json['tbNurseryDetailsDTOList'] != null) { tbNurseryDetailsDTOList = []; json['tbNurseryDetailsDTOList'].forEach((v) { tbNurseryDetailsDTOList?.add(new TbNurseryDetailsDTO.fromJson(v)); }); } } Map toJson() { final Map data = new Map(); data['id'] = this.id; data['tbActivityTypeId'] = this.tbActivityTypeId; data['tbCropId'] = this.tbCropId; data['totalCost'] = this.totalCost; data['executeDate'] = this.executeDate; data['externalTable'] = this.externalTable; data['description'] = this.description; data['media'] = this.media; if (this.tbObjectUpdateDTOList != null) { data['tbObjectUpdateDTOList'] = this.tbObjectUpdateDTOList?.map((v) => v.toJson()).toList(); } if (this.tbSuppliesUsingDetailsDTOs != null) { data['tbSuppliesUsingDetailsDTOs'] = this.tbSuppliesUsingDetailsDTOs?.map((v) => v.toJson()).toList(); } if (this.tbNurseryDetailsDTOList != null) { data['tbNurseryDetailsDTOList'] = this.tbNurseryDetailsDTOList?.map((v) => v.toJson()).toList(); } data['deletedImages'] = this.deletedImages; return data; } } class TbObjectUpdateDTO { int? tbObjectParameterId; String? index; int? id; ActionUIField? tbObjectParameterDTO; TbObjectUpdateDTO({this.tbObjectParameterId, this.index, this.id, this.tbObjectParameterDTO}); TbObjectUpdateDTO.fromJson(Map json) { tbObjectParameterId = json['tbObjectParameterId']; index = json['index']; id = json['id']; tbObjectParameterDTO = json['tbObjectParameterDTO'] != null ? new ActionUIField.fromJson(json['tbObjectParameterDTO']) : null; } Map toJson() { final Map data = new Map(); data['tbObjectParameterId'] = this.tbObjectParameterId; data['index'] = this.index; data['id'] = this.id; if (this.tbObjectParameterDTO != null) { data['tbObjectParameterDTO'] = this.tbObjectParameterDTO?.toJson(); } return data; } } class TbNurseryDetailsDTO { int? id; String? workerName; String? trayNumber; TbNurseryDetailsDTO({this.workerName, this.trayNumber}); TbNurseryDetailsDTO.fromJson(Map json) { id = json['id']; workerName = json['workerName']; trayNumber = json['trayNumber']; } Map toJson() { final Map data = new Map(); data['id'] = this.id; data['workerName'] = this.workerName; data['trayNumber'] = this.trayNumber; return data; } }