form_submitted_entity.g.dart 4.7 KB

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