facility_page_entity.g.dart 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  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<FacilityPageList>? list = (json['list'] as List<dynamic>?)?.map(
  26. (e) => jsonConvert.convert<FacilityPageList>(e) as FacilityPageList).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<FacilityPageList>? 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. FacilityPageList $FacilityPageListFromJson(Map<String, dynamic> json) {
  61. final FacilityPageList facilityPageList = FacilityPageList();
  62. final FacilityPageListBooking? booking = jsonConvert.convert<FacilityPageListBooking>(json['booking']);
  63. if (booking != null) {
  64. facilityPageList.booking = booking;
  65. }
  66. final FacilityPageListFacility? facility = jsonConvert.convert<FacilityPageListFacility>(json['facility']);
  67. if (facility != null) {
  68. facilityPageList.facility = facility;
  69. }
  70. final FacilityPageListTimePeriod? timePeriod = jsonConvert.convert<FacilityPageListTimePeriod>(json['time_period']);
  71. if (timePeriod != null) {
  72. facilityPageList.timePeriod = timePeriod;
  73. }
  74. final FacilityPageListAccount? account = jsonConvert.convert<FacilityPageListAccount>(json['account']);
  75. if (account != null) {
  76. facilityPageList.account = account;
  77. }
  78. return facilityPageList;
  79. }
  80. Map<String, dynamic> $FacilityPageListToJson(FacilityPageList 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 FacilityPageListExtension on FacilityPageList {
  89. FacilityPageList copyWith({
  90. FacilityPageListBooking? booking,
  91. FacilityPageListFacility? facility,
  92. FacilityPageListTimePeriod? timePeriod,
  93. FacilityPageListAccount? account,
  94. }) {
  95. return FacilityPageList()
  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? date = jsonConvert.convert<String>(json['date']);
  105. if (date != null) {
  106. facilityPageListBooking.date = date;
  107. }
  108. final String? start = jsonConvert.convert<String>(json['start']);
  109. if (start != null) {
  110. facilityPageListBooking.start = start;
  111. }
  112. final String? end = jsonConvert.convert<String>(json['end']);
  113. if (end != null) {
  114. facilityPageListBooking.end = end;
  115. }
  116. final String? depositPaid = jsonConvert.convert<String>(json['deposit_paid']);
  117. if (depositPaid != null) {
  118. facilityPageListBooking.depositPaid = depositPaid;
  119. }
  120. final String? depositRefund = jsonConvert.convert<String>(json['deposit_refund']);
  121. if (depositRefund != null) {
  122. facilityPageListBooking.depositRefund = depositRefund;
  123. }
  124. return facilityPageListBooking;
  125. }
  126. Map<String, dynamic> $FacilityPageListBookingToJson(FacilityPageListBooking entity) {
  127. final Map<String, dynamic> data = <String, dynamic>{};
  128. data['date'] = entity.date;
  129. data['start'] = entity.start;
  130. data['end'] = entity.end;
  131. data['deposit_paid'] = entity.depositPaid;
  132. data['deposit_refund'] = entity.depositRefund;
  133. return data;
  134. }
  135. extension FacilityPageListBookingExtension on FacilityPageListBooking {
  136. FacilityPageListBooking copyWith({
  137. String? date,
  138. String? start,
  139. String? end,
  140. String? depositPaid,
  141. String? depositRefund,
  142. }) {
  143. return FacilityPageListBooking()
  144. ..date = date ?? this.date
  145. ..start = start ?? this.start
  146. ..end = end ?? this.end
  147. ..depositPaid = depositPaid ?? this.depositPaid
  148. ..depositRefund = depositRefund ?? this.depositRefund;
  149. }
  150. }
  151. FacilityPageListFacility $FacilityPageListFacilityFromJson(Map<String, dynamic> json) {
  152. final FacilityPageListFacility facilityPageListFacility = FacilityPageListFacility();
  153. final String? id = jsonConvert.convert<String>(json['id']);
  154. if (id != null) {
  155. facilityPageListFacility.id = id;
  156. }
  157. final String? name = jsonConvert.convert<String>(json['name']);
  158. if (name != null) {
  159. facilityPageListFacility.name = name;
  160. }
  161. final FacilityPageListFacilityType? type = jsonConvert.convert<FacilityPageListFacilityType>(json['type']);
  162. if (type != null) {
  163. facilityPageListFacility.type = type;
  164. }
  165. return facilityPageListFacility;
  166. }
  167. Map<String, dynamic> $FacilityPageListFacilityToJson(FacilityPageListFacility entity) {
  168. final Map<String, dynamic> data = <String, dynamic>{};
  169. data['id'] = entity.id;
  170. data['name'] = entity.name;
  171. data['type'] = entity.type?.toJson();
  172. return data;
  173. }
  174. extension FacilityPageListFacilityExtension on FacilityPageListFacility {
  175. FacilityPageListFacility copyWith({
  176. String? id,
  177. String? name,
  178. FacilityPageListFacilityType? type,
  179. }) {
  180. return FacilityPageListFacility()
  181. ..id = id ?? this.id
  182. ..name = name ?? this.name
  183. ..type = type ?? this.type;
  184. }
  185. }
  186. FacilityPageListFacilityType $FacilityPageListFacilityTypeFromJson(Map<String, dynamic> json) {
  187. final FacilityPageListFacilityType facilityPageListFacilityType = FacilityPageListFacilityType();
  188. final String? id = jsonConvert.convert<String>(json['id']);
  189. if (id != null) {
  190. facilityPageListFacilityType.id = id;
  191. }
  192. final String? name = jsonConvert.convert<String>(json['name']);
  193. if (name != null) {
  194. facilityPageListFacilityType.name = name;
  195. }
  196. return facilityPageListFacilityType;
  197. }
  198. Map<String, dynamic> $FacilityPageListFacilityTypeToJson(FacilityPageListFacilityType entity) {
  199. final Map<String, dynamic> data = <String, dynamic>{};
  200. data['id'] = entity.id;
  201. data['name'] = entity.name;
  202. return data;
  203. }
  204. extension FacilityPageListFacilityTypeExtension on FacilityPageListFacilityType {
  205. FacilityPageListFacilityType copyWith({
  206. String? id,
  207. String? name,
  208. }) {
  209. return FacilityPageListFacilityType()
  210. ..id = id ?? this.id
  211. ..name = name ?? this.name;
  212. }
  213. }
  214. FacilityPageListTimePeriod $FacilityPageListTimePeriodFromJson(Map<String, dynamic> json) {
  215. final FacilityPageListTimePeriod facilityPageListTimePeriod = FacilityPageListTimePeriod();
  216. final String? price = jsonConvert.convert<String>(json['price']);
  217. if (price != null) {
  218. facilityPageListTimePeriod.price = price;
  219. }
  220. final String? deposit = jsonConvert.convert<String>(json['deposit']);
  221. if (deposit != null) {
  222. facilityPageListTimePeriod.deposit = deposit;
  223. }
  224. return facilityPageListTimePeriod;
  225. }
  226. Map<String, dynamic> $FacilityPageListTimePeriodToJson(FacilityPageListTimePeriod entity) {
  227. final Map<String, dynamic> data = <String, dynamic>{};
  228. data['price'] = entity.price;
  229. data['deposit'] = entity.deposit;
  230. return data;
  231. }
  232. extension FacilityPageListTimePeriodExtension on FacilityPageListTimePeriod {
  233. FacilityPageListTimePeriod copyWith({
  234. String? price,
  235. String? deposit,
  236. }) {
  237. return FacilityPageListTimePeriod()
  238. ..price = price ?? this.price
  239. ..deposit = deposit ?? this.deposit;
  240. }
  241. }
  242. FacilityPageListAccount $FacilityPageListAccountFromJson(Map<String, dynamic> json) {
  243. final FacilityPageListAccount facilityPageListAccount = FacilityPageListAccount();
  244. final String? id = jsonConvert.convert<String>(json['id']);
  245. if (id != null) {
  246. facilityPageListAccount.id = id;
  247. }
  248. final String? name = jsonConvert.convert<String>(json['name']);
  249. if (name != null) {
  250. facilityPageListAccount.name = name;
  251. }
  252. return facilityPageListAccount;
  253. }
  254. Map<String, dynamic> $FacilityPageListAccountToJson(FacilityPageListAccount entity) {
  255. final Map<String, dynamic> data = <String, dynamic>{};
  256. data['id'] = entity.id;
  257. data['name'] = entity.name;
  258. return data;
  259. }
  260. extension FacilityPageListAccountExtension on FacilityPageListAccount {
  261. FacilityPageListAccount copyWith({
  262. String? id,
  263. String? name,
  264. }) {
  265. return FacilityPageListAccount()
  266. ..id = id ?? this.id
  267. ..name = name ?? this.name;
  268. }
  269. }