You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
2.1KB

  1. import 'SuppliesUsing.dart';
  2. class HarvestProcess {
  3. int id;
  4. int cropId;
  5. int activityId;
  6. int harvestId;
  7. String executeDate;
  8. String description;
  9. String executeBy;
  10. String media;
  11. List<String> mediaDel;
  12. num quantityLv1;
  13. num quantityLv2;
  14. num quantityLv3;
  15. num removedQuantity;
  16. List<SuppliesUsing> suppliesUsing;
  17. HarvestProcess(
  18. {this.id,
  19. this.cropId,
  20. this.activityId,
  21. this.harvestId,
  22. this.executeDate,
  23. this.description,
  24. this.executeBy,
  25. this.media,
  26. this.mediaDel,
  27. this.quantityLv1,
  28. this.quantityLv2,
  29. this.quantityLv3,
  30. this.removedQuantity,
  31. this.suppliesUsing});
  32. HarvestProcess.fromJson(Map<String, dynamic> json) {
  33. id = json['id'];
  34. cropId = json['cropId'];
  35. activityId = json['activityId'];
  36. harvestId = json['harvestId'];
  37. executeDate = json['executeDate'];
  38. description = json['description'];
  39. executeBy = json['executeBy'];
  40. media = json['media'];
  41. quantityLv1 = json['quantityLv1'];
  42. quantityLv2 = json['quantityLv2'];
  43. quantityLv3 = json['quantityLv3'];
  44. removedQuantity = json['removedQuantity'];
  45. if (json['suppliesUsing'] != null) {
  46. suppliesUsing = new List<SuppliesUsing>();
  47. json['suppliesUsing'].forEach((v) {
  48. suppliesUsing.add(new SuppliesUsing.fromJson(v));
  49. });
  50. }
  51. }
  52. Map<String, dynamic> toJson() {
  53. final Map<String, dynamic> data = new Map<String, dynamic>();
  54. data['id'] = this.id;
  55. data['cropId'] = this.cropId;
  56. data['activityId'] = this.activityId;
  57. data['harvestId'] = this.harvestId;
  58. data['executeDate'] = this.executeDate;
  59. data['description'] = this.description;
  60. data['executeBy'] = this.executeBy;
  61. data['media'] = this.media;
  62. data['media_del'] = this.mediaDel;
  63. data['quantityLv1'] = this.quantityLv1;
  64. data['quantityLv2'] = this.quantityLv2;
  65. data['quantityLv3'] = this.quantityLv3;
  66. data['removedQuantity'] = this.removedQuantity;
  67. if (this.suppliesUsing != null) {
  68. data['suppliesUsing'] =
  69. this.suppliesUsing.map((v) => v.toJson()).toList();
  70. }
  71. return data;
  72. }
  73. }