form_submitted_entity.g.dart 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. import 'package:domain/generated/json/base/json_convert_content.dart';
  2. import 'package:domain/entity/form_submitted_entity.dart';
  3. import 'package:domain/entity/form_content_entity.dart';
  4. import 'package:domain/entity/id_name_entity.dart';
  5. FormSubmittedEntity $FormSubmittedEntityFromJson(Map<String, dynamic> json) {
  6. final FormSubmittedEntity formSubmittedEntity = FormSubmittedEntity();
  7. final String? id = jsonConvert.convert<String>(json['id']);
  8. if (id != null) {
  9. formSubmittedEntity.id = id;
  10. }
  11. final String? userId = jsonConvert.convert<String>(json['user_id']);
  12. if (userId != null) {
  13. formSubmittedEntity.userId = userId;
  14. }
  15. final String? estateOnlineFormId = jsonConvert.convert<String>(json['estate_online_form_id']);
  16. if (estateOnlineFormId != null) {
  17. formSubmittedEntity.estateOnlineFormId = estateOnlineFormId;
  18. }
  19. final FormContentEntity? content = jsonConvert.convert<FormContentEntity>(json['content']);
  20. if (content != null) {
  21. formSubmittedEntity.content = content;
  22. }
  23. final String? sentOn = jsonConvert.convert<String>(json['sent_on']);
  24. if (sentOn != null) {
  25. formSubmittedEntity.sentOn = sentOn;
  26. }
  27. final String? rejectedOn = jsonConvert.convert<String>(json['rejected_on']);
  28. if (rejectedOn != null) {
  29. formSubmittedEntity.rejectedOn = rejectedOn;
  30. }
  31. final String? approvedOn = jsonConvert.convert<String>(json['approved_on']);
  32. if (approvedOn != null) {
  33. formSubmittedEntity.approvedOn = approvedOn;
  34. }
  35. final FormSubmittedEstateOnlineForm? estateOnlineForm = jsonConvert.convert<FormSubmittedEstateOnlineForm>(json['estate_online_form']);
  36. if (estateOnlineForm != null) {
  37. formSubmittedEntity.estateOnlineForm = estateOnlineForm;
  38. }
  39. final IdNameEntity? account = jsonConvert.convert<IdNameEntity>(json['account']);
  40. if (account != null) {
  41. formSubmittedEntity.account = account;
  42. }
  43. return formSubmittedEntity;
  44. }
  45. Map<String, dynamic> $FormSubmittedEntityToJson(FormSubmittedEntity entity) {
  46. final Map<String, dynamic> data = <String, dynamic>{};
  47. data['id'] = entity.id;
  48. data['user_id'] = entity.userId;
  49. data['estate_online_form_id'] = entity.estateOnlineFormId;
  50. data['content'] = entity.content?.toJson();
  51. data['sent_on'] = entity.sentOn;
  52. data['rejected_on'] = entity.rejectedOn;
  53. data['approved_on'] = entity.approvedOn;
  54. data['estate_online_form'] = entity.estateOnlineForm?.toJson();
  55. data['account'] = entity.account?.toJson();
  56. return data;
  57. }
  58. extension FormSubmittedEntityExtension on FormSubmittedEntity {
  59. FormSubmittedEntity copyWith({
  60. String? id,
  61. String? userId,
  62. String? estateOnlineFormId,
  63. FormContentEntity? content,
  64. String? sentOn,
  65. String? rejectedOn,
  66. String? approvedOn,
  67. FormSubmittedEstateOnlineForm? estateOnlineForm,
  68. IdNameEntity? account,
  69. }) {
  70. return FormSubmittedEntity()
  71. ..id = id ?? this.id
  72. ..userId = userId ?? this.userId
  73. ..estateOnlineFormId = estateOnlineFormId ?? this.estateOnlineFormId
  74. ..content = content ?? this.content
  75. ..sentOn = sentOn ?? this.sentOn
  76. ..rejectedOn = rejectedOn ?? this.rejectedOn
  77. ..approvedOn = approvedOn ?? this.approvedOn
  78. ..estateOnlineForm = estateOnlineForm ?? this.estateOnlineForm
  79. ..account = account ?? this.account;
  80. }
  81. }
  82. FormSubmittedEstateOnlineForm $FormSubmittedEstateOnlineFormFromJson(Map<String, dynamic> json) {
  83. final FormSubmittedEstateOnlineForm formSubmittedEstateOnlineForm = FormSubmittedEstateOnlineForm();
  84. final String? id = jsonConvert.convert<String>(json['id']);
  85. if (id != null) {
  86. formSubmittedEstateOnlineForm.id = id;
  87. }
  88. final String? icon = jsonConvert.convert<String>(json['icon']);
  89. if (icon != null) {
  90. formSubmittedEstateOnlineForm.icon = icon;
  91. }
  92. final String? name = jsonConvert.convert<String>(json['name']);
  93. if (name != null) {
  94. formSubmittedEstateOnlineForm.name = name;
  95. }
  96. final IdNameEntity? type = jsonConvert.convert<IdNameEntity>(json['type']);
  97. if (type != null) {
  98. formSubmittedEstateOnlineForm.type = type;
  99. }
  100. return formSubmittedEstateOnlineForm;
  101. }
  102. Map<String, dynamic> $FormSubmittedEstateOnlineFormToJson(FormSubmittedEstateOnlineForm entity) {
  103. final Map<String, dynamic> data = <String, dynamic>{};
  104. data['id'] = entity.id;
  105. data['icon'] = entity.icon;
  106. data['name'] = entity.name;
  107. data['type'] = entity.type?.toJson();
  108. return data;
  109. }
  110. extension FormSubmittedEstateOnlineFormExtension on FormSubmittedEstateOnlineForm {
  111. FormSubmittedEstateOnlineForm copyWith({
  112. String? id,
  113. String? icon,
  114. String? name,
  115. IdNameEntity? type,
  116. }) {
  117. return FormSubmittedEstateOnlineForm()
  118. ..id = id ?? this.id
  119. ..icon = icon ?? this.icon
  120. ..name = name ?? this.name
  121. ..type = type ?? this.type;
  122. }
  123. }