import 'package:domain/generated/json/base/json_convert_content.dart'; import 'package:domain/entity/payment_page_entity.dart'; PaymentPageEntity $PaymentPageEntityFromJson(Map json) { final PaymentPageEntity paymentPageEntity = PaymentPageEntity(); final int? count = jsonConvert.convert(json['count']); if (count != null) { paymentPageEntity.count = count; } final int? page = jsonConvert.convert(json['page']); if (page != null) { paymentPageEntity.page = page; } final int? limit = jsonConvert.convert(json['limit']); if (limit != null) { paymentPageEntity.limit = limit; } final int? countPage = jsonConvert.convert(json['count_page']); if (countPage != null) { paymentPageEntity.countPage = countPage; } final List? list = (json['list'] as List?) ?.map( (e) => jsonConvert.convert(e) as PaymentPageList) .toList(); if (list != null) { paymentPageEntity.list = list; } return paymentPageEntity; } Map $PaymentPageEntityToJson(PaymentPageEntity entity) { final Map data = {}; data['count'] = entity.count; data['page'] = entity.page; data['limit'] = entity.limit; data['count_page'] = entity.countPage; data['list'] = entity.list.map((v) => v.toJson()).toList(); return data; } extension PaymentPageEntityExtension on PaymentPageEntity { PaymentPageEntity copyWith({ int? count, int? page, int? limit, int? countPage, List? list, }) { return PaymentPageEntity() ..count = count ?? this.count ..page = page ?? this.page ..limit = limit ?? this.limit ..countPage = countPage ?? this.countPage ..list = list ?? this.list; } } PaymentPageList $PaymentPageListFromJson(Map json) { final PaymentPageList paymentPageList = PaymentPageList(); final String? id = jsonConvert.convert(json['id']); if (id != null) { paymentPageList.id = id; } final String? type = jsonConvert.convert(json['type']); if (type != null) { paymentPageList.type = type; } final String? startAt = jsonConvert.convert(json['start_at']); if (startAt != null) { paymentPageList.startAt = startAt; } final String? endAt = jsonConvert.convert(json['end_at']); if (endAt != null) { paymentPageList.endAt = endAt; } final String? amount = jsonConvert.convert(json['amount']); if (amount != null) { paymentPageList.amount = amount; } final dynamic paidBy = json['paid_by']; if (paidBy != null) { paymentPageList.paidBy = paidBy; } final String? createdAt = jsonConvert.convert(json['created_at']); if (createdAt != null) { paymentPageList.createdAt = createdAt; } return paymentPageList; } Map $PaymentPageListToJson(PaymentPageList entity) { final Map data = {}; data['id'] = entity.id; data['type'] = entity.type; data['start_at'] = entity.startAt; data['end_at'] = entity.endAt; data['amount'] = entity.amount; data['paid_by'] = entity.paidBy; data['created_at'] = entity.createdAt; return data; } extension PaymentPageListExtension on PaymentPageList { PaymentPageList copyWith({ String? id, String? type, String? startAt, String? endAt, String? amount, dynamic paidBy, String? createdAt, }) { return PaymentPageList() ..id = id ?? this.id ..type = type ?? this.type ..startAt = startAt ?? this.startAt ..endAt = endAt ?? this.endAt ..amount = amount ?? this.amount ..paidBy = paidBy ?? this.paidBy ..createdAt = createdAt ?? this.createdAt; } }