service_repair_detail_entity.g.dart 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. import 'package:domain/generated/json/base/json_convert_content.dart';
  2. import 'package:domain/entity/service_repair_detail_entity.dart';
  3. ServiceRepairDetailEntity $ServiceRepairDetailEntityFromJson(Map<String, dynamic> json) {
  4. final ServiceRepairDetailEntity serviceRepairDetailEntity = ServiceRepairDetailEntity();
  5. final int? id = jsonConvert.convert<int>(json['id']);
  6. if (id != null) {
  7. serviceRepairDetailEntity.id = id;
  8. }
  9. final String? name = jsonConvert.convert<String>(json['name']);
  10. if (name != null) {
  11. serviceRepairDetailEntity.name = name;
  12. }
  13. final String? description = jsonConvert.convert<String>(json['description']);
  14. if (description != null) {
  15. serviceRepairDetailEntity.description = description;
  16. }
  17. final ServiceRepairDetailMerchant? merchant = jsonConvert.convert<ServiceRepairDetailMerchant>(json['merchant']);
  18. if (merchant != null) {
  19. serviceRepairDetailEntity.merchant = merchant;
  20. }
  21. final ServiceRepairDetailCategory? category = jsonConvert.convert<ServiceRepairDetailCategory>(json['category']);
  22. if (category != null) {
  23. serviceRepairDetailEntity.category = category;
  24. }
  25. return serviceRepairDetailEntity;
  26. }
  27. Map<String, dynamic> $ServiceRepairDetailEntityToJson(ServiceRepairDetailEntity entity) {
  28. final Map<String, dynamic> data = <String, dynamic>{};
  29. data['id'] = entity.id;
  30. data['name'] = entity.name;
  31. data['description'] = entity.description;
  32. data['merchant'] = entity.merchant.toJson();
  33. data['category'] = entity.category.toJson();
  34. return data;
  35. }
  36. extension ServiceRepairDetailEntityExtension on ServiceRepairDetailEntity {
  37. ServiceRepairDetailEntity copyWith({
  38. int? id,
  39. String? name,
  40. String? description,
  41. ServiceRepairDetailMerchant? merchant,
  42. ServiceRepairDetailCategory? category,
  43. }) {
  44. return ServiceRepairDetailEntity()
  45. ..id = id ?? this.id
  46. ..name = name ?? this.name
  47. ..description = description ?? this.description
  48. ..merchant = merchant ?? this.merchant
  49. ..category = category ?? this.category;
  50. }
  51. }
  52. ServiceRepairDetailMerchant $ServiceRepairDetailMerchantFromJson(Map<String, dynamic> json) {
  53. final ServiceRepairDetailMerchant serviceRepairDetailMerchant = ServiceRepairDetailMerchant();
  54. final int? id = jsonConvert.convert<int>(json['id']);
  55. if (id != null) {
  56. serviceRepairDetailMerchant.id = id;
  57. }
  58. final String? name = jsonConvert.convert<String>(json['name']);
  59. if (name != null) {
  60. serviceRepairDetailMerchant.name = name;
  61. }
  62. return serviceRepairDetailMerchant;
  63. }
  64. Map<String, dynamic> $ServiceRepairDetailMerchantToJson(ServiceRepairDetailMerchant entity) {
  65. final Map<String, dynamic> data = <String, dynamic>{};
  66. data['id'] = entity.id;
  67. data['name'] = entity.name;
  68. return data;
  69. }
  70. extension ServiceRepairDetailMerchantExtension on ServiceRepairDetailMerchant {
  71. ServiceRepairDetailMerchant copyWith({
  72. int? id,
  73. String? name,
  74. }) {
  75. return ServiceRepairDetailMerchant()
  76. ..id = id ?? this.id
  77. ..name = name ?? this.name;
  78. }
  79. }
  80. ServiceRepairDetailCategory $ServiceRepairDetailCategoryFromJson(Map<String, dynamic> json) {
  81. final ServiceRepairDetailCategory serviceRepairDetailCategory = ServiceRepairDetailCategory();
  82. final int? id = jsonConvert.convert<int>(json['id']);
  83. if (id != null) {
  84. serviceRepairDetailCategory.id = id;
  85. }
  86. final String? name = jsonConvert.convert<String>(json['name']);
  87. if (name != null) {
  88. serviceRepairDetailCategory.name = name;
  89. }
  90. final String? type = jsonConvert.convert<String>(json['type']);
  91. if (type != null) {
  92. serviceRepairDetailCategory.type = type;
  93. }
  94. return serviceRepairDetailCategory;
  95. }
  96. Map<String, dynamic> $ServiceRepairDetailCategoryToJson(ServiceRepairDetailCategory entity) {
  97. final Map<String, dynamic> data = <String, dynamic>{};
  98. data['id'] = entity.id;
  99. data['name'] = entity.name;
  100. data['type'] = entity.type;
  101. return data;
  102. }
  103. extension ServiceRepairDetailCategoryExtension on ServiceRepairDetailCategory {
  104. ServiceRepairDetailCategory copyWith({
  105. int? id,
  106. String? name,
  107. String? type,
  108. }) {
  109. return ServiceRepairDetailCategory()
  110. ..id = id ?? this.id
  111. ..name = name ?? this.name
  112. ..type = type ?? this.type;
  113. }
  114. }