123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- 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<String, dynamic> json) {
- final FormSubmittedEntity formSubmittedEntity = FormSubmittedEntity();
- final String? id = jsonConvert.convert<String>(json['id']);
- if (id != null) {
- formSubmittedEntity.id = id;
- }
- final String? userId = jsonConvert.convert<String>(json['user_id']);
- if (userId != null) {
- formSubmittedEntity.userId = userId;
- }
- final String? estateOnlineFormId = jsonConvert.convert<String>(json['estate_online_form_id']);
- if (estateOnlineFormId != null) {
- formSubmittedEntity.estateOnlineFormId = estateOnlineFormId;
- }
- final FormContentEntity? content = jsonConvert.convert<FormContentEntity>(json['content']);
- if (content != null) {
- formSubmittedEntity.content = content;
- }
- final String? sentOn = jsonConvert.convert<String>(json['sent_on']);
- if (sentOn != null) {
- formSubmittedEntity.sentOn = sentOn;
- }
- final String? rejectedOn = jsonConvert.convert<String>(json['rejected_on']);
- if (rejectedOn != null) {
- formSubmittedEntity.rejectedOn = rejectedOn;
- }
- final String? approvedOn = jsonConvert.convert<String>(json['approved_on']);
- if (approvedOn != null) {
- formSubmittedEntity.approvedOn = approvedOn;
- }
- final FormSubmittedEstateOnlineForm? estateOnlineForm = jsonConvert.convert<FormSubmittedEstateOnlineForm>(json['estate_online_form']);
- if (estateOnlineForm != null) {
- formSubmittedEntity.estateOnlineForm = estateOnlineForm;
- }
- final IdNameEntity? account = jsonConvert.convert<IdNameEntity>(json['account']);
- if (account != null) {
- formSubmittedEntity.account = account;
- }
- return formSubmittedEntity;
- }
- Map<String, dynamic> $FormSubmittedEntityToJson(FormSubmittedEntity entity) {
- final Map<String, dynamic> data = <String, dynamic>{};
- 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<String, dynamic> json) {
- final FormSubmittedEstateOnlineForm formSubmittedEstateOnlineForm = FormSubmittedEstateOnlineForm();
- final String? id = jsonConvert.convert<String>(json['id']);
- if (id != null) {
- formSubmittedEstateOnlineForm.id = id;
- }
- final String? icon = jsonConvert.convert<String>(json['icon']);
- if (icon != null) {
- formSubmittedEstateOnlineForm.icon = icon;
- }
- final String? name = jsonConvert.convert<String>(json['name']);
- if (name != null) {
- formSubmittedEstateOnlineForm.name = name;
- }
- final IdNameEntity? type = jsonConvert.convert<IdNameEntity>(json['type']);
- if (type != null) {
- formSubmittedEstateOnlineForm.type = type;
- }
- return formSubmittedEstateOnlineForm;
- }
- Map<String, dynamic> $FormSubmittedEstateOnlineFormToJson(FormSubmittedEstateOnlineForm entity) {
- final Map<String, dynamic> data = <String, dynamic>{};
- 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;
- }
- }
|