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.

75 lines
2.0KB

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