import 'package:domain/generated/json/base/json_convert_content.dart'; import 'package:domain/entity/facility_page_entity.dart'; FacilityPageEntity $FacilityPageEntityFromJson(Map json) { final FacilityPageEntity facilityPageEntity = FacilityPageEntity(); final int? count = jsonConvert.convert(json['count']); if (count != null) { facilityPageEntity.count = count; } final int? page = jsonConvert.convert(json['page']); if (page != null) { facilityPageEntity.page = page; } final int? limit = jsonConvert.convert(json['limit']); if (limit != null) { facilityPageEntity.limit = limit; } final int? countPage = jsonConvert.convert(json['count_page']); if (countPage != null) { facilityPageEntity.countPage = countPage; } final String? totalDeposit = jsonConvert.convert( json['total_deposit']); if (totalDeposit != null) { facilityPageEntity.totalDeposit = totalDeposit; } final List? list = (json['list'] as List?) ?.map( (e) => jsonConvert.convert(e) as FacilityDetail) .toList(); if (list != null) { facilityPageEntity.list = list; } return facilityPageEntity; } Map $FacilityPageEntityToJson(FacilityPageEntity entity) { final Map data = {}; data['count'] = entity.count; data['page'] = entity.page; data['limit'] = entity.limit; data['count_page'] = entity.countPage; data['total_deposit'] = entity.totalDeposit; data['list'] = entity.list?.map((v) => v.toJson()).toList(); return data; } extension FacilityPageEntityExtension on FacilityPageEntity { FacilityPageEntity copyWith({ int? count, int? page, int? limit, int? countPage, String? totalDeposit, List? list, }) { return FacilityPageEntity() ..count = count ?? this.count ..page = page ?? this.page ..limit = limit ?? this.limit ..countPage = countPage ?? this.countPage ..totalDeposit = totalDeposit ?? this.totalDeposit ..list = list ?? this.list; } } FacilityDetail $FacilityDetailFromJson(Map json) { final FacilityDetail facilityDetail = FacilityDetail(); final FacilityPageListBooking? booking = jsonConvert.convert< FacilityPageListBooking>(json['booking']); if (booking != null) { facilityDetail.booking = booking; } final FacilityPageListFacility? facility = jsonConvert.convert< FacilityPageListFacility>(json['facility']); if (facility != null) { facilityDetail.facility = facility; } final FacilityPageListTimePeriod? timePeriod = jsonConvert.convert< FacilityPageListTimePeriod>(json['time_period']); if (timePeriod != null) { facilityDetail.timePeriod = timePeriod; } final FacilityPageListAccount? account = jsonConvert.convert< FacilityPageListAccount>(json['account']); if (account != null) { facilityDetail.account = account; } return facilityDetail; } Map $FacilityDetailToJson(FacilityDetail entity) { final Map data = {}; data['booking'] = entity.booking?.toJson(); data['facility'] = entity.facility?.toJson(); data['time_period'] = entity.timePeriod?.toJson(); data['account'] = entity.account?.toJson(); return data; } extension FacilityDetailExtension on FacilityDetail { FacilityDetail copyWith({ FacilityPageListBooking? booking, FacilityPageListFacility? facility, FacilityPageListTimePeriod? timePeriod, FacilityPageListAccount? account, }) { return FacilityDetail() ..booking = booking ?? this.booking ..facility = facility ?? this.facility ..timePeriod = timePeriod ?? this.timePeriod ..account = account ?? this.account; } } FacilityPageListBooking $FacilityPageListBookingFromJson( Map json) { final FacilityPageListBooking facilityPageListBooking = FacilityPageListBooking(); final String? id = jsonConvert.convert(json['id']); if (id != null) { facilityPageListBooking.id = id; } final String? date = jsonConvert.convert(json['date']); if (date != null) { facilityPageListBooking.date = date; } final String? start = jsonConvert.convert(json['start']); if (start != null) { facilityPageListBooking.start = start; } final String? end = jsonConvert.convert(json['end']); if (end != null) { facilityPageListBooking.end = end; } final String? depositPaid = jsonConvert.convert(json['deposit_paid']); if (depositPaid != null) { facilityPageListBooking.depositPaid = depositPaid; } final String? depositRefund = jsonConvert.convert( json['deposit_refund']); if (depositRefund != null) { facilityPageListBooking.depositRefund = depositRefund; } final String? depositRefundAt = jsonConvert.convert( json['deposit_refund_at']); if (depositRefundAt != null) { facilityPageListBooking.depositRefundAt = depositRefundAt; } return facilityPageListBooking; } Map $FacilityPageListBookingToJson( FacilityPageListBooking entity) { final Map data = {}; data['id'] = entity.id; data['date'] = entity.date; data['start'] = entity.start; data['end'] = entity.end; data['deposit_paid'] = entity.depositPaid; data['deposit_refund'] = entity.depositRefund; data['deposit_refund_at'] = entity.depositRefundAt; return data; } extension FacilityPageListBookingExtension on FacilityPageListBooking { FacilityPageListBooking copyWith({ String? id, String? date, String? start, String? end, String? depositPaid, String? depositRefund, String? depositRefundAt, }) { return FacilityPageListBooking() ..id = id ?? this.id ..date = date ?? this.date ..start = start ?? this.start ..end = end ?? this.end ..depositPaid = depositPaid ?? this.depositPaid ..depositRefund = depositRefund ?? this.depositRefund ..depositRefundAt = depositRefundAt ?? this.depositRefundAt; } } FacilityPageListFacility $FacilityPageListFacilityFromJson( Map json) { final FacilityPageListFacility facilityPageListFacility = FacilityPageListFacility(); final String? id = jsonConvert.convert(json['id']); if (id != null) { facilityPageListFacility.id = id; } final String? name = jsonConvert.convert(json['name']); if (name != null) { facilityPageListFacility.name = name; } final FacilityPageListFacilityType? type = jsonConvert.convert< FacilityPageListFacilityType>(json['type']); if (type != null) { facilityPageListFacility.type = type; } return facilityPageListFacility; } Map $FacilityPageListFacilityToJson( FacilityPageListFacility entity) { final Map data = {}; data['id'] = entity.id; data['name'] = entity.name; data['type'] = entity.type?.toJson(); return data; } extension FacilityPageListFacilityExtension on FacilityPageListFacility { FacilityPageListFacility copyWith({ String? id, String? name, FacilityPageListFacilityType? type, }) { return FacilityPageListFacility() ..id = id ?? this.id ..name = name ?? this.name ..type = type ?? this.type; } } FacilityPageListFacilityType $FacilityPageListFacilityTypeFromJson( Map json) { final FacilityPageListFacilityType facilityPageListFacilityType = FacilityPageListFacilityType(); final String? id = jsonConvert.convert(json['id']); if (id != null) { facilityPageListFacilityType.id = id; } final String? name = jsonConvert.convert(json['name']); if (name != null) { facilityPageListFacilityType.name = name; } return facilityPageListFacilityType; } Map $FacilityPageListFacilityTypeToJson( FacilityPageListFacilityType entity) { final Map data = {}; data['id'] = entity.id; data['name'] = entity.name; return data; } extension FacilityPageListFacilityTypeExtension on FacilityPageListFacilityType { FacilityPageListFacilityType copyWith({ String? id, String? name, }) { return FacilityPageListFacilityType() ..id = id ?? this.id ..name = name ?? this.name; } } FacilityPageListTimePeriod $FacilityPageListTimePeriodFromJson( Map json) { final FacilityPageListTimePeriod facilityPageListTimePeriod = FacilityPageListTimePeriod(); final String? price = jsonConvert.convert(json['price']); if (price != null) { facilityPageListTimePeriod.price = price; } final String? deposit = jsonConvert.convert(json['deposit']); if (deposit != null) { facilityPageListTimePeriod.deposit = deposit; } return facilityPageListTimePeriod; } Map $FacilityPageListTimePeriodToJson( FacilityPageListTimePeriod entity) { final Map data = {}; data['price'] = entity.price; data['deposit'] = entity.deposit; return data; } extension FacilityPageListTimePeriodExtension on FacilityPageListTimePeriod { FacilityPageListTimePeriod copyWith({ String? price, String? deposit, }) { return FacilityPageListTimePeriod() ..price = price ?? this.price ..deposit = deposit ?? this.deposit; } } FacilityPageListAccount $FacilityPageListAccountFromJson( Map json) { final FacilityPageListAccount facilityPageListAccount = FacilityPageListAccount(); final String? id = jsonConvert.convert(json['id']); if (id != null) { facilityPageListAccount.id = id; } final String? name = jsonConvert.convert(json['name']); if (name != null) { facilityPageListAccount.name = name; } return facilityPageListAccount; } Map $FacilityPageListAccountToJson( FacilityPageListAccount entity) { final Map data = {}; data['id'] = entity.id; data['name'] = entity.name; return data; } extension FacilityPageListAccountExtension on FacilityPageListAccount { FacilityPageListAccount copyWith({ String? id, String? name, }) { return FacilityPageListAccount() ..id = id ?? this.id ..name = name ?? this.name; } }