facility_page_entity.g.dart 10 KB

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