import 'package:domain/generated/json/base/json_convert_content.dart'; import 'package:domain/entity/form_detail_entity.dart'; import 'package:domain/entity/form_content_entity.dart'; FormDetailEntity $FormDetailEntityFromJson(Map json) { final FormDetailEntity formDetailEntity = FormDetailEntity(); final String? id = jsonConvert.convert(json['id']); if (id != null) { formDetailEntity.id = id; } final String? userId = jsonConvert.convert(json['user_id']); if (userId != null) { formDetailEntity.userId = userId; } final FormContentEntity? content = jsonConvert.convert(json['content']); if (content != null) { formDetailEntity.content = content; } final int? status = jsonConvert.convert(json['status']); if (status != null) { formDetailEntity.status = status; } final String? sentOn = jsonConvert.convert(json['sent_on']); if (sentOn != null) { formDetailEntity.sentOn = sentOn; } final String? rejectedOn = jsonConvert.convert(json['rejected_on']); if (rejectedOn != null) { formDetailEntity.rejectedOn = rejectedOn; } final String? approvedOn = jsonConvert.convert(json['approved_on']); if (approvedOn != null) { formDetailEntity.approvedOn = approvedOn; } return formDetailEntity; } Map $FormDetailEntityToJson(FormDetailEntity entity) { final Map data = {}; data['id'] = entity.id; data['user_id'] = entity.userId; data['content'] = entity.content?.toJson(); data['status'] = entity.status; data['sent_on'] = entity.sentOn; data['rejected_on'] = entity.rejectedOn; data['approved_on'] = entity.approvedOn; return data; } extension FormDetailEntityExtension on FormDetailEntity { FormDetailEntity copyWith({ String? id, String? userId, FormContentEntity? content, int? status, String? sentOn, String? rejectedOn, String? approvedOn, }) { return FormDetailEntity() ..id = id ?? this.id ..userId = userId ?? this.userId ..content = content ?? this.content ..status = status ?? this.status ..sentOn = sentOn ?? this.sentOn ..rejectedOn = rejectedOn ?? this.rejectedOn ..approvedOn = approvedOn ?? this.approvedOn; } }