labour_review_status_entity.g.dart 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. import 'package:domain/generated/json/base/json_convert_content.dart';
  2. import 'package:domain/entity/response/labour_review_status_entity.dart';
  3. LabourReviewStatusEntity $LabourReviewStatusEntityFromJson(Map<String, dynamic> json) {
  4. final LabourReviewStatusEntity labourReviewStatusEntity = LabourReviewStatusEntity();
  5. final int? coDepartmentId = jsonConvert.convert<int>(json['co_department_id']);
  6. if (coDepartmentId != null) {
  7. labourReviewStatusEntity.coDepartmentId = coDepartmentId;
  8. }
  9. final List<LabourReviewStatusRecords>? records = (json['records'] as List<dynamic>?)?.map(
  10. (e) => jsonConvert.convert<LabourReviewStatusRecords>(e) as LabourReviewStatusRecords).toList();
  11. if (records != null) {
  12. labourReviewStatusEntity.records = records;
  13. }
  14. return labourReviewStatusEntity;
  15. }
  16. Map<String, dynamic> $LabourReviewStatusEntityToJson(LabourReviewStatusEntity entity) {
  17. final Map<String, dynamic> data = <String, dynamic>{};
  18. data['co_department_id'] = entity.coDepartmentId;
  19. data['records'] = entity.records.map((v) => v.toJson()).toList();
  20. return data;
  21. }
  22. extension LabourReviewStatusEntityExtension on LabourReviewStatusEntity {
  23. LabourReviewStatusEntity copyWith({
  24. int? coDepartmentId,
  25. List<LabourReviewStatusRecords>? records,
  26. }) {
  27. return LabourReviewStatusEntity()
  28. ..coDepartmentId = coDepartmentId ?? this.coDepartmentId
  29. ..records = records ?? this.records;
  30. }
  31. }
  32. LabourReviewStatusRecords $LabourReviewStatusRecordsFromJson(Map<String, dynamic> json) {
  33. final LabourReviewStatusRecords labourReviewStatusRecords = LabourReviewStatusRecords();
  34. final String? serialNumber = jsonConvert.convert<String>(json['serial_number']);
  35. if (serialNumber != null) {
  36. labourReviewStatusRecords.serialNumber = serialNumber;
  37. }
  38. final String? nodeName = jsonConvert.convert<String>(json['node_name']);
  39. if (nodeName != null) {
  40. labourReviewStatusRecords.nodeName = nodeName;
  41. }
  42. final String? statusShow = jsonConvert.convert<String>(json['status_show']);
  43. if (statusShow != null) {
  44. labourReviewStatusRecords.statusShow = statusShow;
  45. }
  46. final String? auditName = jsonConvert.convert<String>(json['audit_name']);
  47. if (auditName != null) {
  48. labourReviewStatusRecords.auditName = auditName;
  49. }
  50. final String? auditTime = jsonConvert.convert<String>(json['audit_time']);
  51. if (auditTime != null) {
  52. labourReviewStatusRecords.auditTime = auditTime;
  53. }
  54. final dynamic auditMark = json['audit_mark'];
  55. if (auditMark != null) {
  56. labourReviewStatusRecords.auditMark = auditMark;
  57. }
  58. final String? createdAt = jsonConvert.convert<String>(json['created_at']);
  59. if (createdAt != null) {
  60. labourReviewStatusRecords.createdAt = createdAt;
  61. }
  62. final String? assigneeTypeShow = jsonConvert.convert<String>(json['assignee_type_show']);
  63. if (assigneeTypeShow != null) {
  64. labourReviewStatusRecords.assigneeTypeShow = assigneeTypeShow;
  65. }
  66. final String? designationShow = jsonConvert.convert<String>(json['designation_show']);
  67. if (designationShow != null) {
  68. labourReviewStatusRecords.designationShow = designationShow;
  69. }
  70. return labourReviewStatusRecords;
  71. }
  72. Map<String, dynamic> $LabourReviewStatusRecordsToJson(LabourReviewStatusRecords entity) {
  73. final Map<String, dynamic> data = <String, dynamic>{};
  74. data['serial_number'] = entity.serialNumber;
  75. data['node_name'] = entity.nodeName;
  76. data['status_show'] = entity.statusShow;
  77. data['audit_name'] = entity.auditName;
  78. data['audit_time'] = entity.auditTime;
  79. data['audit_mark'] = entity.auditMark;
  80. data['created_at'] = entity.createdAt;
  81. data['assignee_type_show'] = entity.assigneeTypeShow;
  82. data['designation_show'] = entity.designationShow;
  83. return data;
  84. }
  85. extension LabourReviewStatusRecordsExtension on LabourReviewStatusRecords {
  86. LabourReviewStatusRecords copyWith({
  87. String? serialNumber,
  88. String? nodeName,
  89. String? statusShow,
  90. String? auditName,
  91. String? auditTime,
  92. dynamic auditMark,
  93. String? createdAt,
  94. String? assigneeTypeShow,
  95. String? designationShow,
  96. }) {
  97. return LabourReviewStatusRecords()
  98. ..serialNumber = serialNumber ?? this.serialNumber
  99. ..nodeName = nodeName ?? this.nodeName
  100. ..statusShow = statusShow ?? this.statusShow
  101. ..auditName = auditName ?? this.auditName
  102. ..auditTime = auditTime ?? this.auditTime
  103. ..auditMark = auditMark ?? this.auditMark
  104. ..createdAt = createdAt ?? this.createdAt
  105. ..assigneeTypeShow = assigneeTypeShow ?? this.assigneeTypeShow
  106. ..designationShow = designationShow ?? this.designationShow;
  107. }
  108. }