facility_page_entity.g.dart 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. import 'package:domain/generated/json/base/json_convert_content.dart';
  2. import 'package:domain/entity/facility_page_entity.dart';
  3. FacilityPageEntity $FacilityPageEntityFromJson(Map<String, dynamic> json) {
  4. final FacilityPageEntity facilityPageEntity = FacilityPageEntity();
  5. final int? count = jsonConvert.convert<int>(json['count']);
  6. if (count != null) {
  7. facilityPageEntity.count = count;
  8. }
  9. final int? page = jsonConvert.convert<int>(json['page']);
  10. if (page != null) {
  11. facilityPageEntity.page = page;
  12. }
  13. final int? limit = jsonConvert.convert<int>(json['limit']);
  14. if (limit != null) {
  15. facilityPageEntity.limit = limit;
  16. }
  17. final int? countPage = jsonConvert.convert<int>(json['count_page']);
  18. if (countPage != null) {
  19. facilityPageEntity.countPage = countPage;
  20. }
  21. final String? totalDeposit = jsonConvert.convert<String>(
  22. json['total_deposit']);
  23. if (totalDeposit != null) {
  24. facilityPageEntity.totalDeposit = totalDeposit;
  25. }
  26. final List<FacilityDetail>? list = (json['list'] as List<dynamic>?)
  27. ?.map(
  28. (e) => jsonConvert.convert<FacilityDetail>(e) as FacilityDetail)
  29. .toList();
  30. if (list != null) {
  31. facilityPageEntity.list = list;
  32. }
  33. return facilityPageEntity;
  34. }
  35. Map<String, dynamic> $FacilityPageEntityToJson(FacilityPageEntity entity) {
  36. final Map<String, dynamic> data = <String, dynamic>{};
  37. data['count'] = entity.count;
  38. data['page'] = entity.page;
  39. data['limit'] = entity.limit;
  40. data['count_page'] = entity.countPage;
  41. data['total_deposit'] = entity.totalDeposit;
  42. data['list'] = entity.list?.map((v) => v.toJson()).toList();
  43. return data;
  44. }
  45. extension FacilityPageEntityExtension on FacilityPageEntity {
  46. FacilityPageEntity copyWith({
  47. int? count,
  48. int? page,
  49. int? limit,
  50. int? countPage,
  51. String? totalDeposit,
  52. List<FacilityDetail>? list,
  53. }) {
  54. return FacilityPageEntity()
  55. ..count = count ?? this.count
  56. ..page = page ?? this.page
  57. ..limit = limit ?? this.limit
  58. ..countPage = countPage ?? this.countPage
  59. ..totalDeposit = totalDeposit ?? this.totalDeposit
  60. ..list = list ?? this.list;
  61. }
  62. }
  63. FacilityDetail $FacilityDetailFromJson(Map<String, dynamic> json) {
  64. final FacilityDetail facilityDetail = FacilityDetail();
  65. final FacilityPageListBooking? booking = jsonConvert.convert<
  66. FacilityPageListBooking>(json['booking']);
  67. if (booking != null) {
  68. facilityDetail.booking = booking;
  69. }
  70. final FacilityPageListFacility? facility = jsonConvert.convert<
  71. FacilityPageListFacility>(json['facility']);
  72. if (facility != null) {
  73. facilityDetail.facility = facility;
  74. }
  75. final FacilityPageListTimePeriod? timePeriod = jsonConvert.convert<
  76. FacilityPageListTimePeriod>(json['time_period']);
  77. if (timePeriod != null) {
  78. facilityDetail.timePeriod = timePeriod;
  79. }
  80. final FacilityPageListAccount? account = jsonConvert.convert<
  81. FacilityPageListAccount>(json['account']);
  82. if (account != null) {
  83. facilityDetail.account = account;
  84. }
  85. return facilityDetail;
  86. }
  87. Map<String, dynamic> $FacilityDetailToJson(FacilityDetail entity) {
  88. final Map<String, dynamic> data = <String, dynamic>{};
  89. data['booking'] = entity.booking?.toJson();
  90. data['facility'] = entity.facility?.toJson();
  91. data['time_period'] = entity.timePeriod?.toJson();
  92. data['account'] = entity.account?.toJson();
  93. return data;
  94. }
  95. extension FacilityDetailExtension on FacilityDetail {
  96. FacilityDetail copyWith({
  97. FacilityPageListBooking? booking,
  98. FacilityPageListFacility? facility,
  99. FacilityPageListTimePeriod? timePeriod,
  100. FacilityPageListAccount? account,
  101. }) {
  102. return FacilityDetail()
  103. ..booking = booking ?? this.booking
  104. ..facility = facility ?? this.facility
  105. ..timePeriod = timePeriod ?? this.timePeriod
  106. ..account = account ?? this.account;
  107. }
  108. }
  109. FacilityPageListBooking $FacilityPageListBookingFromJson(
  110. Map<String, dynamic> json) {
  111. final FacilityPageListBooking facilityPageListBooking = FacilityPageListBooking();
  112. final String? id = jsonConvert.convert<String>(json['id']);
  113. if (id != null) {
  114. facilityPageListBooking.id = id;
  115. }
  116. final String? date = jsonConvert.convert<String>(json['date']);
  117. if (date != null) {
  118. facilityPageListBooking.date = date;
  119. }
  120. final String? start = jsonConvert.convert<String>(json['start']);
  121. if (start != null) {
  122. facilityPageListBooking.start = start;
  123. }
  124. final String? end = jsonConvert.convert<String>(json['end']);
  125. if (end != null) {
  126. facilityPageListBooking.end = end;
  127. }
  128. final String? depositPaid = jsonConvert.convert<String>(json['deposit_paid']);
  129. if (depositPaid != null) {
  130. facilityPageListBooking.depositPaid = depositPaid;
  131. }
  132. final String? depositRefund = jsonConvert.convert<String>(
  133. json['deposit_refund']);
  134. if (depositRefund != null) {
  135. facilityPageListBooking.depositRefund = depositRefund;
  136. }
  137. final String? depositRefundAt = jsonConvert.convert<String>(
  138. json['deposit_refund_at']);
  139. if (depositRefundAt != null) {
  140. facilityPageListBooking.depositRefundAt = depositRefundAt;
  141. }
  142. return facilityPageListBooking;
  143. }
  144. Map<String, dynamic> $FacilityPageListBookingToJson(
  145. FacilityPageListBooking entity) {
  146. final Map<String, dynamic> data = <String, dynamic>{};
  147. data['id'] = entity.id;
  148. data['date'] = entity.date;
  149. data['start'] = entity.start;
  150. data['end'] = entity.end;
  151. data['deposit_paid'] = entity.depositPaid;
  152. data['deposit_refund'] = entity.depositRefund;
  153. data['deposit_refund_at'] = entity.depositRefundAt;
  154. return data;
  155. }
  156. extension FacilityPageListBookingExtension on FacilityPageListBooking {
  157. FacilityPageListBooking copyWith({
  158. String? id,
  159. String? date,
  160. String? start,
  161. String? end,
  162. String? depositPaid,
  163. String? depositRefund,
  164. String? depositRefundAt,
  165. }) {
  166. return FacilityPageListBooking()
  167. ..id = id ?? this.id
  168. ..date = date ?? this.date
  169. ..start = start ?? this.start
  170. ..end = end ?? this.end
  171. ..depositPaid = depositPaid ?? this.depositPaid
  172. ..depositRefund = depositRefund ?? this.depositRefund
  173. ..depositRefundAt = depositRefundAt ?? this.depositRefundAt;
  174. }
  175. }
  176. FacilityPageListFacility $FacilityPageListFacilityFromJson(
  177. Map<String, dynamic> json) {
  178. final FacilityPageListFacility facilityPageListFacility = FacilityPageListFacility();
  179. final String? id = jsonConvert.convert<String>(json['id']);
  180. if (id != null) {
  181. facilityPageListFacility.id = id;
  182. }
  183. final String? name = jsonConvert.convert<String>(json['name']);
  184. if (name != null) {
  185. facilityPageListFacility.name = name;
  186. }
  187. final FacilityPageListFacilityType? type = jsonConvert.convert<
  188. FacilityPageListFacilityType>(json['type']);
  189. if (type != null) {
  190. facilityPageListFacility.type = type;
  191. }
  192. return facilityPageListFacility;
  193. }
  194. Map<String, dynamic> $FacilityPageListFacilityToJson(
  195. FacilityPageListFacility entity) {
  196. final Map<String, dynamic> data = <String, dynamic>{};
  197. data['id'] = entity.id;
  198. data['name'] = entity.name;
  199. data['type'] = entity.type?.toJson();
  200. return data;
  201. }
  202. extension FacilityPageListFacilityExtension on FacilityPageListFacility {
  203. FacilityPageListFacility copyWith({
  204. String? id,
  205. String? name,
  206. FacilityPageListFacilityType? type,
  207. }) {
  208. return FacilityPageListFacility()
  209. ..id = id ?? this.id
  210. ..name = name ?? this.name
  211. ..type = type ?? this.type;
  212. }
  213. }
  214. FacilityPageListFacilityType $FacilityPageListFacilityTypeFromJson(
  215. Map<String, dynamic> json) {
  216. final FacilityPageListFacilityType facilityPageListFacilityType = FacilityPageListFacilityType();
  217. final String? id = jsonConvert.convert<String>(json['id']);
  218. if (id != null) {
  219. facilityPageListFacilityType.id = id;
  220. }
  221. final String? name = jsonConvert.convert<String>(json['name']);
  222. if (name != null) {
  223. facilityPageListFacilityType.name = name;
  224. }
  225. return facilityPageListFacilityType;
  226. }
  227. Map<String, dynamic> $FacilityPageListFacilityTypeToJson(
  228. FacilityPageListFacilityType entity) {
  229. final Map<String, dynamic> data = <String, dynamic>{};
  230. data['id'] = entity.id;
  231. data['name'] = entity.name;
  232. return data;
  233. }
  234. extension FacilityPageListFacilityTypeExtension on FacilityPageListFacilityType {
  235. FacilityPageListFacilityType copyWith({
  236. String? id,
  237. String? name,
  238. }) {
  239. return FacilityPageListFacilityType()
  240. ..id = id ?? this.id
  241. ..name = name ?? this.name;
  242. }
  243. }
  244. FacilityPageListTimePeriod $FacilityPageListTimePeriodFromJson(
  245. Map<String, dynamic> json) {
  246. final FacilityPageListTimePeriod facilityPageListTimePeriod = FacilityPageListTimePeriod();
  247. final String? price = jsonConvert.convert<String>(json['price']);
  248. if (price != null) {
  249. facilityPageListTimePeriod.price = price;
  250. }
  251. final String? deposit = jsonConvert.convert<String>(json['deposit']);
  252. if (deposit != null) {
  253. facilityPageListTimePeriod.deposit = deposit;
  254. }
  255. return facilityPageListTimePeriod;
  256. }
  257. Map<String, dynamic> $FacilityPageListTimePeriodToJson(
  258. FacilityPageListTimePeriod entity) {
  259. final Map<String, dynamic> data = <String, dynamic>{};
  260. data['price'] = entity.price;
  261. data['deposit'] = entity.deposit;
  262. return data;
  263. }
  264. extension FacilityPageListTimePeriodExtension on FacilityPageListTimePeriod {
  265. FacilityPageListTimePeriod copyWith({
  266. String? price,
  267. String? deposit,
  268. }) {
  269. return FacilityPageListTimePeriod()
  270. ..price = price ?? this.price
  271. ..deposit = deposit ?? this.deposit;
  272. }
  273. }
  274. FacilityPageListAccount $FacilityPageListAccountFromJson(
  275. Map<String, dynamic> json) {
  276. final FacilityPageListAccount facilityPageListAccount = FacilityPageListAccount();
  277. final String? id = jsonConvert.convert<String>(json['id']);
  278. if (id != null) {
  279. facilityPageListAccount.id = id;
  280. }
  281. final String? name = jsonConvert.convert<String>(json['name']);
  282. if (name != null) {
  283. facilityPageListAccount.name = name;
  284. }
  285. return facilityPageListAccount;
  286. }
  287. Map<String, dynamic> $FacilityPageListAccountToJson(
  288. FacilityPageListAccount entity) {
  289. final Map<String, dynamic> data = <String, dynamic>{};
  290. data['id'] = entity.id;
  291. data['name'] = entity.name;
  292. return data;
  293. }
  294. extension FacilityPageListAccountExtension on FacilityPageListAccount {
  295. FacilityPageListAccount copyWith({
  296. String? id,
  297. String? name,
  298. }) {
  299. return FacilityPageListAccount()
  300. ..id = id ?? this.id
  301. ..name = name ?? this.name;
  302. }
  303. }