import 'package:domain/generated/json/base/json_convert_content.dart'; import 'package:domain/entity/form_submitted_entity.dart'; import 'package:domain/entity/form_content_entity.dart'; import 'package:domain/entity/id_name_entity.dart'; FormSubmittedEntity $FormSubmittedEntityFromJson(Map json) { final FormSubmittedEntity formSubmittedEntity = FormSubmittedEntity(); final String? id = jsonConvert.convert(json['id']); if (id != null) { formSubmittedEntity.id = id; } final String? userId = jsonConvert.convert(json['user_id']); if (userId != null) { formSubmittedEntity.userId = userId; } final String? estateOnlineFormId = jsonConvert.convert(json['estate_online_form_id']); if (estateOnlineFormId != null) { formSubmittedEntity.estateOnlineFormId = estateOnlineFormId; } final FormContentEntity? content = jsonConvert.convert(json['content']); if (content != null) { formSubmittedEntity.content = content; } final String? sentOn = jsonConvert.convert(json['sent_on']); if (sentOn != null) { formSubmittedEntity.sentOn = sentOn; } final String? rejectedOn = jsonConvert.convert(json['rejected_on']); if (rejectedOn != null) { formSubmittedEntity.rejectedOn = rejectedOn; } final String? approvedOn = jsonConvert.convert(json['approved_on']); if (approvedOn != null) { formSubmittedEntity.approvedOn = approvedOn; } final FormSubmittedEstateOnlineForm? estateOnlineForm = jsonConvert.convert(json['estate_online_form']); if (estateOnlineForm != null) { formSubmittedEntity.estateOnlineForm = estateOnlineForm; } final IdNameEntity? account = jsonConvert.convert(json['account']); if (account != null) { formSubmittedEntity.account = account; } return formSubmittedEntity; } Map $FormSubmittedEntityToJson(FormSubmittedEntity entity) { final Map data = {}; data['id'] = entity.id; data['user_id'] = entity.userId; data['estate_online_form_id'] = entity.estateOnlineFormId; data['content'] = entity.content?.toJson(); data['sent_on'] = entity.sentOn; data['rejected_on'] = entity.rejectedOn; data['approved_on'] = entity.approvedOn; data['estate_online_form'] = entity.estateOnlineForm?.toJson(); data['account'] = entity.account?.toJson(); return data; } extension FormSubmittedEntityExtension on FormSubmittedEntity { FormSubmittedEntity copyWith({ String? id, String? userId, String? estateOnlineFormId, FormContentEntity? content, String? sentOn, String? rejectedOn, String? approvedOn, FormSubmittedEstateOnlineForm? estateOnlineForm, IdNameEntity? account, }) { return FormSubmittedEntity() ..id = id ?? this.id ..userId = userId ?? this.userId ..estateOnlineFormId = estateOnlineFormId ?? this.estateOnlineFormId ..content = content ?? this.content ..sentOn = sentOn ?? this.sentOn ..rejectedOn = rejectedOn ?? this.rejectedOn ..approvedOn = approvedOn ?? this.approvedOn ..estateOnlineForm = estateOnlineForm ?? this.estateOnlineForm ..account = account ?? this.account; } } FormSubmittedEstateOnlineForm $FormSubmittedEstateOnlineFormFromJson(Map json) { final FormSubmittedEstateOnlineForm formSubmittedEstateOnlineForm = FormSubmittedEstateOnlineForm(); final String? id = jsonConvert.convert(json['id']); if (id != null) { formSubmittedEstateOnlineForm.id = id; } final String? icon = jsonConvert.convert(json['icon']); if (icon != null) { formSubmittedEstateOnlineForm.icon = icon; } final String? name = jsonConvert.convert(json['name']); if (name != null) { formSubmittedEstateOnlineForm.name = name; } final IdNameEntity? type = jsonConvert.convert(json['type']); if (type != null) { formSubmittedEstateOnlineForm.type = type; } return formSubmittedEstateOnlineForm; } Map $FormSubmittedEstateOnlineFormToJson(FormSubmittedEstateOnlineForm entity) { final Map data = {}; data['id'] = entity.id; data['icon'] = entity.icon; data['name'] = entity.name; data['type'] = entity.type?.toJson(); return data; } extension FormSubmittedEstateOnlineFormExtension on FormSubmittedEstateOnlineForm { FormSubmittedEstateOnlineForm copyWith({ String? id, String? icon, String? name, IdNameEntity? type, }) { return FormSubmittedEstateOnlineForm() ..id = id ?? this.id ..icon = icon ?? this.icon ..name = name ?? this.name ..type = type ?? this.type; } }