import 'package:domain/generated/json/base/json_convert_content.dart'; import 'package:domain/entity/service_in_progress_entity.dart'; ServiceInProgressEntity $ServiceInProgressEntityFromJson( Map json) { final ServiceInProgressEntity serviceInProgressEntity = ServiceInProgressEntity(); final int? count = jsonConvert.convert(json['count']); if (count != null) { serviceInProgressEntity.count = count; } final int? page = jsonConvert.convert(json['page']); if (page != null) { serviceInProgressEntity.page = page; } final int? limit = jsonConvert.convert(json['limit']); if (limit != null) { serviceInProgressEntity.limit = limit; } final int? countPage = jsonConvert.convert(json['count_page']); if (countPage != null) { serviceInProgressEntity.countPage = countPage; } final List? list = (json['list'] as List?) ?.map( (e) => jsonConvert.convert(e) as ServiceInProgressList) .toList(); if (list != null) { serviceInProgressEntity.list = list; } return serviceInProgressEntity; } Map $ServiceInProgressEntityToJson( ServiceInProgressEntity entity) { final Map data = {}; data['count'] = entity.count; data['page'] = entity.page; data['limit'] = entity.limit; data['count_page'] = entity.countPage; data['list'] = entity.list.map((v) => v.toJson()).toList(); return data; } extension ServiceInProgressEntityExtension on ServiceInProgressEntity { ServiceInProgressEntity copyWith({ int? count, int? page, int? limit, int? countPage, List? list, }) { return ServiceInProgressEntity() ..count = count ?? this.count ..page = page ?? this.page ..limit = limit ?? this.limit ..countPage = countPage ?? this.countPage ..list = list ?? this.list; } } ServiceInProgressList $ServiceInProgressListFromJson( Map json) { final ServiceInProgressList serviceInProgressList = ServiceInProgressList(); final int? id = jsonConvert.convert(json['id']); if (id != null) { serviceInProgressList.id = id; } final String? sn = jsonConvert.convert(json['sn']); if (sn != null) { serviceInProgressList.sn = sn; } final String? userNotes = jsonConvert.convert(json['user_notes']); if (userNotes != null) { serviceInProgressList.userNotes = userNotes; } final String? merchantNotes = jsonConvert.convert( json['merchant_notes']); if (merchantNotes != null) { serviceInProgressList.merchantNotes = merchantNotes; } final String? orderStatus = jsonConvert.convert(json['order_status']); if (orderStatus != null) { serviceInProgressList.orderStatus = orderStatus; } final ServiceInProgressListService? service = jsonConvert.convert< ServiceInProgressListService>(json['service']); if (service != null) { serviceInProgressList.service = service; } final ServiceInProgressListMerchant? merchant = jsonConvert.convert< ServiceInProgressListMerchant>(json['merchant']); if (merchant != null) { serviceInProgressList.merchant = merchant; } final String? staff = jsonConvert.convert(json['staff']); if (staff != null) { serviceInProgressList.staff = staff; } return serviceInProgressList; } Map $ServiceInProgressListToJson( ServiceInProgressList entity) { final Map data = {}; data['id'] = entity.id; data['sn'] = entity.sn; data['user_notes'] = entity.userNotes; data['merchant_notes'] = entity.merchantNotes; data['order_status'] = entity.orderStatus; data['service'] = entity.service.toJson(); data['merchant'] = entity.merchant.toJson(); data['staff'] = entity.staff; return data; } extension ServiceInProgressListExtension on ServiceInProgressList { ServiceInProgressList copyWith({ int? id, String? sn, String? userNotes, String? merchantNotes, String? orderStatus, ServiceInProgressListService? service, ServiceInProgressListMerchant? merchant, String? staff, }) { return ServiceInProgressList() ..id = id ?? this.id ..sn = sn ?? this.sn ..userNotes = userNotes ?? this.userNotes ..merchantNotes = merchantNotes ?? this.merchantNotes ..orderStatus = orderStatus ?? this.orderStatus ..service = service ?? this.service ..merchant = merchant ?? this.merchant ..staff = staff ?? this.staff; } } ServiceInProgressListService $ServiceInProgressListServiceFromJson( Map json) { final ServiceInProgressListService serviceInProgressListService = ServiceInProgressListService(); final int? id = jsonConvert.convert(json['id']); if (id != null) { serviceInProgressListService.id = id; } final String? name = jsonConvert.convert(json['name']); if (name != null) { serviceInProgressListService.name = name; } return serviceInProgressListService; } Map $ServiceInProgressListServiceToJson( ServiceInProgressListService entity) { final Map data = {}; data['id'] = entity.id; data['name'] = entity.name; return data; } extension ServiceInProgressListServiceExtension on ServiceInProgressListService { ServiceInProgressListService copyWith({ int? id, String? name, }) { return ServiceInProgressListService() ..id = id ?? this.id ..name = name ?? this.name; } } ServiceInProgressListMerchant $ServiceInProgressListMerchantFromJson( Map json) { final ServiceInProgressListMerchant serviceInProgressListMerchant = ServiceInProgressListMerchant(); final int? id = jsonConvert.convert(json['id']); if (id != null) { serviceInProgressListMerchant.id = id; } final String? name = jsonConvert.convert(json['name']); if (name != null) { serviceInProgressListMerchant.name = name; } final String? contactPhone = jsonConvert.convert( json['contact_phone']); if (contactPhone != null) { serviceInProgressListMerchant.contactPhone = contactPhone; } return serviceInProgressListMerchant; } Map $ServiceInProgressListMerchantToJson( ServiceInProgressListMerchant entity) { final Map data = {}; data['id'] = entity.id; data['name'] = entity.name; data['contact_phone'] = entity.contactPhone; return data; } extension ServiceInProgressListMerchantExtension on ServiceInProgressListMerchant { ServiceInProgressListMerchant copyWith({ int? id, String? name, String? contactPhone, }) { return ServiceInProgressListMerchant() ..id = id ?? this.id ..name = name ?? this.name ..contactPhone = contactPhone ?? this.contactPhone; } }