form_detail_entity.g.dart 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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>(json['content']);
  15. if (content != null) {
  16. formDetailEntity.content = content;
  17. }
  18. final int? status = jsonConvert.convert<int>(json['status']);
  19. if (status != null) {
  20. formDetailEntity.status = status;
  21. }
  22. final String? sentOn = jsonConvert.convert<String>(json['sent_on']);
  23. if (sentOn != null) {
  24. formDetailEntity.sentOn = sentOn;
  25. }
  26. final String? rejectedOn = jsonConvert.convert<String>(json['rejected_on']);
  27. if (rejectedOn != null) {
  28. formDetailEntity.rejectedOn = rejectedOn;
  29. }
  30. final String? approvedOn = jsonConvert.convert<String>(json['approved_on']);
  31. if (approvedOn != null) {
  32. formDetailEntity.approvedOn = approvedOn;
  33. }
  34. return formDetailEntity;
  35. }
  36. Map<String, dynamic> $FormDetailEntityToJson(FormDetailEntity entity) {
  37. final Map<String, dynamic> data = <String, dynamic>{};
  38. data['id'] = entity.id;
  39. data['user_id'] = entity.userId;
  40. data['content'] = entity.content?.toJson();
  41. data['status'] = entity.status;
  42. data['sent_on'] = entity.sentOn;
  43. data['rejected_on'] = entity.rejectedOn;
  44. data['approved_on'] = entity.approvedOn;
  45. return data;
  46. }
  47. extension FormDetailEntityExtension on FormDetailEntity {
  48. FormDetailEntity copyWith({
  49. String? id,
  50. String? userId,
  51. FormContentEntity? content,
  52. int? status,
  53. String? sentOn,
  54. String? rejectedOn,
  55. String? approvedOn,
  56. }) {
  57. return FormDetailEntity()
  58. ..id = id ?? this.id
  59. ..userId = userId ?? this.userId
  60. ..content = content ?? this.content
  61. ..status = status ?? this.status
  62. ..sentOn = sentOn ?? this.sentOn
  63. ..rejectedOn = rejectedOn ?? this.rejectedOn
  64. ..approvedOn = approvedOn ?? this.approvedOn;
  65. }
  66. }