turf-common 1.4.0 → 1.4.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (421) hide show
  1. package/package.json +2 -2
  2. package/build/@enums/socket-io.d.ts +0 -1
  3. package/build/@enums/socket-io.js +0 -17
  4. package/build/@types/socket-io.d.ts +0 -1
  5. package/build/@types/socket-io.js +0 -17
  6. package/build/enums/availability-view.enum.d.ts +0 -4
  7. package/build/enums/availability-view.enum.js +0 -8
  8. package/build/enums/booking-details-status.enum.d.ts +0 -4
  9. package/build/enums/booking-details-status.enum.js +0 -8
  10. package/build/enums/booking-fetch-filter.enum.d.ts +0 -5
  11. package/build/enums/booking-fetch-filter.enum.js +0 -9
  12. package/build/enums/booking-history-operation-type.enum.d.ts +0 -12
  13. package/build/enums/booking-history-operation-type.enum.js +0 -20
  14. package/build/enums/bookings-status.enum.d.ts +0 -5
  15. package/build/enums/bookings-status.enum.js +0 -9
  16. package/build/enums/configuration-description.enum.d.ts +0 -5
  17. package/build/enums/configuration-description.enum.js +0 -9
  18. package/build/enums/configuration-key.enum.d.ts +0 -10
  19. package/build/enums/configuration-key.enum.js +0 -29
  20. package/build/enums/configuration-text.enum.d.ts +0 -5
  21. package/build/enums/configuration-text.enum.js +0 -9
  22. package/build/enums/cron-jobs-name.enum.d.ts +0 -5
  23. package/build/enums/cron-jobs-name.enum.js +0 -9
  24. package/build/enums/cron-jobs-status.enum.d.ts +0 -5
  25. package/build/enums/cron-jobs-status.enum.js +0 -9
  26. package/build/enums/environment.enum.d.ts +0 -5
  27. package/build/enums/environment.enum.js +0 -9
  28. package/build/enums/faqs-status.enum.d.ts +0 -3
  29. package/build/enums/faqs-status.enum.js +0 -7
  30. package/build/enums/modification-discount-policy.enum.d.ts +0 -5
  31. package/build/enums/modification-discount-policy.enum.js +0 -9
  32. package/build/enums/organization-status.enum.d.ts +0 -15
  33. package/build/enums/organization-status.enum.js +0 -31
  34. package/build/enums/organization-type.enum.d.ts +0 -5
  35. package/build/enums/organization-type.enum.js +0 -9
  36. package/build/enums/payment-mode.enum.d.ts +0 -4
  37. package/build/enums/payment-mode.enum.js +0 -8
  38. package/build/enums/pitch-operation.enum.d.ts +0 -5
  39. package/build/enums/pitch-operation.enum.js +0 -9
  40. package/build/enums/pitch-sports.enum.d.ts +0 -7
  41. package/build/enums/pitch-sports.enum.js +0 -11
  42. package/build/enums/pitch-status.enum.d.ts +0 -12
  43. package/build/enums/pitch-status.enum.js +0 -13
  44. package/build/enums/pricing-plan-status.enum.d.ts +0 -4
  45. package/build/enums/pricing-plan-status.enum.js +0 -8
  46. package/build/enums/registration-status-enum.d.ts +0 -12
  47. package/build/enums/registration-status-enum.js +0 -16
  48. package/build/enums/socket-io-booking-operation.enum.d.ts +0 -6
  49. package/build/enums/socket-io-booking-operation.enum.js +0 -10
  50. package/build/enums/subscription-status.enum.d.ts +0 -23
  51. package/build/enums/subscription-status.enum.js +0 -40
  52. package/build/enums/timezone.enum.d.ts +0 -3
  53. package/build/enums/timezone.enum.js +0 -7
  54. package/build/enums/transaction-type.enum.d.ts +0 -7
  55. package/build/enums/transaction-type.enum.js +0 -11
  56. package/build/enums/user-status.enum.d.ts +0 -11
  57. package/build/enums/user-status.enum.js +0 -15
  58. package/build/enums/valid-coupon-type.enum.d.ts +0 -6
  59. package/build/enums/valid-coupon-type.enum.js +0 -10
  60. package/build/enums/valid-type.enum.d.ts +0 -6
  61. package/build/enums/valid-type.enum.js +0 -10
  62. package/build/exceptions/app-badrequest.exception.d.ts +0 -4
  63. package/build/exceptions/app-badrequest.exception.js +0 -28
  64. package/build/interface/api/activate-subscription.interface.d.ts +0 -10
  65. package/build/interface/api/activate-subscription.interface.js +0 -2
  66. package/build/interface/api/booking-availablity-by-pitch.interface.d.ts +0 -39
  67. package/build/interface/api/booking-availablity-by-pitch.interface.js +0 -2
  68. package/build/interface/api/cancellation-charges.interface.d.ts +0 -17
  69. package/build/interface/api/cancellation-charges.interface.js +0 -2
  70. package/build/interface/api/create-bank-details.interface.d.ts +0 -22
  71. package/build/interface/api/create-bank-details.interface.js +0 -2
  72. package/build/interface/api/create-cancellation-policy.interface.d.ts +0 -12
  73. package/build/interface/api/create-cancellation-policy.interface.js +0 -2
  74. package/build/interface/api/create-coupon.interface.d.ts +0 -11
  75. package/build/interface/api/create-coupon.interface.js +0 -2
  76. package/build/interface/api/create-faqs.interface.d.ts +0 -15
  77. package/build/interface/api/create-faqs.interface.js +0 -2
  78. package/build/interface/api/create-organization.interface.d.ts +0 -21
  79. package/build/interface/api/create-organization.interface.js +0 -2
  80. package/build/interface/api/create-pricing-plan.interface.d.ts +0 -16
  81. package/build/interface/api/create-pricing-plan.interface.js +0 -2
  82. package/build/interface/api/create-recurring-slot-booking.interface.d.ts +0 -29
  83. package/build/interface/api/create-recurring-slot-booking.interface.js +0 -2
  84. package/build/interface/api/create-registration-interface.d.ts +0 -13
  85. package/build/interface/api/create-registration-interface.js +0 -2
  86. package/build/interface/api/create-registration-transaction-output.interface.d.ts +0 -2
  87. package/build/interface/api/create-registration-transaction-output.interface.js +0 -2
  88. package/build/interface/api/create-subscription.interface.d.ts +0 -18
  89. package/build/interface/api/create-subscription.interface.js +0 -2
  90. package/build/interface/api/create-turf.interface.d.ts +0 -13
  91. package/build/interface/api/create-turf.interface.js +0 -2
  92. package/build/interface/api/create-user.interface.d.ts +0 -10
  93. package/build/interface/api/create-user.interface.js +0 -2
  94. package/build/interface/api/delete-bank-details-by-id.interface.d.ts +0 -6
  95. package/build/interface/api/delete-bank-details-by-id.interface.js +0 -2
  96. package/build/interface/api/delete-booking-by-codes.interface.d.ts +0 -7
  97. package/build/interface/api/delete-booking-by-codes.interface.js +0 -2
  98. package/build/interface/api/delete-booking-info.interface.d.ts +0 -3
  99. package/build/interface/api/delete-booking-info.interface.js +0 -2
  100. package/build/interface/api/delete-pricing-plan.interface.d.ts +0 -6
  101. package/build/interface/api/delete-pricing-plan.interface.js +0 -2
  102. package/build/interface/api/get-all-booking-of-turf.interface.d.ts +0 -23
  103. package/build/interface/api/get-all-booking-of-turf.interface.js +0 -2
  104. package/build/interface/api/get-availability-by-turf.interface.d.ts +0 -29
  105. package/build/interface/api/get-availability-by-turf.interface.js +0 -2
  106. package/build/interface/api/get-bank-detail-by-id.interface.d.ts +0 -6
  107. package/build/interface/api/get-bank-detail-by-id.interface.js +0 -2
  108. package/build/interface/api/get-bank-detail-entities.interface.d.ts +0 -6
  109. package/build/interface/api/get-bank-detail-entities.interface.js +0 -2
  110. package/build/interface/api/get-booking-by-organization-id.interface.d.ts +0 -30
  111. package/build/interface/api/get-booking-by-organization-id.interface.js +0 -2
  112. package/build/interface/api/get-booking-customers.interface.d.ts +0 -3
  113. package/build/interface/api/get-booking-customers.interface.js +0 -2
  114. package/build/interface/api/get-booking-details-by-id.interface.d.ts +0 -4
  115. package/build/interface/api/get-booking-details-by-id.interface.js +0 -2
  116. package/build/interface/api/get-booking-history.interface.d.ts +0 -4
  117. package/build/interface/api/get-booking-history.interface.js +0 -2
  118. package/build/interface/api/get-booking-info.interface.d.ts +0 -11
  119. package/build/interface/api/get-booking-info.interface.js +0 -2
  120. package/build/interface/api/get-cancellation-policy-entity-by-org-id.interface.d.ts +0 -15
  121. package/build/interface/api/get-cancellation-policy-entity-by-org-id.interface.js +0 -2
  122. package/build/interface/api/get-cancelled-booking.interface.d.ts +0 -7
  123. package/build/interface/api/get-cancelled-booking.interface.js +0 -2
  124. package/build/interface/api/get-collection.interface.d.ts +0 -24
  125. package/build/interface/api/get-collection.interface.js +0 -2
  126. package/build/interface/api/get-configuration.interface.d.ts +0 -4
  127. package/build/interface/api/get-configuration.interface.js +0 -2
  128. package/build/interface/api/get-cron-job-by-date-range-name-status.interface.d.ts +0 -12
  129. package/build/interface/api/get-cron-job-by-date-range-name-status.interface.js +0 -2
  130. package/build/interface/api/get-current-subscription.interface.d.ts +0 -18
  131. package/build/interface/api/get-current-subscription.interface.js +0 -2
  132. package/build/interface/api/get-organization-by-orgid.interface.d.ts +0 -15
  133. package/build/interface/api/get-organization-by-orgid.interface.js +0 -2
  134. package/build/interface/api/get-price-by-organization-response.interface.d.ts +0 -6
  135. package/build/interface/api/get-price-by-organization-response.interface.js +0 -2
  136. package/build/interface/api/get-price-entity.interface.d.ts +0 -10
  137. package/build/interface/api/get-price-entity.interface.js +0 -2
  138. package/build/interface/api/get-price-query.interface.d.ts +0 -10
  139. package/build/interface/api/get-price-query.interface.js +0 -2
  140. package/build/interface/api/get-pricing-plan-by-date-response.interface.d.ts +0 -23
  141. package/build/interface/api/get-pricing-plan-by-date-response.interface.js +0 -2
  142. package/build/interface/api/get-pricing-plan-by-id.interface.d.ts +0 -3
  143. package/build/interface/api/get-pricing-plan-by-id.interface.js +0 -2
  144. package/build/interface/api/get-pricing-plan-entities.interface.d.ts +0 -3
  145. package/build/interface/api/get-pricing-plan-entities.interface.js +0 -2
  146. package/build/interface/api/get-registration-by-id.types.d.ts +0 -20
  147. package/build/interface/api/get-registration-by-id.types.js +0 -2
  148. package/build/interface/api/get-registration-entities.interface.d.ts +0 -30
  149. package/build/interface/api/get-registration-entities.interface.js +0 -2
  150. package/build/interface/api/get-sports.interface.d.ts +0 -4
  151. package/build/interface/api/get-sports.interface.js +0 -2
  152. package/build/interface/api/get-subscription-by-org-id.interface.d.ts +0 -6
  153. package/build/interface/api/get-subscription-by-org-id.interface.js +0 -2
  154. package/build/interface/api/get-subscription-entities.interface.d.ts +0 -8
  155. package/build/interface/api/get-subscription-entities.interface.js +0 -2
  156. package/build/interface/api/get-tournament.interface.d.ts +0 -4
  157. package/build/interface/api/get-tournament.interface.js +0 -2
  158. package/build/interface/api/get-turf-by-organization.interface.d.ts +0 -6
  159. package/build/interface/api/get-turf-by-organization.interface.js +0 -2
  160. package/build/interface/api/get-turf-entity-response.interface.d.ts +0 -10
  161. package/build/interface/api/get-turf-entity-response.interface.js +0 -2
  162. package/build/interface/api/index.d.ts +0 -78
  163. package/build/interface/api/index.js +0 -96
  164. package/build/interface/api/list-of-coupons.interface.d.ts +0 -14
  165. package/build/interface/api/list-of-coupons.interface.js +0 -2
  166. package/build/interface/api/login-response.interface.d.ts +0 -22
  167. package/build/interface/api/login-response.interface.js +0 -2
  168. package/build/interface/api/manual-trigger-cron-job.interface.d.ts +0 -5
  169. package/build/interface/api/manual-trigger-cron-job.interface.js +0 -2
  170. package/build/interface/api/one-slot-booking.interface.d.ts +0 -24
  171. package/build/interface/api/one-slot-booking.interface.js +0 -2
  172. package/build/interface/api/renew-subscription.interface.d.ts +0 -19
  173. package/build/interface/api/renew-subscription.interface.js +0 -2
  174. package/build/interface/api/set-price.interface.d.ts +0 -6
  175. package/build/interface/api/set-price.interface.js +0 -2
  176. package/build/interface/api/setup-registration.interface.d.ts +0 -5
  177. package/build/interface/api/setup-registration.interface.js +0 -2
  178. package/build/interface/api/staff-member-list.interface.d.ts +0 -9
  179. package/build/interface/api/staff-member-list.interface.js +0 -2
  180. package/build/interface/api/update-bank-detail.interface.d.ts +0 -17
  181. package/build/interface/api/update-bank-detail.interface.js +0 -2
  182. package/build/interface/api/update-booking-by-code-response.interface.d.ts +0 -7
  183. package/build/interface/api/update-booking-by-code-response.interface.js +0 -2
  184. package/build/interface/api/update-configuration.interface.d.ts +0 -10
  185. package/build/interface/api/update-configuration.interface.js +0 -2
  186. package/build/interface/api/update-coupon.interface.d.ts +0 -9
  187. package/build/interface/api/update-coupon.interface.js +0 -2
  188. package/build/interface/api/update-faqs-steps.interface.d.ts +0 -11
  189. package/build/interface/api/update-faqs-steps.interface.js +0 -2
  190. package/build/interface/api/update-faqs.interface.d.ts +0 -6
  191. package/build/interface/api/update-faqs.interface.js +0 -2
  192. package/build/interface/api/update-organization.interface.d.ts +0 -21
  193. package/build/interface/api/update-organization.interface.js +0 -2
  194. package/build/interface/api/update-pricing-plan-by-id.interface.d.ts +0 -20
  195. package/build/interface/api/update-pricing-plan-by-id.interface.js +0 -2
  196. package/build/interface/api/update-recurring-booking.interface.d.ts +0 -52
  197. package/build/interface/api/update-recurring-booking.interface.js +0 -2
  198. package/build/interface/api/update-registration-entities.interface.d.ts +0 -8
  199. package/build/interface/api/update-registration-entities.interface.js +0 -2
  200. package/build/interface/api/update-sports-interface.d.ts +0 -3
  201. package/build/interface/api/update-sports-interface.js +0 -2
  202. package/build/interface/api/update-staff-member.interface.d.ts +0 -16
  203. package/build/interface/api/update-staff-member.interface.js +0 -2
  204. package/build/interface/api/update-subscription.interface.d.ts +0 -23
  205. package/build/interface/api/update-subscription.interface.js +0 -2
  206. package/build/interface/api/update-turf-details.interface.d.ts +0 -20
  207. package/build/interface/api/update-turf-details.interface.js +0 -2
  208. package/build/interface/api/update-turf-transaction-output.d.ts +0 -3
  209. package/build/interface/api/update-turf-transaction-output.js +0 -2
  210. package/build/interface/api/upgrade-renew-subscription.interface.d.ts +0 -10
  211. package/build/interface/api/upgrade-renew-subscription.interface.js +0 -2
  212. package/build/interface/api/upgrade-subscription.interface.d.ts +0 -21
  213. package/build/interface/api/upgrade-subscription.interface.js +0 -2
  214. package/build/interface/api/userentity-without-password.interface.d.ts +0 -5
  215. package/build/interface/api/userentity-without-password.interface.js +0 -2
  216. package/build/interface/api/utils.d.ts +0 -18
  217. package/build/interface/api/utils.js +0 -48
  218. package/build/interface/billing-cycle-dto.interface.d.ts +0 -8
  219. package/build/interface/billing-cycle-dto.interface.js +0 -2
  220. package/build/interface/billing-cycle.interface.d.ts +0 -7
  221. package/build/interface/billing-cycle.interface.js +0 -2
  222. package/build/interface/booking-details-with-code.interface.d.ts +0 -34
  223. package/build/interface/booking-details-with-code.interface.js +0 -2
  224. package/build/interface/controller.interface.d.ts +0 -6
  225. package/build/interface/controller.interface.js +0 -2
  226. package/build/interface/convert-to-midnight-time.interface.d.ts +0 -5
  227. package/build/interface/convert-to-midnight-time.interface.js +0 -2
  228. package/build/interface/date-formatter.interface.d.ts +0 -4
  229. package/build/interface/date-formatter.interface.js +0 -2
  230. package/build/interface/dto/delete-booking-by-codes-dto.interface.d.ts +0 -7
  231. package/build/interface/dto/delete-booking-by-codes-dto.interface.js +0 -2
  232. package/build/interface/dto/update-booking-by-code-dto.interface.d.ts +0 -13
  233. package/build/interface/dto/update-booking-by-code-dto.interface.js +0 -2
  234. package/build/interface/entity/bank-details-entity.interface.d.ts +0 -12
  235. package/build/interface/entity/bank-details-entity.interface.js +0 -2
  236. package/build/interface/entity/booking-cancellation-entity.interface.d.ts +0 -32
  237. package/build/interface/entity/booking-cancellation-entity.interface.js +0 -2
  238. package/build/interface/entity/booking-customer-entity.interface.d.ts +0 -8
  239. package/build/interface/entity/booking-customer-entity.interface.js +0 -2
  240. package/build/interface/entity/booking-details-entity.interface.d.ts +0 -29
  241. package/build/interface/entity/booking-details-entity.interface.js +0 -2
  242. package/build/interface/entity/booking-history-entity.interface.d.ts +0 -35
  243. package/build/interface/entity/booking-history-entity.interface.js +0 -2
  244. package/build/interface/entity/booking-payment-history-entity.interface.d.ts +0 -13
  245. package/build/interface/entity/booking-payment-history-entity.interface.js +0 -2
  246. package/build/interface/entity/bookings-entity.interface.d.ts +0 -6
  247. package/build/interface/entity/bookings-entity.interface.js +0 -2
  248. package/build/interface/entity/cancellation-policy-entity.interface.d.ts +0 -8
  249. package/build/interface/entity/cancellation-policy-entity.interface.js +0 -2
  250. package/build/interface/entity/configurations-entity.interface.d.ts +0 -9
  251. package/build/interface/entity/configurations-entity.interface.js +0 -2
  252. package/build/interface/entity/coupon.entity.interface.d.ts +0 -10
  253. package/build/interface/entity/coupon.entity.interface.js +0 -2
  254. package/build/interface/entity/cron-jobs-entity.interface.d.ts +0 -12
  255. package/build/interface/entity/cron-jobs-entity.interface.js +0 -2
  256. package/build/interface/entity/entity-audit-column.interface.d.ts +0 -12
  257. package/build/interface/entity/entity-audit-column.interface.js +0 -9
  258. package/build/interface/entity/faqs-entity.interface.d.ts +0 -10
  259. package/build/interface/entity/faqs-entity.interface.js +0 -2
  260. package/build/interface/entity/index.d.ts +0 -23
  261. package/build/interface/entity/index.js +0 -39
  262. package/build/interface/entity/organization-entity.interface.d.ts +0 -24
  263. package/build/interface/entity/organization-entity.interface.js +0 -2
  264. package/build/interface/entity/pitch-entity.interface.d.ts +0 -9
  265. package/build/interface/entity/pitch-entity.interface.js +0 -2
  266. package/build/interface/entity/price-entity.interface.d.ts +0 -5
  267. package/build/interface/entity/price-entity.interface.js +0 -2
  268. package/build/interface/entity/pricing-plan-entity.interface.d.ts +0 -16
  269. package/build/interface/entity/pricing-plan-entity.interface.js +0 -2
  270. package/build/interface/entity/registration-entity.interface.d.ts +0 -12
  271. package/build/interface/entity/registration-entity.interface.js +0 -2
  272. package/build/interface/entity/sports-entity.interface.d.ts +0 -6
  273. package/build/interface/entity/sports-entity.interface.js +0 -2
  274. package/build/interface/entity/subscription-entity.interface.d.ts +0 -26
  275. package/build/interface/entity/subscription-entity.interface.js +0 -2
  276. package/build/interface/entity/subscription-pitch-mapping.interface.d.ts +0 -8
  277. package/build/interface/entity/subscription-pitch-mapping.interface.js +0 -2
  278. package/build/interface/entity/turf-entity.interface.d.ts +0 -17
  279. package/build/interface/entity/turf-entity.interface.js +0 -2
  280. package/build/interface/entity/user-entity.interface.d.ts +0 -24
  281. package/build/interface/entity/user-entity.interface.js +0 -2
  282. package/build/interface/formate-date-and-time.interface.d.ts +0 -6
  283. package/build/interface/formate-date-and-time.interface.js +0 -2
  284. package/build/interface/get-booking-by-id.interface.d.ts +0 -56
  285. package/build/interface/get-booking-by-id.interface.js +0 -2
  286. package/build/interface/get-booking-codes-per-thirty-min.interface.d.ts +0 -4
  287. package/build/interface/get-booking-codes-per-thirty-min.interface.js +0 -2
  288. package/build/interface/get-pricing-plan-by-date-response.interface.d.ts +0 -23
  289. package/build/interface/get-pricing-plan-by-date-response.interface.js +0 -2
  290. package/build/interface/get-turf-entity.interface.d.ts +0 -34
  291. package/build/interface/get-turf-entity.interface.js +0 -2
  292. package/build/interface/key-value.interface.d.ts +0 -3
  293. package/build/interface/key-value.interface.js +0 -2
  294. package/build/interface/model/booking-details-model.interface.d.ts +0 -5
  295. package/build/interface/model/booking-details-model.interface.js +0 -2
  296. package/build/interface/model/booking-entity-model.interface.d.ts +0 -8
  297. package/build/interface/model/booking-entity-model.interface.js +0 -2
  298. package/build/interface/model/cancellation-policy-model.interface.d.ts +0 -4
  299. package/build/interface/model/cancellation-policy-model.interface.js +0 -2
  300. package/build/interface/model/charge-model.interface.d.ts +0 -13
  301. package/build/interface/model/charge-model.interface.js +0 -2
  302. package/build/interface/model/configuration-model.interface.d.ts +0 -4
  303. package/build/interface/model/configuration-model.interface.js +0 -2
  304. package/build/interface/model/index.d.ts +0 -10
  305. package/build/interface/model/index.js +0 -26
  306. package/build/interface/model/price-model.interface.d.ts +0 -3
  307. package/build/interface/model/price-model.interface.js +0 -2
  308. package/build/interface/model/pricing-plan-entity-model.interface.d.ts +0 -13
  309. package/build/interface/model/pricing-plan-entity-model.interface.js +0 -2
  310. package/build/interface/model/pricing-plan-model.interface.d.ts +0 -15
  311. package/build/interface/model/pricing-plan-model.interface.js +0 -2
  312. package/build/interface/model/turf-model.interface.d.ts +0 -7
  313. package/build/interface/model/turf-model.interface.js +0 -2
  314. package/build/interface/model/user-model.interface.d.ts +0 -3
  315. package/build/interface/model/user-model.interface.js +0 -2
  316. package/build/interface/modify-entity.interface.d.ts +0 -5
  317. package/build/interface/modify-entity.interface.js +0 -2
  318. package/build/interface/modify-turf.interface.d.ts +0 -7
  319. package/build/interface/modify-turf.interface.js +0 -2
  320. package/build/interface/modify.interface.d.ts +0 -1
  321. package/build/interface/modify.interface.js +0 -2
  322. package/build/interface/ng-date-structure.interface.d.ts +0 -5
  323. package/build/interface/ng-date-structure.interface.js +0 -2
  324. package/build/interface/pitch-slab-dto.interface.d.ts +0 -8
  325. package/build/interface/pitch-slab-dto.interface.js +0 -2
  326. package/build/interface/pitch-slab.interface.d.ts +0 -5
  327. package/build/interface/pitch-slab.interface.js +0 -2
  328. package/build/interface/pricing-plan.interface.d.ts +0 -15
  329. package/build/interface/pricing-plan.interface.js +0 -2
  330. package/build/interface/socket-io-bookings.interface.d.ts +0 -12
  331. package/build/interface/socket-io-bookings.interface.js +0 -2
  332. package/build/interface/time-formatter.interface.d.ts +0 -4
  333. package/build/interface/time-formatter.interface.js +0 -2
  334. package/build/interface/ui/booking-data.interface.d.ts +0 -6
  335. package/build/interface/ui/booking-data.interface.js +0 -2
  336. package/build/interface/ui/upgrade-subscription-data.interface.d.ts +0 -15
  337. package/build/interface/ui/upgrade-subscription-data.interface.js +0 -2
  338. package/build/interface/upload-multer-file.interface.d.ts +0 -9
  339. package/build/interface/upload-multer-file.interface.js +0 -2
  340. package/build/interface/user-info-dto.interface.d.ts +0 -16
  341. package/build/interface/user-info-dto.interface.js +0 -2
  342. package/build/interface/without-token-registration-entity.types.d.ts +0 -3
  343. package/build/interface/without-token-registration-entity.types.js +0 -2
  344. package/build/models/billing-cycle-model.d.ts +0 -11
  345. package/build/models/billing-cycle-model.js +0 -27
  346. package/build/models/booking-code-model.d.ts +0 -139
  347. package/build/models/booking-code-model.js +0 -624
  348. package/build/models/charge-model.d.ts +0 -34
  349. package/build/models/charge-model.js +0 -275
  350. package/build/models/entity/booking-details-model.d.ts +0 -41
  351. package/build/models/entity/booking-details-model.js +0 -69
  352. package/build/models/entity/booking-entity-model.d.ts +0 -21
  353. package/build/models/entity/booking-entity-model.js +0 -47
  354. package/build/models/entity/booking-payment-history-model.d.ts +0 -20
  355. package/build/models/entity/booking-payment-history-model.js +0 -36
  356. package/build/models/entity/cancellation-policy-model.d.ts +0 -18
  357. package/build/models/entity/cancellation-policy-model.js +0 -32
  358. package/build/models/entity/configuration-model.d.ts +0 -17
  359. package/build/models/entity/configuration-model.js +0 -17
  360. package/build/models/entity/index.d.ts +0 -10
  361. package/build/models/entity/index.js +0 -26
  362. package/build/models/entity/price-model.d.ts +0 -11
  363. package/build/models/entity/price-model.js +0 -15
  364. package/build/models/entity/pricing-plan-entity-model.d.ts +0 -47
  365. package/build/models/entity/pricing-plan-entity-model.js +0 -128
  366. package/build/models/entity/subscription-model.d.ts +0 -44
  367. package/build/models/entity/subscription-model.js +0 -154
  368. package/build/models/entity/turf-model.d.ts +0 -36
  369. package/build/models/entity/turf-model.js +0 -116
  370. package/build/models/entity/user-model.d.ts +0 -32
  371. package/build/models/entity/user-model.js +0 -19
  372. package/build/models/pitch-slab-model.d.ts +0 -9
  373. package/build/models/pitch-slab-model.js +0 -21
  374. package/build/models/pricing-plan-model.d.ts +0 -27
  375. package/build/models/pricing-plan-model.js +0 -89
  376. package/build/models/subscribed-pricing-plan-model.d.ts +0 -37
  377. package/build/models/subscribed-pricing-plan-model.js +0 -122
  378. package/build/models/time-slot-model.d.ts +0 -19
  379. package/build/models/time-slot-model.js +0 -98
  380. package/build/models/turf-availability-model.d.ts +0 -57
  381. package/build/models/turf-availability-model.js +0 -239
  382. package/build/tests/unit/charges/across-dates/across-dates-booking-TURF-476.spec.d.ts +0 -1
  383. package/build/tests/unit/charges/across-dates/across-dates-booking-TURF-476.spec.js +0 -114
  384. package/build/tests/unit/charges/across-dates/across-dates-booking-without-discount-TURF-476.e2e-spec.d.ts +0 -1
  385. package/build/tests/unit/charges/across-dates/across-dates-booking-without-discount-TURF-476.e2e-spec.js +0 -114
  386. package/build/tests/unit/charges/across-dates/across-dates-discount-TURF-476.spec.d.ts +0 -1
  387. package/build/tests/unit/charges/across-dates/across-dates-discount-TURF-476.spec.js +0 -114
  388. package/build/tests/unit/charges/across-dates/across-dates-extend-remove-TURF-476.spec.d.ts +0 -1
  389. package/build/tests/unit/charges/across-dates/across-dates-extend-remove-TURF-476.spec.js +0 -114
  390. package/build/tests/unit/charges/discount-conditional/basic-amount-half-amount-paid.spec.d.ts +0 -1
  391. package/build/tests/unit/charges/discount-conditional/basic-amount-half-amount-paid.spec.js +0 -221
  392. package/build/tests/unit/charges/discount-conditional/basic-amount-paid-refund-amount-paid-cancellation-not-present.spec.d.ts +0 -1
  393. package/build/tests/unit/charges/discount-conditional/basic-amount-paid-refund-amount-paid-cancellation-not-present.spec.js +0 -518
  394. package/build/tests/unit/charges/discount-conditional/basic-amount-paid-refund-amount-paid.spec.d.ts +0 -1
  395. package/build/tests/unit/charges/discount-conditional/basic-amount-paid-refund-amount-paid.spec.js +0 -470
  396. package/build/tests/unit/charges/discount-conditional/basic-amount-paid.spec.d.ts +0 -1
  397. package/build/tests/unit/charges/discount-conditional/basic-amount-paid.spec.js +0 -263
  398. package/build/tests/unit/charges/discount-conditional/basic.-amount-not-paid.spec.d.ts +0 -1
  399. package/build/tests/unit/charges/discount-conditional/basic.-amount-not-paid.spec.js +0 -223
  400. package/build/tests/unit/charges/discount-conditional/decimal-discount.spec.d.ts +0 -1
  401. package/build/tests/unit/charges/discount-conditional/decimal-discount.spec.js +0 -509
  402. package/build/tests/unit/charges/per-hour-unit/phu-basic-amount-not-paid-TURF-486.spec.d.ts +0 -1
  403. package/build/tests/unit/charges/per-hour-unit/phu-basic-amount-not-paid-TURF-486.spec.js +0 -148
  404. package/build/tests/utils/models/booking-entity-test.d.ts +0 -9
  405. package/build/tests/utils/models/booking-entity-test.js +0 -28
  406. package/build/types/app-badrequest-exception.type.d.ts +0 -4
  407. package/build/types/app-badrequest-exception.type.js +0 -2
  408. package/build/types/booking-modification.type.d.ts +0 -6
  409. package/build/types/booking-modification.type.js +0 -2
  410. package/build/types/bookingdetails-with-booking.type.d.ts +0 -9
  411. package/build/types/bookingdetails-with-booking.type.js +0 -2
  412. package/build/types/date-wise-payment-history-data.types.d.ts +0 -9
  413. package/build/types/date-wise-payment-history-data.types.js +0 -2
  414. package/build/utils/constant.d.ts +0 -5
  415. package/build/utils/constant.js +0 -8
  416. package/build/utils/date-util.d.ts +0 -56
  417. package/build/utils/date-util.js +0 -157
  418. package/build/utils/math-util.d.ts +0 -14
  419. package/build/utils/math-util.js +0 -39
  420. package/build/utils/string-utils.d.ts +0 -31
  421. package/build/utils/string-utils.js +0 -82
@@ -1,624 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.BookingCode = void 0;
15
- var time_slot_model_1 = require("./time-slot-model");
16
- var charge_model_1 = require("./charge-model");
17
- var app_badrequest_exception_1 = require("../exceptions/app-badrequest.exception");
18
- var date_util_1 = require("../utils/date-util");
19
- var date_fns_1 = require("date-fns");
20
- var _utils_1 = require("../@utils");
21
- var BookingCode = /** @class */ (function () {
22
- function BookingCode(code, cost) {
23
- if (cost === void 0) { cost = "-1"; }
24
- // this.id = turfid;
25
- if (code.length === 18)
26
- this.code = code + "00";
27
- else
28
- this.code = code;
29
- this.cost = cost;
30
- this.parse();
31
- }
32
- BookingCode.prototype.parse = function () {
33
- var regexp = /(\d{4})(\d{6})(\d{8})(\d{2})/g;
34
- var matches = regexp.exec(this.code);
35
- if (!matches) {
36
- throw new Error("Booking slot ".concat(this.code, " is invalid"));
37
- }
38
- this.turfId = matches[1];
39
- this.dateCode = matches[2];
40
- this.slot = matches[3];
41
- this.fromTimeCode = matches[3].slice(0, 4);
42
- this.toTimeCode = matches[3].slice(4, 8);
43
- this.pitchCode = matches[4];
44
- this.pitchNumber = Number(matches[4]);
45
- return this;
46
- };
47
- BookingCode.prototype.getBookingTimeInMinutes = function () {
48
- //from HHMM to HHMM
49
- var fromHours = parseInt(this.fromTimeCode.slice(0, 2));
50
- var fromMinutes = parseInt(this.fromTimeCode.slice(2, 4));
51
- var toHours = parseInt(this.toTimeCode.slice(0, 2));
52
- var toMinutes = parseInt(this.toTimeCode.slice(2, 4));
53
- return toHours * 60 + toMinutes - (fromHours * 60 + fromMinutes);
54
- };
55
- BookingCode.prototype.getPitchNo = function () {
56
- return parseInt(this.pitchCode);
57
- };
58
- BookingCode.prototype.getHalfHourTimeCodes = function () {
59
- return new time_slot_model_1.TimeSlot(this.fromTimeCode, this.toTimeCode).getHalfHourTimeCodes();
60
- };
61
- /**
62
- *
63
- * @returns {Array<string>} - List of half hour time slot codes between start time & end time inclusive
64
- * @example fromTime: 0000; toTime: 0130
65
- * // returns ['00000030','00300100','01000130']
66
- */
67
- BookingCode.prototype.getHalfHourTimeRangeCodes = function () {
68
- var halfHourCodes = this.getHalfHourTimeCodes();
69
- var halfHourRangeCodes = [];
70
- for (var index = 0; index < halfHourCodes.length - 1; index++) {
71
- halfHourRangeCodes.push(halfHourCodes[index] + halfHourCodes[index + 1]);
72
- }
73
- return halfHourRangeCodes;
74
- };
75
- BookingCode.prototype.getValidDate = function () {
76
- // Date format: YYMMDD
77
- function getDate(dateString) {
78
- var separators = ["\\.", "\\-", "\\/"];
79
- var stringBits = dateString.split(new RegExp(separators.join("|"), "g"));
80
- var intBits = stringBits.map(function (bit) { return parseInt(bit); });
81
- return new Date(intBits[0], intBits[1] - 1, intBits[2]);
82
- }
83
- return getDate("20".concat(this.dateCode.slice(0, 2), ".").concat(this.dateCode.slice(2, 4), ".").concat(this.dateCode.slice(4, 6)));
84
- };
85
- BookingCode.prototype.getDateCode = function () {
86
- var date = this.getValidDate();
87
- return "".concat(date.getFullYear() % 2000).concat((date.getMonth() + 1)
88
- .toString()
89
- .padStart(2, "0")).concat(date.getDate().toString().padStart(2, "0"));
90
- };
91
- BookingCode.prototype.getWeekday = function () {
92
- var dateObj = new Date(2000 + parseInt(this.dateCode.slice(0, 2)), // Year
93
- parseInt(this.dateCode.toString().slice(2, 4)) - 1, // Month (0-indexed)
94
- parseInt(this.dateCode.toString().slice(4, 6)) // Day
95
- );
96
- return dateObj.getDay() === 0 ? 7 : dateObj.getDay();
97
- // return weekday;
98
- };
99
- BookingCode.prototype.getMonthCode = function () {
100
- return this.dateCode.slice(0, 4);
101
- };
102
- BookingCode.prototype.getDateWithFromTimeCode = function () {
103
- return "".concat(this.dateCode).concat(this.fromTimeCode);
104
- };
105
- BookingCode.prototype.getCodeWithoutTurfCode = function () {
106
- return "".concat(this.dateCode).concat(this.slot).concat(this.pitchCode);
107
- };
108
- BookingCode.sortByCode = function (bookingCodes) {
109
- bookingCodes.sort(function (_a, _b) {
110
- var code1 = _a.code;
111
- var code2 = _b.code;
112
- return code1 < code2 ? -1 : code1 > code2 ? 1 : 0;
113
- });
114
- };
115
- // code: TTTTYYMMDDFHFMTHTMPP;
116
- BookingCode.getOneSlotBookingCode = function (turfId, bookingDate, fhfm, thtm, pitchCode) {
117
- var code = turfId + bookingDate + fhfm + thtm + pitchCode;
118
- return code;
119
- };
120
- BookingCode.getDiscountedCost = function (couponCode, totalCost, validationApply, totalBookingHours) {
121
- if (validationApply === void 0) { validationApply = true; }
122
- var discount = 0;
123
- var discountedCost = 0;
124
- if (couponCode) {
125
- var code = _utils_1.stringUtil.getCouponDetails(couponCode).code;
126
- var value = _utils_1.stringUtil.getCouponDetails(couponCode).value;
127
- if (validationApply && !code && !value) {
128
- throw new app_badrequest_exception_1.AppBadRequestException({
129
- key: "couponCode",
130
- message: ["Coupon with code ".concat(couponCode, " is wrong ")],
131
- });
132
- }
133
- if (code === "P" || code === "PHP") {
134
- var percentDiscount = parseFloat(couponCode);
135
- if (validationApply) {
136
- if (percentDiscount > 90) {
137
- throw new app_badrequest_exception_1.AppBadRequestException({
138
- key: "couponCode",
139
- message: ["Discount should not be more than 90P"],
140
- });
141
- }
142
- }
143
- discount = totalCost * (percentDiscount / 100);
144
- }
145
- else if (code === "U") {
146
- discount = parseFloat(couponCode);
147
- }
148
- else if (code === "PHU") {
149
- if (totalBookingHours === undefined) {
150
- throw new app_badrequest_exception_1.AppBadRequestException({
151
- key: "totalBookingHours",
152
- message: [
153
- "Total Booking Hours is mandatory to calculate per hour unit",
154
- ],
155
- });
156
- }
157
- discount = parseFloat(couponCode) * totalBookingHours;
158
- }
159
- }
160
- discountedCost = totalCost - discount;
161
- return Math.round(discountedCost);
162
- };
163
- BookingCode.getDiscountAmount = function (couponCode, totalCost) {
164
- return charge_model_1.ChargesModel.getDiscountAmount(couponCode, totalCost, true);
165
- };
166
- //-----------------
167
- BookingCode.isValidDate = function (date) {
168
- // Date format: YYMMDD
169
- function isDate(dateString) {
170
- var separators = ["\\.", "\\-", "\\/"];
171
- var stringBits = dateString.split(new RegExp(separators.join("|"), "g"));
172
- var intBits = stringBits.map(function (bit) { return parseInt(bit); });
173
- var parsedDate = new Date(intBits[0], intBits[1] - 1, intBits[2]);
174
- return (parsedDate.getFullYear() === intBits[0] &&
175
- parsedDate.getMonth() + 1 === intBits[1] &&
176
- parsedDate.getDate() === intBits[2]);
177
- }
178
- return isDate("20".concat(date.slice(0, 2), ".").concat(date.slice(2, 4), ".").concat(date.slice(4, 6)));
179
- };
180
- BookingCode.parseDateCode = function (dateCode) {
181
- // Date format: YYMMDD
182
- function getDate(dateString) {
183
- var separators = ["\\.", "\\-", "\\/"];
184
- var stringBits = dateString.split(new RegExp(separators.join("|"), "g"));
185
- var intBits = stringBits.map(function (bit) { return parseInt(bit); });
186
- return new Date(intBits[0], intBits[1] - 1, intBits[2]);
187
- }
188
- return getDate("20".concat(dateCode.slice(0, 2), ".").concat(dateCode.slice(2, 4), ".").concat(dateCode.slice(4, 6)));
189
- };
190
- //------------------
191
- BookingCode.getWeekday = function (dateCode) {
192
- var dateObj = new Date(2000 + parseInt(dateCode.toString().slice(0, 2)), // Year
193
- parseInt(dateCode.toString().slice(2, 4)) - 1, // Month (0-indexed)
194
- parseInt(dateCode.toString().slice(4, 6)) // Day
195
- );
196
- var weekday = dateObj.getDay();
197
- return weekday === 0 ? 7 : weekday;
198
- };
199
- //---------------------
200
- BookingCode.convertToDate = function (str) {
201
- var year = parseInt(20 + str.slice(0, 2));
202
- var month = parseInt(str.slice(2, 4)) - 1;
203
- var day = parseInt(str.slice(4, 6));
204
- var date = new Date(Date.UTC(year, month, day, 0, 0, 0));
205
- return date;
206
- };
207
- //---------------------
208
- BookingCode.previousDateChecker = function (fromDate, index, errorKey) {
209
- var slotDate = this.convertToDate(fromDate.toString());
210
- var currentDateObj = new Date();
211
- var parsedDate = this.dateFormat([slotDate]);
212
- var currentDate = this.dateFormat([currentDateObj]);
213
- if (parsedDate < currentDate) {
214
- throw new app_badrequest_exception_1.AppBadRequestException({
215
- key: errorKey !== null && errorKey !== void 0 ? errorKey : "slot.".concat(index),
216
- message: ["date must be present Date or future Date"],
217
- });
218
- }
219
- else if (parsedDate === currentDate) {
220
- return;
221
- }
222
- };
223
- //---------------------
224
- BookingCode.previousTimeChecker = function (fromTime, fromDate, index) {
225
- var now = new Date();
226
- this.convertToDate(fromDate.toString());
227
- var delayInBooking = 15;
228
- if (this.convertToDate(fromDate.toString()) > now) {
229
- return; //do nothing if fromDate is in future
230
- }
231
- else if (this.convertToDate(fromDate.toString()) <= now) {
232
- now.setMinutes(now.getMinutes() - delayInBooking); // 15minutes buffer for late bookings
233
- var options = {
234
- timeZone: "Asia/Kolkata",
235
- };
236
- var timeFormat = new Intl.DateTimeFormat("en-US", __assign(__assign({}, options), { hour: "2-digit", minute: "2-digit", hour12: false }));
237
- var currentTimeObj = timeFormat.format(now).replace(/:/g, "");
238
- if (fromTime < currentTimeObj) {
239
- throw new app_badrequest_exception_1.AppBadRequestException({
240
- key: "slot.".concat(index),
241
- message: ["Booking time should be in future"],
242
- });
243
- }
244
- }
245
- };
246
- //---------------------
247
- BookingCode.getDateCodesByWeek = function (fromDate, toDate, selectedWeekday) {
248
- return BookingCode.dateFormat(BookingCode.getDatesByWeek(fromDate, toDate, selectedWeekday));
249
- };
250
- BookingCode.getDatesByWeek = function (fromDate, toDate, selectedWeekday) {
251
- if (!BookingCode.isValidDate(fromDate.toString()) ||
252
- !BookingCode.isValidDate(toDate.toString())) {
253
- throw new app_badrequest_exception_1.AppBadRequestException({
254
- key: "Date",
255
- message: ["Invalid Date"],
256
- });
257
- }
258
- if (selectedWeekday < 0 || selectedWeekday > 7) {
259
- throw new app_badrequest_exception_1.AppBadRequestException({
260
- key: "weekday",
261
- message: ["weekday should be between 1-7"],
262
- });
263
- }
264
- var startDate = BookingCode.convertToDate(fromDate.toString());
265
- var endDate = BookingCode.convertToDate(toDate.toString());
266
- var currentDate = startDate;
267
- var dates = [];
268
- while (currentDate <= endDate) {
269
- var weekday = currentDate.getDay();
270
- if (weekday === selectedWeekday % 7) {
271
- dates.push(new Date(currentDate.getTime()));
272
- currentDate.setDate(currentDate.getDate() + 7);
273
- }
274
- else {
275
- currentDate.setDate(currentDate.getDate() + 1);
276
- }
277
- }
278
- return dates;
279
- };
280
- //--------------------
281
- BookingCode.isValidTimeRange = function (timeSlot) {
282
- var timeformat = /^(([01]\d|2[0-3])([0-5]\d|60)|2400|0000)$/;
283
- var isValidTime = timeformat.test(timeSlot) && parseInt(timeSlot, 10) <= 2400;
284
- return isValidTime;
285
- };
286
- //---------------------
287
- BookingCode.dateFormat = function (dates) {
288
- var codes = [];
289
- for (var _i = 0, dates_1 = dates; _i < dates_1.length; _i++) {
290
- var date = dates_1[_i];
291
- var dateYear = date.getFullYear() % 2000;
292
- var dateMonth = date.getMonth() + 1;
293
- var dateDay = date.getDate();
294
- var dateFormat = dateYear.toString() +
295
- dateMonth.toString().padStart(2, "0") +
296
- dateDay.toString().padStart(2, "0");
297
- codes.push(dateFormat);
298
- }
299
- return codes;
300
- };
301
- BookingCode.getDateCode = function (date) {
302
- return "".concat(date.getFullYear() % 2000).concat((date.getMonth() + 1)
303
- .toString()
304
- .padStart(2, "0")).concat(date.getDate().toString().padStart(2, "0"));
305
- };
306
- /**
307
- * Returns list of month codes (YYMM) in the Date range inclusive
308
- * @param {Date} from - Start Date
309
- * @param {Date} to - End Date
310
- * @return {Array<Number>} - The array of month codes (YYMM)
311
- */
312
- BookingCode.getMonthCodesRange = function (from, to) {
313
- from = new Date(from.getTime());
314
- to = new Date(to.getTime());
315
- var monthCodes = [];
316
- while (from < to) {
317
- var fromDateCode = BookingCode.getDateCode(from);
318
- monthCodes.push(parseInt("".concat(fromDateCode.slice(0, 4))));
319
- from.setMonth(from.getMonth() + 1);
320
- }
321
- var toDateCode = BookingCode.getDateCode(to);
322
- if (!monthCodes.includes(parseInt("".concat(toDateCode.slice(0, 4))))) {
323
- monthCodes.push(parseInt("".concat(toDateCode.slice(0, 4))));
324
- }
325
- return monthCodes;
326
- };
327
- BookingCode.getNMonthCodes = function (n) {
328
- var now = new Date();
329
- var future = new Date(now.getTime());
330
- future.setMonth(now.getMonth() + n);
331
- return BookingCode.getMonthCodesRange(now, future);
332
- };
333
- BookingCode.getCodes = function (fromDate, toDate, weekday, turfId, from, to) {
334
- // const {fromDate, toDate, weekday, turfId, from, to} = bookingSlot
335
- var dates = this.getDateCodesByWeek(fromDate, toDate, weekday);
336
- // TTTTYYMMDDFFFFTTTT
337
- var codes = [];
338
- for (var _i = 0, dates_2 = dates; _i < dates_2.length; _i++) {
339
- var date = dates_2[_i];
340
- codes.push("".concat(turfId.toString().padStart(4, "0")).concat(date).concat(from).concat(to));
341
- }
342
- return codes;
343
- };
344
- //To check fromDate and toDate present in weekDays and return dateCode
345
- BookingCode.getNextDayDateCode = function (dateCode) {
346
- var nextDate = BookingCode.parseDateCode(dateCode.toString());
347
- nextDate.setDate(nextDate.getDate() + 1);
348
- return parseInt(BookingCode.getDateCode(nextDate));
349
- };
350
- BookingCode.prototype.getUtcDateWithTime = function (dateCodeWithTime) {
351
- // const dateCodeWithTime = '2305131200';
352
- var year = parseInt(dateCodeWithTime.slice(0, 2)) + 2000;
353
- var month = parseInt(dateCodeWithTime.slice(2, 4)) - 1;
354
- var day = parseInt(dateCodeWithTime.slice(4, 6));
355
- var hours = parseInt(dateCodeWithTime.slice(6, 8));
356
- var minutes = parseInt(dateCodeWithTime.slice(8, 10));
357
- return new Date(Date.UTC(year, month, day, hours, minutes));
358
- };
359
- BookingCode.getUtcDateWithTime = function (dateCodeWithTime) {
360
- // const dateCodeWithTime = '2305131200';
361
- var year = parseInt(dateCodeWithTime.slice(0, 2)) + 2000;
362
- var month = parseInt(dateCodeWithTime.slice(2, 4)) - 1;
363
- var day = parseInt(dateCodeWithTime.slice(4, 6));
364
- var hours = parseInt(dateCodeWithTime.slice(6, 8));
365
- var minutes = parseInt(dateCodeWithTime.slice(8, 10));
366
- return new Date(Date.UTC(year, month, day, hours, minutes));
367
- };
368
- BookingCode.prototype.getNoOfHoursDifference = function () {
369
- var bookingDate = BookingCode.getUtcDateWithTime(this.getDateWithFromTimeCode());
370
- var date = BookingCode.getIndianTimeZoneDate();
371
- var timeDifferenceMs = bookingDate.getTime() - date.getTime();
372
- return timeDifferenceMs / (1000 * 60 * 60);
373
- };
374
- BookingCode.getBookingCodesPerThirtyMinutes = function (from, to, bookingDate) {
375
- var bookingCodePerThirtyMinutes = [];
376
- while (from < to) {
377
- var lastDigit = from.slice(2, 4);
378
- if (lastDigit == "00") {
379
- var code = "".concat(from).concat((Number(from) + 30)
380
- .toString()
381
- .padStart(4, "0"));
382
- bookingCodePerThirtyMinutes.push({
383
- slotCodePerThirtyMinute: code,
384
- bookingDate: bookingDate,
385
- });
386
- from = (Number(from) + 30).toString().padStart(4, "0");
387
- }
388
- else {
389
- var code = "".concat(from).concat((Number(from) + 70)
390
- .toString()
391
- .padStart(4, "0"));
392
- bookingCodePerThirtyMinutes.push({
393
- slotCodePerThirtyMinute: code,
394
- bookingDate: bookingDate,
395
- });
396
- from = (Number(from) + 70).toString().padStart(4, "0");
397
- }
398
- }
399
- return bookingCodePerThirtyMinutes;
400
- };
401
- BookingCode.getCostPerThirtyMinutes = function (bookingCodePerThirtyMinutesPerSlot, pricePerThirtyMinutesData) {
402
- var cost = [];
403
- bookingCodePerThirtyMinutesPerSlot.forEach(function (slot) {
404
- var weekDay = BookingCode.getWeekday(Number(slot.bookingDate));
405
- var month = slot.bookingDate.slice(0, 4);
406
- var monthWeekday = "".concat(month).concat(weekDay);
407
- var price = pricePerThirtyMinutesData[monthWeekday][slot.slotCodePerThirtyMinute];
408
- cost.push(price.toString());
409
- });
410
- return cost.join(",");
411
- };
412
- BookingCode.padBookingCode = function (bookingCodeWithoutTurfCode) {
413
- return bookingCodeWithoutTurfCode.padStart(20, "0");
414
- };
415
- BookingCode.getInstance = function (turfId, bookingCodeWithoutTurfCode) {
416
- return new BookingCode("".concat(turfId.toString().padStart(4, "0")).concat(bookingCodeWithoutTurfCode));
417
- };
418
- BookingCode.prototype.getCost = function () {
419
- return this.cost
420
- .split(",")
421
- .map(function (a) { return parseInt(a); })
422
- .reduce(function (a, b) { return a + b; }, 0);
423
- };
424
- BookingCode.prototype.getTimeslot = function () {
425
- return new time_slot_model_1.TimeSlot(this.fromTimeCode, this.toTimeCode);
426
- };
427
- BookingCode.getIndianTimeZoneDate = function (bookingBufferOffsetHour) {
428
- var now = new Date();
429
- var utcOffsetMinutes = 330; // Indian Standard Time (IST) offset is UTC+05:30
430
- var indianTimeMillis = now.getTime() +
431
- utcOffsetMinutes * 60 * 1000 +
432
- (bookingBufferOffsetHour || 0) * 60 * 60 * 1000;
433
- return new Date(indianTimeMillis);
434
- };
435
- //--------------------------------------------------------------
436
- BookingCode.prototype.getInstanceByPitchNo = function (newPitchNo) {
437
- return new BookingCode("".concat(this.code.slice(0, -2)).concat(newPitchNo.toString().padStart(2, "0")), this.cost);
438
- };
439
- BookingCode.prototype.getDateFromTimeCode = function () {
440
- return parseInt("".concat(this.dateCode).concat(this.fromTimeCode));
441
- };
442
- BookingCode.prototype.getPreviousBookingSlotCode = function () {
443
- var prevousBookingCode = this.getPreviousBookingCode();
444
- return "".concat(prevousBookingCode.dateCode).concat(prevousBookingCode
445
- .getTimeslot()
446
- .getCode());
447
- };
448
- BookingCode.prototype.getPreviousBookingCode = function () {
449
- if (this.fromTimeCode === "0000") {
450
- // Add previous day
451
- var previousDateCode = date_util_1.dateUtilService.addNDaysToDateCode(this.dateCode, -1);
452
- // return `${previousDateCode}23302400`;
453
- return new BookingCode("".concat(this.code.slice(0, 4)).concat(previousDateCode, "23302400").concat(this.code.slice(-2)));
454
- }
455
- else {
456
- var previousTimeSlotCode = this.getPreviousTimeSlotCode();
457
- return new BookingCode("".concat(this.code.slice(0, 4)).concat(this.dateCode).concat(previousTimeSlotCode).concat(this.fromTimeCode).concat(this.code.slice(-2)));
458
- }
459
- };
460
- BookingCode.prototype.getPreviousTimeSlotCode = function (isHour) {
461
- if (isHour === void 0) { isHour = false; }
462
- return this.getOffsetTimeSlotCode(this.fromTimeCode, isHour, false);
463
- };
464
- BookingCode.prototype.getNextBookingSlotCode = function () {
465
- var nextBookingCode = this.getNextBookingCode();
466
- return "".concat(nextBookingCode.dateCode).concat(nextBookingCode
467
- .getTimeslot()
468
- .getCode());
469
- };
470
- BookingCode.prototype.getNextTimeSlotCode = function (isHour) {
471
- if (isHour === void 0) { isHour = false; }
472
- return this.getOffsetTimeSlotCode(this.toTimeCode, isHour, true);
473
- };
474
- BookingCode.prototype.getNextBookingCode = function () {
475
- var toTimeSlotCode = this.toTimeCode;
476
- if (this.toTimeCode === "2400") {
477
- // Add next day
478
- var nextDateCode = date_util_1.dateUtilService.addNDaysToDateCode(this.dateCode, 1);
479
- // return `${nextDateCode}00000030`;
480
- return new BookingCode("".concat(this.code.slice(0, 4)).concat(nextDateCode, "00000030").concat(this.code.slice(-2)));
481
- }
482
- else {
483
- var nextTimeSlotCode = this.getNextTimeSlotCode();
484
- return new BookingCode("".concat(this.code.slice(0, 4)).concat(this.dateCode).concat(toTimeSlotCode).concat(nextTimeSlotCode).concat(this.code.slice(-2)));
485
- }
486
- };
487
- BookingCode.prototype.getOffsetTimeSlotCode = function (timeCode, isHour, isNext) {
488
- if (isHour === void 0) { isHour = false; }
489
- if (isNext === void 0) { isNext = true; }
490
- var minutes = parseInt(timeCode.slice(0, 2)) * 60 +
491
- parseInt(timeCode.slice(2, 4)) +
492
- (isNext ? 1 : -1) * (isHour ? 60 : 30);
493
- return "".concat(Math.floor(minutes / 60)
494
- .toString()
495
- .padStart(2, "0")).concat((minutes % 60).toString().padStart(2, "0"));
496
- };
497
- BookingCode.prototype.isInPast = function () {
498
- var pastBookingCode = "".concat(this.dateCode).concat(this.getTimeslot().getCode());
499
- var currentTime = new Date().getTime();
500
- return (new Date(parseInt("20".concat(pastBookingCode.slice(0, 2))), parseInt(pastBookingCode.slice(2, 4)) - 1, parseInt(pastBookingCode.slice(4, 6)), parseInt(pastBookingCode.slice(6, 8)), parseInt(pastBookingCode.slice(8, 10))).getTime() < currentTime);
501
- };
502
- BookingCode.prototype.formatDateAndTime = function (formateDateAndTime) {
503
- var dateFormat = formateDateAndTime.dateFormat, timeFormat = formateDateAndTime.timeFormat, separator = formateDateAndTime.separator, timeSeparator = formateDateAndTime.timeSeparator;
504
- this.toTimeCode = date_util_1.dateUtilService
505
- .handle2400HourInDateCode("".concat(this.dateCode).concat(this.toTimeCode))
506
- .slice(-4);
507
- var formattedDate = BookingCode.dateFormatter({
508
- dateFormat: dateFormat,
509
- dateCode: this.dateCode,
510
- });
511
- var formattedFromTime = BookingCode.timeFormatter({
512
- timeFormat: timeFormat,
513
- timeCode: this.fromTimeCode,
514
- });
515
- var formattedToTime = BookingCode.timeFormatter({
516
- timeFormat: timeFormat,
517
- timeCode: this.toTimeCode,
518
- });
519
- return "".concat(formattedDate).concat(separator).concat(formattedFromTime).concat(timeSeparator).concat(formattedToTime);
520
- };
521
- BookingCode.timeFormatter = function (timeFormatter) {
522
- var parsedFromTime = (0, date_fns_1.parse)(timeFormatter.timeCode, "HHmm", new Date());
523
- return (0, date_fns_1.format)(parsedFromTime, timeFormatter.timeFormat);
524
- };
525
- BookingCode.dateFormatter = function (dateFormatter) {
526
- var dateFormat = dateFormatter.dateFormat, dateCode = dateFormatter.dateCode;
527
- return (0, date_fns_1.format)(BookingCode.convertToDate(dateCode), dateFormat);
528
- };
529
- /**
530
- * Calculates the total time difference between two date codes.
531
- * @param unit - Optional. Specifies the unit of time for the result. Valid values are "minute" or "hr". Defaults to "minute" if not provided.
532
- * @returns The total time difference in the specified unit (minutes or hours) between the "from" and "to" date codes.
533
- */
534
- BookingCode.prototype.getTotalTime = function (unit) {
535
- if (unit === void 0) { unit = "minute"; }
536
- return date_util_1.dateUtilService.calculateDateDifference(this.getAcrossDateCodes().fromDateCode, this.getAcrossDateCodes().toDateCode, unit);
537
- };
538
- /**
539
- * Gets the date codes across a time range.
540
- *
541
- * @returns An object containing the date codes for the from and to time.
542
- * @description
543
- * The `fromDateCode` is generated by combining the current instance's `dateCode` and `fromTimeCode`.
544
- * The `toDateCode` is generated based on the `fromTimeCode` and `toTimeCode`. If `fromTimeCode` is greater
545
- * than `toTimeCode`, it adds one day to the current instance's `dateCode`.
546
- */
547
- BookingCode.prototype.getAcrossDateCodes = function () {
548
- var fromDateCode = "".concat(this.dateCode).concat(this.fromTimeCode);
549
- var toDateCode = "".concat(this.fromTimeCode > this.toTimeCode
550
- ? date_util_1.dateUtilService.addNDaysToDateCode(this.dateCode, 1)
551
- : this.dateCode).concat(this.toTimeCode);
552
- return { fromDateCode: fromDateCode, toDateCode: toDateCode };
553
- };
554
- BookingCode.getTotalTimeByBookingCodes = function (bookingCodes) {
555
- var totalBookingHours = 0;
556
- bookingCodes.forEach(function (bookingCode) {
557
- totalBookingHours += new BookingCode(bookingCode.code).getTotalTime("hr");
558
- });
559
- return totalBookingHours;
560
- };
561
- /**
562
- * Retrieves booking codes for a booking scenario that may span across different days.
563
- * If the booking spans multiple days, two codes are generated for each day; otherwise, a single code is used.
564
- *
565
- * @returns {string[]} An array containing the booking codes.
566
- */
567
- BookingCode.prototype.getBookingCodesByAcrossDateBookingCode = function () {
568
- var bookingCodes = [];
569
- // Check if the booking spans across different days
570
- if (this.fromTimeCode > this.toTimeCode) {
571
- var firstDayCode = "".concat(this.turfId).concat(this.dateCode).concat(this.fromTimeCode, "2400").concat(this.pitchCode);
572
- var secondDayCode = "".concat(this.turfId).concat(date_util_1.dateUtilService.addNDaysToDateCode(this.dateCode, 1), "0000").concat(this.toTimeCode).concat(this.pitchCode);
573
- bookingCodes.push(firstDayCode);
574
- bookingCodes.push(secondDayCode);
575
- }
576
- else {
577
- bookingCodes.push(this.code);
578
- }
579
- return bookingCodes;
580
- };
581
- /**
582
- * Converts booking codes obtained using `getBookingCodesByAcrossDateBookingCode` into an array of BookingCode models.
583
- *
584
- * @returns {BookingCode[]} An array containing BookingCode models.
585
- */
586
- BookingCode.prototype.getBookingCodeModelsByAcrossDateBookingCode = function () {
587
- var bookingCodes = this.getBookingCodesByAcrossDateBookingCode();
588
- var bookingCodeModels = [];
589
- bookingCodes.forEach(function (code) {
590
- bookingCodeModels.push(new BookingCode(code));
591
- });
592
- return bookingCodeModels;
593
- };
594
- /**
595
- * @param {BookingCode} nextBookingCode - The booking code to check for adjacency.
596
- * @returns {boolean} True if the codes are adjacent, false otherwise.
597
- *
598
- * @description
599
- * Two booking codes are considered adjacent if the current booking code ends at the end of the day (`2400`)
600
- * and the next booking code starts at the beginning of the day (`0000`) on the following day.
601
- * Additionally, the pitch number and turf ID must match between the two codes.
602
- */
603
- BookingCode.prototype.isAdjacentBookingCode = function (nextBookingCode) {
604
- return (this.toTimeCode === _utils_1.END_OF_DAY_TIME_CODE &&
605
- nextBookingCode.fromTimeCode === _utils_1.START_OF_DAY_TIME_CODE &&
606
- date_util_1.dateUtilService.addNDaysToDateCode(this.dateCode, 1) ===
607
- nextBookingCode.dateCode &&
608
- this.pitchNumber === nextBookingCode.pitchNumber &&
609
- this.turfId === nextBookingCode.turfId);
610
- };
611
- /**
612
- * Extracts the numeric part of a bookingCode, excluding a predefined deleted slot separator.
613
- *
614
- * @param {string} bookingCode - The input bookingCode to extract from.
615
- * @returns {string} The numeric part of the bookingCode.
616
- */
617
- BookingCode.extractBookingCodeByDeletedSlotSeparator = function (bookingCode) {
618
- return bookingCode.startsWith(_utils_1.DELETED_SLOT_SEPARATOR)
619
- ? bookingCode.slice(_utils_1.DELETED_SLOT_SEPARATOR.length)
620
- : bookingCode;
621
- };
622
- return BookingCode;
623
- }());
624
- exports.BookingCode = BookingCode;
@@ -1,34 +0,0 @@
1
- import { IBookingModification } from "../types/booking-modification.type";
2
- import { ModificationDiscountPolicy } from "../enums/modification-discount-policy.enum";
3
- import { IChargeModel } from "../interface/model/charge-model.interface";
4
- export declare class ChargesModel implements IChargeModel {
5
- initialBookingGrossAmount: number;
6
- additionalBookingGrossAmount: number;
7
- cancelledBookingGrossAmount: number;
8
- totalCancellationCharges: number;
9
- refundPayable: number;
10
- netTotal: number;
11
- amountPaid: number;
12
- amountPayable: number;
13
- totalRefundedAmount: number;
14
- totalBookingHours: number;
15
- couponCode: string;
16
- discountPolicy: ModificationDiscountPolicy;
17
- constructor(initialGrossAmount: number, paidAmount: number, couponCode: string, totalBookingHours: number, discountPolicy: ModificationDiscountPolicy);
18
- getGrossAmount(): number;
19
- getNetAmount(): number;
20
- getDiscountAmount(): number;
21
- getPayableRefundAmount(): number;
22
- static getDiscountAmount(couponCode: string, totalCost: number, validationApply?: boolean, totalBookingHours?: number): number;
23
- setValues(values?: Partial<ChargesModel>): ChargesModel;
24
- modify(bookingModification: IBookingModification): ChargesModel | null;
25
- private modifyExtend;
26
- private modifyReduce;
27
- private modifyMove;
28
- clone(): ChargesModel;
29
- private modifyDelete;
30
- static getInstance(chargeData: IChargeModel, discountPolicy?: ModificationDiscountPolicy): ChargesModel;
31
- getTotalAmount(): number;
32
- getPaymentStatus(): "Refund" | "Paid" | "Pending";
33
- getTotalNetAmount(): number;
34
- }