import 'package:domain/generated/json/base/json_convert_content.dart'; import 'package:domain/entity/service_repair_detail_entity.dart'; ServiceRepairDetailEntity $ServiceRepairDetailEntityFromJson(Map json) { final ServiceRepairDetailEntity serviceRepairDetailEntity = ServiceRepairDetailEntity(); final int? id = jsonConvert.convert(json['id']); if (id != null) { serviceRepairDetailEntity.id = id; } final String? name = jsonConvert.convert(json['name']); if (name != null) { serviceRepairDetailEntity.name = name; } final String? description = jsonConvert.convert(json['description']); if (description != null) { serviceRepairDetailEntity.description = description; } final ServiceRepairDetailMerchant? merchant = jsonConvert.convert(json['merchant']); if (merchant != null) { serviceRepairDetailEntity.merchant = merchant; } final ServiceRepairDetailCategory? category = jsonConvert.convert(json['category']); if (category != null) { serviceRepairDetailEntity.category = category; } return serviceRepairDetailEntity; } Map $ServiceRepairDetailEntityToJson(ServiceRepairDetailEntity entity) { final Map data = {}; data['id'] = entity.id; data['name'] = entity.name; data['description'] = entity.description; data['merchant'] = entity.merchant.toJson(); data['category'] = entity.category.toJson(); return data; } extension ServiceRepairDetailEntityExtension on ServiceRepairDetailEntity { ServiceRepairDetailEntity copyWith({ int? id, String? name, String? description, ServiceRepairDetailMerchant? merchant, ServiceRepairDetailCategory? category, }) { return ServiceRepairDetailEntity() ..id = id ?? this.id ..name = name ?? this.name ..description = description ?? this.description ..merchant = merchant ?? this.merchant ..category = category ?? this.category; } } ServiceRepairDetailMerchant $ServiceRepairDetailMerchantFromJson(Map json) { final ServiceRepairDetailMerchant serviceRepairDetailMerchant = ServiceRepairDetailMerchant(); final int? id = jsonConvert.convert(json['id']); if (id != null) { serviceRepairDetailMerchant.id = id; } final String? name = jsonConvert.convert(json['name']); if (name != null) { serviceRepairDetailMerchant.name = name; } return serviceRepairDetailMerchant; } Map $ServiceRepairDetailMerchantToJson(ServiceRepairDetailMerchant entity) { final Map data = {}; data['id'] = entity.id; data['name'] = entity.name; return data; } extension ServiceRepairDetailMerchantExtension on ServiceRepairDetailMerchant { ServiceRepairDetailMerchant copyWith({ int? id, String? name, }) { return ServiceRepairDetailMerchant() ..id = id ?? this.id ..name = name ?? this.name; } } ServiceRepairDetailCategory $ServiceRepairDetailCategoryFromJson(Map json) { final ServiceRepairDetailCategory serviceRepairDetailCategory = ServiceRepairDetailCategory(); final int? id = jsonConvert.convert(json['id']); if (id != null) { serviceRepairDetailCategory.id = id; } final String? name = jsonConvert.convert(json['name']); if (name != null) { serviceRepairDetailCategory.name = name; } final String? type = jsonConvert.convert(json['type']); if (type != null) { serviceRepairDetailCategory.type = type; } return serviceRepairDetailCategory; } Map $ServiceRepairDetailCategoryToJson(ServiceRepairDetailCategory entity) { final Map data = {}; data['id'] = entity.id; data['name'] = entity.name; data['type'] = entity.type; return data; } extension ServiceRepairDetailCategoryExtension on ServiceRepairDetailCategory { ServiceRepairDetailCategory copyWith({ int? id, String? name, String? type, }) { return ServiceRepairDetailCategory() ..id = id ?? this.id ..name = name ?? this.name ..type = type ?? this.type; } }