facility_book_entity.dart 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. import 'package:domain/generated/json/base/json_field.dart';
  2. import 'package:domain/generated/json/facility_book_entity.g.dart';
  3. import 'dart:convert';
  4. export 'package:domain/generated/json/facility_book_entity.g.dart';
  5. @JsonSerializable()
  6. class FacilityBookEntity {
  7. @JSONField(name: "remain_quota")
  8. int remainQuota = 0;
  9. @JSONField(name: "quota_reset_on")
  10. String? quotaResetOn;
  11. @JSONField(name: "facility_type")
  12. FacilityBookFacilityType? facilityType;
  13. List<FacilityBookFacilities>? facilities = [];
  14. FacilityBookEntity();
  15. factory FacilityBookEntity.fromJson(Map<String, dynamic> json) => $FacilityBookEntityFromJson(json);
  16. Map<String, dynamic> toJson() => $FacilityBookEntityToJson(this);
  17. @override
  18. String toString() {
  19. return jsonEncode(this);
  20. }
  21. }
  22. @JsonSerializable()
  23. class FacilityBookFacilityType {
  24. @JSONField(name: "book_advance_days")
  25. int bookAdvanceDays = 0;
  26. int quota = 0;
  27. @JSONField(name: "quota_reset_type")
  28. String? quotaResetType;
  29. FacilityBookFacilityType();
  30. factory FacilityBookFacilityType.fromJson(Map<String, dynamic> json) => $FacilityBookFacilityTypeFromJson(json);
  31. Map<String, dynamic> toJson() => $FacilityBookFacilityTypeToJson(this);
  32. @override
  33. String toString() {
  34. return jsonEncode(this);
  35. }
  36. }
  37. @JsonSerializable()
  38. class FacilityBookFacilities {
  39. String? id;
  40. String? name;
  41. List<FacilityBookFacilitiesPeriods>? periods = [];
  42. FacilityBookFacilities();
  43. factory FacilityBookFacilities.fromJson(Map<String, dynamic> json) => $FacilityBookFacilitiesFromJson(json);
  44. Map<String, dynamic> toJson() => $FacilityBookFacilitiesToJson(this);
  45. @override
  46. String toString() {
  47. return jsonEncode(this);
  48. }
  49. }
  50. @JsonSerializable()
  51. class FacilityBookFacilitiesPeriods {
  52. String? id;
  53. String? start;
  54. String? end;
  55. String? price;
  56. String? deposit;
  57. bool enable = true;
  58. bool selected = false;
  59. FacilityBookFacilitiesPeriods();
  60. factory FacilityBookFacilitiesPeriods.fromJson(Map<String, dynamic> json) => $FacilityBookFacilitiesPeriodsFromJson(json);
  61. Map<String, dynamic> toJson() => $FacilityBookFacilitiesPeriodsToJson(this);
  62. @override
  63. String toString() {
  64. return jsonEncode(this);
  65. }
  66. }