payment_page_entity.g.dart 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. import 'package:domain/generated/json/base/json_convert_content.dart';
  2. import 'package:domain/entity/payment_page_entity.dart';
  3. PaymentPageEntity $PaymentPageEntityFromJson(Map<String, dynamic> json) {
  4. final PaymentPageEntity paymentPageEntity = PaymentPageEntity();
  5. final int? count = jsonConvert.convert<int>(json['count']);
  6. if (count != null) {
  7. paymentPageEntity.count = count;
  8. }
  9. final int? page = jsonConvert.convert<int>(json['page']);
  10. if (page != null) {
  11. paymentPageEntity.page = page;
  12. }
  13. final int? limit = jsonConvert.convert<int>(json['limit']);
  14. if (limit != null) {
  15. paymentPageEntity.limit = limit;
  16. }
  17. final int? countPage = jsonConvert.convert<int>(json['count_page']);
  18. if (countPage != null) {
  19. paymentPageEntity.countPage = countPage;
  20. }
  21. final List<PaymentPageList>? list = (json['list'] as List<dynamic>?)
  22. ?.map(
  23. (e) => jsonConvert.convert<PaymentPageList>(e) as PaymentPageList)
  24. .toList();
  25. if (list != null) {
  26. paymentPageEntity.list = list;
  27. }
  28. return paymentPageEntity;
  29. }
  30. Map<String, dynamic> $PaymentPageEntityToJson(PaymentPageEntity entity) {
  31. final Map<String, dynamic> data = <String, dynamic>{};
  32. data['count'] = entity.count;
  33. data['page'] = entity.page;
  34. data['limit'] = entity.limit;
  35. data['count_page'] = entity.countPage;
  36. data['list'] = entity.list.map((v) => v.toJson()).toList();
  37. return data;
  38. }
  39. extension PaymentPageEntityExtension on PaymentPageEntity {
  40. PaymentPageEntity copyWith({
  41. int? count,
  42. int? page,
  43. int? limit,
  44. int? countPage,
  45. List<PaymentPageList>? list,
  46. }) {
  47. return PaymentPageEntity()
  48. ..count = count ?? this.count
  49. ..page = page ?? this.page
  50. ..limit = limit ?? this.limit
  51. ..countPage = countPage ?? this.countPage
  52. ..list = list ?? this.list;
  53. }
  54. }
  55. PaymentPageList $PaymentPageListFromJson(Map<String, dynamic> json) {
  56. final PaymentPageList paymentPageList = PaymentPageList();
  57. final String? id = jsonConvert.convert<String>(json['id']);
  58. if (id != null) {
  59. paymentPageList.id = id;
  60. }
  61. final String? type = jsonConvert.convert<String>(json['type']);
  62. if (type != null) {
  63. paymentPageList.type = type;
  64. }
  65. final String? startAt = jsonConvert.convert<String>(json['start_at']);
  66. if (startAt != null) {
  67. paymentPageList.startAt = startAt;
  68. }
  69. final String? endAt = jsonConvert.convert<String>(json['end_at']);
  70. if (endAt != null) {
  71. paymentPageList.endAt = endAt;
  72. }
  73. final String? amount = jsonConvert.convert<String>(json['amount']);
  74. if (amount != null) {
  75. paymentPageList.amount = amount;
  76. }
  77. final dynamic paidBy = json['paid_by'];
  78. if (paidBy != null) {
  79. paymentPageList.paidBy = paidBy;
  80. }
  81. final String? createdAt = jsonConvert.convert<String>(json['created_at']);
  82. if (createdAt != null) {
  83. paymentPageList.createdAt = createdAt;
  84. }
  85. return paymentPageList;
  86. }
  87. Map<String, dynamic> $PaymentPageListToJson(PaymentPageList entity) {
  88. final Map<String, dynamic> data = <String, dynamic>{};
  89. data['id'] = entity.id;
  90. data['type'] = entity.type;
  91. data['start_at'] = entity.startAt;
  92. data['end_at'] = entity.endAt;
  93. data['amount'] = entity.amount;
  94. data['paid_by'] = entity.paidBy;
  95. data['created_at'] = entity.createdAt;
  96. return data;
  97. }
  98. extension PaymentPageListExtension on PaymentPageList {
  99. PaymentPageList copyWith({
  100. String? id,
  101. String? type,
  102. String? startAt,
  103. String? endAt,
  104. String? amount,
  105. dynamic paidBy,
  106. String? createdAt,
  107. }) {
  108. return PaymentPageList()
  109. ..id = id ?? this.id
  110. ..type = type ?? this.type
  111. ..startAt = startAt ?? this.startAt
  112. ..endAt = endAt ?? this.endAt
  113. ..amount = amount ?? this.amount
  114. ..paidBy = paidBy ?? this.paidBy
  115. ..createdAt = createdAt ?? this.createdAt;
  116. }
  117. }