form_detail_entity.g.dart 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import 'package:domain/generated/json/base/json_convert_content.dart';
  2. import 'package:domain/entity/form_detail_entity.dart';
  3. import 'package:domain/entity/form_content_entity.dart';
  4. FormDetailEntity $FormDetailEntityFromJson(Map<String, dynamic> json) {
  5. final FormDetailEntity formDetailEntity = FormDetailEntity();
  6. final String? id = jsonConvert.convert<String>(json['id']);
  7. if (id != null) {
  8. formDetailEntity.id = id;
  9. }
  10. final String? userId = jsonConvert.convert<String>(json['user_id']);
  11. if (userId != null) {
  12. formDetailEntity.userId = userId;
  13. }
  14. final FormContentEntity? content = jsonConvert.convert<FormContentEntity>(
  15. json['content']);
  16. if (content != null) {
  17. formDetailEntity.content = content;
  18. }
  19. final int? status = jsonConvert.convert<int>(json['status']);
  20. if (status != null) {
  21. formDetailEntity.status = status;
  22. }
  23. final String? sentOn = jsonConvert.convert<String>(json['sent_on']);
  24. if (sentOn != null) {
  25. formDetailEntity.sentOn = sentOn;
  26. }
  27. final String? rejectedOn = jsonConvert.convert<String>(json['rejected_on']);
  28. if (rejectedOn != null) {
  29. formDetailEntity.rejectedOn = rejectedOn;
  30. }
  31. final String? approvedOn = jsonConvert.convert<String>(json['approved_on']);
  32. if (approvedOn != null) {
  33. formDetailEntity.approvedOn = approvedOn;
  34. }
  35. return formDetailEntity;
  36. }
  37. Map<String, dynamic> $FormDetailEntityToJson(FormDetailEntity entity) {
  38. final Map<String, dynamic> data = <String, dynamic>{};
  39. data['id'] = entity.id;
  40. data['user_id'] = entity.userId;
  41. data['content'] = entity.content?.toJson();
  42. data['status'] = entity.status;
  43. data['sent_on'] = entity.sentOn;
  44. data['rejected_on'] = entity.rejectedOn;
  45. data['approved_on'] = entity.approvedOn;
  46. return data;
  47. }
  48. extension FormDetailEntityExtension on FormDetailEntity {
  49. FormDetailEntity copyWith({
  50. String? id,
  51. String? userId,
  52. FormContentEntity? content,
  53. int? status,
  54. String? sentOn,
  55. String? rejectedOn,
  56. String? approvedOn,
  57. }) {
  58. return FormDetailEntity()
  59. ..id = id ?? this.id
  60. ..userId = userId ?? this.userId
  61. ..content = content ?? this.content
  62. ..status = status ?? this.status
  63. ..sentOn = sentOn ?? this.sentOn
  64. ..rejectedOn = rejectedOn ?? this.rejectedOn
  65. ..approvedOn = approvedOn ?? this.approvedOn;
  66. }
  67. }