import 'package:domain/generated/json/base/json_field.dart'; import 'package:domain/generated/json/facility_book_entity.g.dart'; import 'dart:convert'; export 'package:domain/generated/json/facility_book_entity.g.dart'; @JsonSerializable() class FacilityBookEntity { @JSONField(name: "remain_quota") int remainQuota = 0; @JSONField(name: "quota_reset_on") String? quotaResetOn; @JSONField(name: "facility_type") FacilityBookFacilityType? facilityType; List? facilities = []; FacilityBookEntity(); factory FacilityBookEntity.fromJson(Map json) => $FacilityBookEntityFromJson(json); Map toJson() => $FacilityBookEntityToJson(this); @override String toString() { return jsonEncode(this); } } @JsonSerializable() class FacilityBookFacilityType { @JSONField(name: "book_advance_days") int bookAdvanceDays = 0; int quota = 0; @JSONField(name: "quota_reset_type") String? quotaResetType; FacilityBookFacilityType(); factory FacilityBookFacilityType.fromJson(Map json) => $FacilityBookFacilityTypeFromJson(json); Map toJson() => $FacilityBookFacilityTypeToJson(this); @override String toString() { return jsonEncode(this); } } @JsonSerializable() class FacilityBookFacilities { String? id; String? name; List? periods = []; FacilityBookFacilities(); factory FacilityBookFacilities.fromJson(Map json) => $FacilityBookFacilitiesFromJson(json); Map toJson() => $FacilityBookFacilitiesToJson(this); @override String toString() { return jsonEncode(this); } } @JsonSerializable() class FacilityBookFacilitiesPeriods { String? id; String? start; String? end; String? price; String? deposit; bool enable = true; bool selected = false; FacilityBookFacilitiesPeriods(); factory FacilityBookFacilitiesPeriods.fromJson(Map json) => $FacilityBookFacilitiesPeriodsFromJson(json); Map toJson() => $FacilityBookFacilitiesPeriodsToJson(this); @override String toString() { return jsonEncode(this); } }