service_repair_detail_entity.g.dart 4.3 KB

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