@myclub_se/data-access 2.15.2 → 3.0.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 (771) hide show
  1. package/{esm2020 → esm2022}/index.mjs +2 -1
  2. package/{esm2020 → esm2022}/lib/api-models/api-booking-calendar-application-time.mjs +1 -1
  3. package/{esm2020 → esm2022}/lib/api-models/api-booking-calendar-slot-session.mjs +1 -1
  4. package/{esm2020 → esm2022}/lib/api-models/api-booking-calendar.mjs +1 -1
  5. package/esm2022/lib/api-models/api-feature-flags.mjs +2 -0
  6. package/esm2022/lib/api-models/api-invoice/api-payment-attempt-create.mjs +11 -0
  7. package/esm2022/lib/api-models/index.mjs +57 -0
  8. package/esm2022/lib/authentication/authentication.interceptor.mjs +101 -0
  9. package/esm2022/lib/authentication/authentication.service.mjs +109 -0
  10. package/esm2022/lib/authentication/guards/authenticated.guard.mjs +38 -0
  11. package/esm2022/lib/authentication/guards/handle-grant-token.guard.mjs +31 -0
  12. package/esm2022/lib/data-access.module.mjs +39 -0
  13. package/esm2022/lib/maintenance/maintenance.interceptor.mjs +30 -0
  14. package/esm2022/lib/models/activity-extra-member.mjs +19 -0
  15. package/esm2022/lib/models/activity-invite.mjs +35 -0
  16. package/esm2022/lib/models/activity-location-group.mjs +27 -0
  17. package/esm2022/lib/models/activity-location-part.mjs +16 -0
  18. package/esm2022/lib/models/activity-location-tag.mjs +22 -0
  19. package/esm2022/lib/models/activity-location.mjs +46 -0
  20. package/esm2022/lib/models/activity-participant.mjs +19 -0
  21. package/esm2022/lib/models/activity-settings.mjs +27 -0
  22. package/esm2022/lib/models/activity-type.mjs +34 -0
  23. package/esm2022/lib/models/activity.mjs +137 -0
  24. package/esm2022/lib/models/auth/auth-member.mjs +13 -0
  25. package/{esm2020 → esm2022}/lib/models/auth/auth-section.mjs +3 -1
  26. package/{esm2020 → esm2022}/lib/models/auth/auth-team-section.mjs +3 -1
  27. package/esm2022/lib/models/auth/auth-team.mjs +13 -0
  28. package/esm2022/lib/models/auth/auth.mjs +25 -0
  29. package/{esm2020 → esm2022}/lib/models/authentication.mjs +3 -1
  30. package/esm2022/lib/models/bookable-group.mjs +27 -0
  31. package/esm2022/lib/models/bookable-item.mjs +49 -0
  32. package/esm2022/lib/models/bookable-part.mjs +16 -0
  33. package/esm2022/lib/models/bookable-tag.mjs +22 -0
  34. package/esm2022/lib/models/booking-calendar-application-time.mjs +86 -0
  35. package/esm2022/lib/models/booking-calendar-slot-session.mjs +87 -0
  36. package/esm2022/lib/models/booking-calendar-slot.mjs +79 -0
  37. package/esm2022/lib/models/booking-calendar.mjs +74 -0
  38. package/esm2022/lib/models/booking-settings.mjs +29 -0
  39. package/esm2022/lib/models/booking-slot-filter.mjs +72 -0
  40. package/esm2022/lib/models/calendar-event.mjs +35 -0
  41. package/esm2022/lib/models/calendar.mjs +15 -0
  42. package/esm2022/lib/models/card/card-deal.mjs +15 -0
  43. package/esm2022/lib/models/card/card-logo-urls.mjs +21 -0
  44. package/esm2022/lib/models/card/card-logo.mjs +11 -0
  45. package/esm2022/lib/models/card/card-member-ticket.mjs +17 -0
  46. package/esm2022/lib/models/card/card-theme.mjs +15 -0
  47. package/esm2022/lib/models/card/card-ticket-location.mjs +13 -0
  48. package/esm2022/lib/models/card/card-ticket.mjs +37 -0
  49. package/{esm2020 → esm2022}/lib/models/card/card.mjs +9 -1
  50. package/esm2022/lib/models/card/home-team.mjs +11 -0
  51. package/esm2022/lib/models/card/member-card.mjs +23 -0
  52. package/esm2022/lib/models/card/search-member-card.mjs +13 -0
  53. package/esm2022/lib/models/club-image.mjs +31 -0
  54. package/{esm2020 → esm2022}/lib/models/club-section.mjs +3 -1
  55. package/{esm2020 → esm2022}/lib/models/club.mjs +3 -1
  56. package/esm2022/lib/models/collection.mjs +19 -0
  57. package/esm2022/lib/models/contact.mjs +61 -0
  58. package/esm2022/lib/models/directory.mjs +38 -0
  59. package/esm2022/lib/models/email.mjs +11 -0
  60. package/esm2022/lib/models/event.mjs +47 -0
  61. package/{esm2020 → esm2022}/lib/models/external-link.mjs +3 -1
  62. package/esm2022/lib/models/feature-flags.mjs +14 -0
  63. package/esm2022/lib/models/file-object.mjs +23 -0
  64. package/esm2022/lib/models/general-image.mjs +11 -0
  65. package/esm2022/lib/models/group-role.mjs +17 -0
  66. package/esm2022/lib/models/image-urls.mjs +15 -0
  67. package/esm2022/lib/models/index.mjs +64 -0
  68. package/esm2022/lib/models/invoice/member-fee.mjs +13 -0
  69. package/esm2022/lib/models/invoice/member-invoice-row.mjs +31 -0
  70. package/esm2022/lib/models/invoice/member-invoice.mjs +45 -0
  71. package/esm2022/lib/models/invoice/payment-attempt.mjs +21 -0
  72. package/esm2022/lib/models/invoice/payment-types/credit-card.mjs +27 -0
  73. package/esm2022/lib/models/invoice/payment-types/giro.mjs +17 -0
  74. package/esm2022/lib/models/invoice/payment-types/swish.mjs +31 -0
  75. package/esm2022/lib/models/invoice/payment-types/zimpler.mjs +19 -0
  76. package/esm2022/lib/models/invoice/search-member-invoice.mjs +26 -0
  77. package/{esm2020 → esm2022}/lib/models/invoice/swish-qr-code.mjs +2 -1
  78. package/esm2022/lib/models/invoice/unpaid-member-invoice.mjs +13 -0
  79. package/esm2022/lib/models/member/member-attribute.mjs +44 -0
  80. package/esm2022/lib/models/member/member-contact.mjs +26 -0
  81. package/esm2022/lib/models/member/member-function.mjs +24 -0
  82. package/esm2022/lib/models/member/member-validation-settings.mjs +21 -0
  83. package/esm2022/lib/models/member/member.mjs +101 -0
  84. package/{esm2020 → esm2022}/lib/models/member/other-member-field.mjs +4 -1
  85. package/esm2022/lib/models/member/other-member.mjs +21 -0
  86. package/esm2022/lib/models/member/search-member.mjs +35 -0
  87. package/esm2022/lib/models/member-activity-invite.mjs +42 -0
  88. package/esm2022/lib/models/member-public-form-field-option.mjs +13 -0
  89. package/esm2022/lib/models/member-public-form-field.mjs +27 -0
  90. package/esm2022/lib/models/member-public-form.mjs +55 -0
  91. package/esm2022/lib/models/member-team-through.mjs +23 -0
  92. package/esm2022/lib/models/member-team.mjs +21 -0
  93. package/esm2022/lib/models/member-type.mjs +11 -0
  94. package/esm2022/lib/models/news.mjs +66 -0
  95. package/esm2022/lib/models/open-activity.mjs +117 -0
  96. package/esm2022/lib/models/optional-fee.mjs +16 -0
  97. package/esm2022/lib/models/overbooked-bookable-item.mjs +15 -0
  98. package/esm2022/lib/models/overbooked-location.mjs +15 -0
  99. package/esm2022/lib/models/partner.mjs +13 -0
  100. package/esm2022/lib/models/public-authentication.mjs +9 -0
  101. package/esm2022/lib/models/registration-qr-code.mjs +19 -0
  102. package/esm2022/lib/models/search-club.mjs +23 -0
  103. package/esm2022/lib/models/search-team.mjs +24 -0
  104. package/{esm2020 → esm2022}/lib/models/section.mjs +3 -1
  105. package/esm2022/lib/models/token.mjs +11 -0
  106. package/esm2022/lib/models/user-notification.mjs +21 -0
  107. package/esm2022/lib/models/user.mjs +41 -0
  108. package/esm2022/lib/services/activity.service.mjs +508 -0
  109. package/esm2022/lib/services/api.service.mjs +108 -0
  110. package/esm2022/lib/services/auth.service.mjs +62 -0
  111. package/esm2022/lib/services/bookable.service.mjs +279 -0
  112. package/esm2022/lib/services/booking-calendar.service.mjs +736 -0
  113. package/esm2022/lib/services/club.service.mjs +35 -0
  114. package/esm2022/lib/services/constant.service.mjs +97 -0
  115. package/esm2022/lib/services/email.service.mjs +28 -0
  116. package/esm2022/lib/services/external-link.service.mjs +25 -0
  117. package/esm2022/lib/services/factories/activity-settings-factory.mjs +3 -0
  118. package/{esm2020 → esm2022}/lib/services/factories/booking-calendar-application-time-factory.mjs +2 -2
  119. package/{esm2020 → esm2022}/lib/services/factories/booking-calendar-factory.mjs +2 -2
  120. package/{esm2020 → esm2022}/lib/services/factories/booking-calendar-slot-session-factory.mjs +2 -2
  121. package/esm2022/lib/services/factories/feature-flags-factory.mjs +5 -0
  122. package/esm2022/lib/services/factories/index.mjs +87 -0
  123. package/esm2022/lib/services/factories/member-public-form-factory.mjs +26 -0
  124. package/esm2022/lib/services/factories/payment-attempt-factory.mjs +23 -0
  125. package/esm2022/lib/services/feature-flags.service.mjs +44 -0
  126. package/esm2022/lib/services/file.service.mjs +65 -0
  127. package/esm2022/lib/services/index.mjs +24 -0
  128. package/esm2022/lib/services/invoice/invoice.service.mjs +42 -0
  129. package/esm2022/lib/services/invoice/payment-attempt.service.mjs +52 -0
  130. package/esm2022/lib/services/maintenance-mode.service.mjs +20 -0
  131. package/esm2022/lib/services/member-card.service.mjs +104 -0
  132. package/esm2022/lib/services/member-public-form.service.mjs +33 -0
  133. package/esm2022/lib/services/member.service.mjs +85 -0
  134. package/esm2022/lib/services/news.service.mjs +94 -0
  135. package/esm2022/lib/services/registration-qr-code.service.mjs +37 -0
  136. package/esm2022/lib/services/section.service.mjs +24 -0
  137. package/esm2022/lib/services/storage.service.mjs +44 -0
  138. package/esm2022/lib/services/team.service.mjs +89 -0
  139. package/esm2022/lib/services/token.service.mjs +58 -0
  140. package/esm2022/lib/services/user-notification.service.mjs +24 -0
  141. package/esm2022/lib/services/user.service.mjs +69 -0
  142. package/esm2022/lib/store/actions/activity.actions.mjs +177 -0
  143. package/esm2022/lib/store/actions/auth.actions.mjs +45 -0
  144. package/esm2022/lib/store/actions/booking.actions.mjs +187 -0
  145. package/esm2022/lib/store/actions/calendar.actions.mjs +77 -0
  146. package/esm2022/lib/store/actions/club-info.actions.mjs +23 -0
  147. package/esm2022/lib/store/actions/constant.actions.mjs +124 -0
  148. package/esm2022/lib/store/actions/email.actions.mjs +19 -0
  149. package/esm2022/lib/store/actions/external-link.actions.mjs +11 -0
  150. package/esm2022/lib/store/actions/file.actions.mjs +41 -0
  151. package/esm2022/lib/store/actions/index.mjs +19 -0
  152. package/esm2022/lib/store/actions/invoice.actions.mjs +73 -0
  153. package/esm2022/lib/store/actions/member-card.actions.mjs +71 -0
  154. package/esm2022/lib/store/actions/member.actions.mjs +65 -0
  155. package/esm2022/lib/store/actions/news.actions.mjs +47 -0
  156. package/esm2022/lib/store/actions/public-form.actions.mjs +17 -0
  157. package/esm2022/lib/store/actions/store.actions.mjs +7 -0
  158. package/esm2022/lib/store/actions/team.actions.mjs +83 -0
  159. package/esm2022/lib/store/actions/token.actions.mjs +53 -0
  160. package/esm2022/lib/store/actions/user.actions.mjs +49 -0
  161. package/esm2022/lib/store/effects/activity.effects.mjs +211 -0
  162. package/esm2022/lib/store/effects/auth.effects.mjs +96 -0
  163. package/esm2022/lib/store/effects/booking.effects.mjs +102 -0
  164. package/esm2022/lib/store/effects/calendar.effects.mjs +84 -0
  165. package/esm2022/lib/store/effects/club-info.effects.mjs +26 -0
  166. package/esm2022/lib/store/effects/constant.effects.mjs +69 -0
  167. package/esm2022/lib/store/effects/data-access.effects.mjs +37 -0
  168. package/esm2022/lib/store/effects/email.effects.mjs +27 -0
  169. package/esm2022/lib/store/effects/external-link.effects.mjs +20 -0
  170. package/esm2022/lib/store/effects/file.effects.mjs +149 -0
  171. package/esm2022/lib/store/effects/index.mjs +2 -0
  172. package/esm2022/lib/store/effects/invoice.effects.mjs +72 -0
  173. package/esm2022/lib/store/effects/member-card.effects.mjs +80 -0
  174. package/esm2022/lib/store/effects/member.effects.mjs +75 -0
  175. package/esm2022/lib/store/effects/mixins/extra-members-mixin.mjs +60 -0
  176. package/esm2022/lib/store/effects/news.effects.mjs +82 -0
  177. package/esm2022/lib/store/effects/public-form.effects.mjs +33 -0
  178. package/esm2022/lib/store/effects/team.effects.mjs +82 -0
  179. package/esm2022/lib/store/effects/token.effects.mjs +81 -0
  180. package/esm2022/lib/store/effects/user.effects.mjs +59 -0
  181. package/esm2022/lib/store/index.mjs +8 -0
  182. package/esm2022/lib/store/interfaces/activate-card-ticket.interface.mjs +2 -0
  183. package/esm2022/lib/store/interfaces/activate-user.interface.mjs +2 -0
  184. package/esm2022/lib/store/interfaces/calendar-activity-locations.interface.mjs +2 -0
  185. package/esm2022/lib/store/interfaces/calendar-activity-types.interface.mjs +2 -0
  186. package/esm2022/lib/store/interfaces/calendar-open-activity-result.interface.mjs +2 -0
  187. package/esm2022/lib/store/interfaces/calendar-public-open-activity-results.interface.mjs +2 -0
  188. package/esm2022/lib/store/interfaces/directory-result.interface.mjs +2 -0
  189. package/esm2022/lib/store/interfaces/email-settings.interface.mjs +2 -0
  190. package/esm2022/lib/store/interfaces/index.mjs +20 -0
  191. package/esm2022/lib/store/interfaces/list-result-interface.mjs +4 -0
  192. package/esm2022/lib/store/interfaces/location.interface.mjs +2 -0
  193. package/esm2022/lib/store/interfaces/member-calendar-event-result.interface.mjs +2 -0
  194. package/esm2022/lib/store/interfaces/member-card-deals.interface.mjs +2 -0
  195. package/esm2022/lib/store/interfaces/member-card-tickets.interface.mjs +2 -0
  196. package/esm2022/lib/store/interfaces/public-activate-card-ticket.interface.mjs +2 -0
  197. package/esm2022/lib/store/interfaces/remove-member-auth.interface.mjs +2 -0
  198. package/esm2022/lib/store/interfaces/remove-team-auth.interface.mjs +2 -0
  199. package/esm2022/lib/store/interfaces/retrieve-result.interface.mjs +4 -0
  200. package/esm2022/lib/store/interfaces/team-activity.interface.mjs +2 -0
  201. package/esm2022/lib/store/interfaces/team-calendar-event-result.interface.mjs +2 -0
  202. package/esm2022/lib/store/operators/ensure-activity.mjs +8 -0
  203. package/esm2022/lib/store/operators/ensure-auths.mjs +18 -0
  204. package/esm2022/lib/store/operators/ensure-calendar-events-loading-done.mjs +23 -0
  205. package/esm2022/lib/store/operators/ensure-constants.mjs +21 -0
  206. package/esm2022/lib/store/operators/ensure-current-auth.mjs +17 -0
  207. package/esm2022/lib/store/operators/ensure-current-user.mjs +16 -0
  208. package/esm2022/lib/store/operators/ensure-loading-done.mjs +24 -0
  209. package/esm2022/lib/store/operators/ensure-open-activities-loading-done.mjs +5 -0
  210. package/esm2022/lib/store/operators/ensure-public-open-activities-loading-done.mjs +5 -0
  211. package/esm2022/lib/store/operators/ensure-updated-data.mjs +10 -0
  212. package/esm2022/lib/store/operators/index.mjs +11 -0
  213. package/esm2022/lib/store/reducers/auth.reducer.mjs +52 -0
  214. package/esm2022/lib/store/reducers/booking.reducers.mjs +79 -0
  215. package/esm2022/lib/store/reducers/calendar.reducer.mjs +449 -0
  216. package/esm2022/lib/store/reducers/club-info.reducer.mjs +9 -0
  217. package/esm2022/lib/store/reducers/constant.reducer.mjs +181 -0
  218. package/esm2022/lib/store/reducers/data-access.reducer.mjs +37 -0
  219. package/esm2022/lib/store/reducers/email.reducer.mjs +21 -0
  220. package/esm2022/lib/store/reducers/external-link.reducer.mjs +6 -0
  221. package/esm2022/lib/store/reducers/file.reducer.mjs +118 -0
  222. package/esm2022/lib/store/reducers/index.mjs +2 -0
  223. package/esm2022/lib/store/reducers/invoice.reducer.mjs +6 -0
  224. package/esm2022/lib/store/reducers/member-card.reducer.mjs +33 -0
  225. package/esm2022/lib/store/reducers/member.reducer.mjs +21 -0
  226. package/esm2022/lib/store/reducers/news.reducer.mjs +96 -0
  227. package/esm2022/lib/store/reducers/public-form.reducer.mjs +21 -0
  228. package/esm2022/lib/store/reducers/public.reducer.mjs +109 -0
  229. package/esm2022/lib/store/reducers/reducer-helpers.mjs +61 -0
  230. package/esm2022/lib/store/reducers/team.reducer.mjs +77 -0
  231. package/esm2022/lib/store/reducers/token.reducer.mjs +21 -0
  232. package/esm2022/lib/store/reducers/user.reducer.mjs +18 -0
  233. package/esm2022/lib/store/selectors/auth.selectors.mjs +6 -0
  234. package/esm2022/lib/store/selectors/booking.selectors.mjs +15 -0
  235. package/esm2022/lib/store/selectors/calendar.selectors.mjs +18 -0
  236. package/esm2022/lib/store/selectors/club-info.selectors.mjs +5 -0
  237. package/esm2022/lib/store/selectors/constant.selectors.mjs +38 -0
  238. package/esm2022/lib/store/selectors/email.selectors.mjs +5 -0
  239. package/esm2022/lib/store/selectors/external-links.selectors.mjs +5 -0
  240. package/esm2022/lib/store/selectors/file.selectors.mjs +6 -0
  241. package/esm2022/lib/store/selectors/index.mjs +18 -0
  242. package/esm2022/lib/store/selectors/invoice.selectors.mjs +6 -0
  243. package/esm2022/lib/store/selectors/member-card.selectors.mjs +8 -0
  244. package/esm2022/lib/store/selectors/member.selectors.mjs +10 -0
  245. package/esm2022/lib/store/selectors/news.selectors.mjs +8 -0
  246. package/esm2022/lib/store/selectors/public-form.selectors.mjs +5 -0
  247. package/esm2022/lib/store/selectors/public.selectors.mjs +18 -0
  248. package/esm2022/lib/store/selectors/team.selectors.mjs +12 -0
  249. package/esm2022/lib/store/selectors/token.selectors.mjs +6 -0
  250. package/esm2022/lib/store/selectors/user.selectors.mjs +6 -0
  251. package/esm2022/lib/store/state/auth.state.mjs +5 -0
  252. package/esm2022/lib/store/state/booking.state.mjs +16 -0
  253. package/esm2022/lib/store/state/calendar.state.mjs +17 -0
  254. package/esm2022/lib/store/state/club-info.state.mjs +4 -0
  255. package/esm2022/lib/store/state/constant.state.mjs +21 -0
  256. package/esm2022/lib/store/state/data-access.state.mjs +2 -0
  257. package/esm2022/lib/store/state/email.state.mjs +7 -0
  258. package/esm2022/lib/store/state/external-link.state.mjs +4 -0
  259. package/esm2022/lib/store/state/file.state.mjs +5 -0
  260. package/esm2022/lib/store/state/index.mjs +19 -0
  261. package/esm2022/lib/store/state/invoice.state.mjs +5 -0
  262. package/esm2022/lib/store/state/member-card.state.mjs +7 -0
  263. package/esm2022/lib/store/state/member.state.mjs +10 -0
  264. package/esm2022/lib/store/state/news.state.mjs +7 -0
  265. package/esm2022/lib/store/state/public-form.state.mjs +5 -0
  266. package/esm2022/lib/store/state/public.state.mjs +17 -0
  267. package/esm2022/lib/store/state/team.state.mjs +11 -0
  268. package/esm2022/lib/store/state/token.state.mjs +5 -0
  269. package/esm2022/lib/store/state/user.state.mjs +5 -0
  270. package/fesm2022/myclub_se-data-access.mjs +10080 -0
  271. package/fesm2022/myclub_se-data-access.mjs.map +1 -0
  272. package/index.d.ts +1 -0
  273. package/lib/api-models/api-booking-calendar-application-time.d.ts +3 -0
  274. package/lib/api-models/api-booking-calendar-slot-session.d.ts +3 -0
  275. package/lib/api-models/api-booking-calendar.d.ts +2 -0
  276. package/lib/api-models/api-feature-flags.d.ts +5 -0
  277. package/lib/api-models/api-invoice/payment-attempt-data-types/api-payment-attempt-credit-card-data-type.d.ts +1 -1
  278. package/lib/api-models/api-invoice/payment-attempt-data-types/api-payment-attempt-swish-data-type.d.ts +1 -1
  279. package/lib/api-models/api-invoice/payment-attempt-data-types/api-payment-attempt-zimpler-data-type.d.ts +1 -1
  280. package/lib/api-models/index.d.ts +1 -0
  281. package/lib/authentication/authentication.interceptor.d.ts +12 -7
  282. package/lib/data-access.module.d.ts +3 -1
  283. package/lib/models/activity-settings.d.ts +3 -1
  284. package/lib/models/auth/auth.d.ts +3 -2
  285. package/lib/models/booking-calendar-application-time.d.ts +8 -3
  286. package/lib/models/booking-calendar-slot-session.d.ts +10 -5
  287. package/lib/models/booking-calendar-slot.d.ts +7 -6
  288. package/lib/models/booking-calendar.d.ts +4 -1
  289. package/lib/models/booking-settings.d.ts +5 -4
  290. package/lib/models/booking-slot-filter.d.ts +17 -0
  291. package/lib/models/directory.d.ts +1 -0
  292. package/lib/models/feature-flags.d.ts +7 -0
  293. package/lib/models/index.d.ts +2 -0
  294. package/lib/models/invoice/payment-attempt-data-types/payment-attempt-credit-card-data-type.d.ts +1 -1
  295. package/lib/models/invoice/payment-attempt-data-types/payment-attempt-swish-data-type.d.ts +1 -1
  296. package/lib/models/invoice/payment-attempt-data-types/payment-attempt-zimpler-data-type.d.ts +1 -1
  297. package/lib/services/activity.service.d.ts +55 -52
  298. package/lib/services/bookable.service.d.ts +9 -9
  299. package/lib/services/booking-calendar.service.d.ts +6 -23
  300. package/lib/services/constant.service.d.ts +5 -11
  301. package/lib/services/email.service.d.ts +0 -9
  302. package/lib/services/factories/feature-flags-factory.d.ts +3 -0
  303. package/lib/services/factories/index.d.ts +1 -0
  304. package/lib/services/feature-flags.service.d.ts +13 -0
  305. package/lib/services/index.d.ts +2 -0
  306. package/lib/services/member.service.d.ts +7 -3
  307. package/lib/services/storage.service.d.ts +20 -0
  308. package/lib/store/actions/activity.actions.d.ts +641 -0
  309. package/lib/store/actions/auth.actions.d.ts +83 -0
  310. package/lib/store/actions/booking.actions.d.ts +652 -0
  311. package/lib/store/actions/calendar.actions.d.ts +381 -0
  312. package/lib/store/actions/club-info.actions.d.ts +54 -0
  313. package/lib/store/actions/constant.actions.d.ts +249 -0
  314. package/lib/store/actions/email.actions.d.ts +57 -0
  315. package/lib/store/actions/external-link.actions.d.ts +22 -0
  316. package/lib/store/actions/file.actions.d.ts +169 -0
  317. package/lib/store/actions/index.d.ts +18 -0
  318. package/lib/store/actions/invoice.actions.d.ts +298 -0
  319. package/lib/store/actions/member-card.actions.d.ts +251 -0
  320. package/lib/store/actions/member.actions.d.ts +212 -0
  321. package/lib/store/actions/news.actions.d.ts +164 -0
  322. package/lib/store/actions/public-form.actions.d.ts +46 -0
  323. package/lib/store/actions/store.actions.d.ts +4 -0
  324. package/lib/store/actions/team.actions.d.ts +326 -0
  325. package/lib/store/actions/token.actions.d.ts +151 -0
  326. package/lib/store/actions/user.actions.d.ts +102 -0
  327. package/lib/store/effects/activity.effects.d.ts +152 -0
  328. package/lib/store/effects/auth.effects.d.ts +35 -0
  329. package/lib/store/effects/booking.effects.d.ts +196 -0
  330. package/lib/store/effects/calendar.effects.d.ts +129 -0
  331. package/lib/store/effects/club-info.effects.d.ts +24 -0
  332. package/lib/store/effects/constant.effects.d.ts +96 -0
  333. package/lib/store/effects/data-access.effects.d.ts +18 -0
  334. package/lib/store/effects/email.effects.d.ts +14 -0
  335. package/lib/store/effects/external-link.effects.d.ts +14 -0
  336. package/lib/store/effects/file.effects.d.ts +55 -0
  337. package/lib/store/effects/index.d.ts +1 -0
  338. package/lib/store/effects/invoice.effects.d.ts +80 -0
  339. package/lib/store/effects/member-card.effects.d.ts +69 -0
  340. package/lib/store/effects/member.effects.d.ts +58 -0
  341. package/lib/store/effects/mixins/extra-members-mixin.d.ts +10 -0
  342. package/lib/store/effects/news.effects.d.ts +49 -0
  343. package/lib/store/effects/public-form.effects.d.ts +19 -0
  344. package/lib/store/effects/team.effects.d.ts +80 -0
  345. package/lib/store/effects/token.effects.d.ts +66 -0
  346. package/lib/store/effects/user.effects.d.ts +36 -0
  347. package/lib/store/index.d.ts +7 -0
  348. package/lib/store/interfaces/activate-card-ticket.interface.d.ts +6 -0
  349. package/lib/store/interfaces/activate-user.interface.d.ts +4 -0
  350. package/lib/store/interfaces/calendar-activity-locations.interface.d.ts +7 -0
  351. package/lib/store/interfaces/calendar-activity-types.interface.d.ts +7 -0
  352. package/lib/store/interfaces/calendar-open-activity-result.interface.d.ts +8 -0
  353. package/lib/store/interfaces/calendar-public-open-activity-results.interface.d.ts +7 -0
  354. package/lib/store/interfaces/directory-result.interface.d.ts +5 -0
  355. package/lib/store/interfaces/email-settings.interface.d.ts +5 -0
  356. package/lib/store/interfaces/index.d.ts +19 -0
  357. package/lib/store/interfaces/list-result-interface.d.ts +13 -0
  358. package/lib/store/interfaces/location.interface.d.ts +7 -0
  359. package/lib/store/interfaces/member-calendar-event-result.interface.d.ts +8 -0
  360. package/lib/store/interfaces/member-card-deals.interface.d.ts +5 -0
  361. package/lib/store/interfaces/member-card-tickets.interface.d.ts +5 -0
  362. package/lib/store/interfaces/public-activate-card-ticket.interface.d.ts +6 -0
  363. package/lib/store/interfaces/remove-member-auth.interface.d.ts +4 -0
  364. package/lib/store/interfaces/remove-team-auth.interface.d.ts +4 -0
  365. package/lib/store/interfaces/retrieve-result.interface.d.ts +13 -0
  366. package/lib/store/interfaces/team-activity.interface.d.ts +9 -0
  367. package/lib/store/interfaces/team-calendar-event-result.interface.d.ts +8 -0
  368. package/lib/store/operators/ensure-activity.d.ts +4 -0
  369. package/lib/store/operators/ensure-auths.d.ts +13 -0
  370. package/lib/store/operators/ensure-calendar-events-loading-done.d.ts +19 -0
  371. package/lib/store/operators/ensure-constants.d.ts +12 -0
  372. package/lib/store/operators/ensure-current-auth.d.ts +12 -0
  373. package/lib/store/operators/ensure-current-user.d.ts +11 -0
  374. package/lib/store/operators/ensure-loading-done.d.ts +20 -0
  375. package/lib/store/operators/ensure-open-activities-loading-done.d.ts +3 -0
  376. package/lib/store/operators/ensure-public-open-activities-loading-done.d.ts +3 -0
  377. package/lib/store/operators/ensure-updated-data.d.ts +4 -0
  378. package/lib/store/operators/index.d.ts +10 -0
  379. package/lib/store/reducers/auth.reducer.d.ts +2 -0
  380. package/lib/store/reducers/booking.reducers.d.ts +2 -0
  381. package/lib/store/reducers/calendar.reducer.d.ts +2 -0
  382. package/lib/store/reducers/club-info.reducer.d.ts +2 -0
  383. package/lib/store/reducers/constant.reducer.d.ts +2 -0
  384. package/lib/store/reducers/data-access.reducer.d.ts +3 -0
  385. package/lib/store/reducers/email.reducer.d.ts +2 -0
  386. package/lib/store/reducers/external-link.reducer.d.ts +2 -0
  387. package/lib/store/reducers/file.reducer.d.ts +2 -0
  388. package/lib/store/reducers/index.d.ts +1 -0
  389. package/lib/store/reducers/invoice.reducer.d.ts +2 -0
  390. package/lib/store/reducers/member-card.reducer.d.ts +2 -0
  391. package/lib/store/reducers/member.reducer.d.ts +2 -0
  392. package/lib/store/reducers/news.reducer.d.ts +2 -0
  393. package/lib/store/reducers/public-form.reducer.d.ts +2 -0
  394. package/lib/store/reducers/public.reducer.d.ts +2 -0
  395. package/lib/store/reducers/reducer-helpers.d.ts +8 -0
  396. package/lib/store/reducers/team.reducer.d.ts +2 -0
  397. package/lib/store/reducers/token.reducer.d.ts +2 -0
  398. package/lib/store/reducers/user.reducer.d.ts +2 -0
  399. package/lib/store/selectors/auth.selectors.d.ts +4 -0
  400. package/lib/store/selectors/booking.selectors.d.ts +13 -0
  401. package/lib/store/selectors/calendar.selectors.d.ts +16 -0
  402. package/lib/store/selectors/club-info.selectors.d.ts +3 -0
  403. package/lib/store/selectors/constant.selectors.d.ts +19 -0
  404. package/lib/store/selectors/email.selectors.d.ts +3 -0
  405. package/lib/store/selectors/external-links.selectors.d.ts +3 -0
  406. package/lib/store/selectors/file.selectors.d.ts +4 -0
  407. package/lib/store/selectors/index.d.ts +17 -0
  408. package/lib/store/selectors/invoice.selectors.d.ts +4 -0
  409. package/lib/store/selectors/member-card.selectors.d.ts +6 -0
  410. package/lib/store/selectors/member.selectors.d.ts +8 -0
  411. package/lib/store/selectors/news.selectors.d.ts +6 -0
  412. package/lib/store/selectors/public-form.selectors.d.ts +3 -0
  413. package/lib/store/selectors/public.selectors.d.ts +16 -0
  414. package/lib/store/selectors/team.selectors.d.ts +10 -0
  415. package/lib/store/selectors/token.selectors.d.ts +4 -0
  416. package/lib/store/selectors/user.selectors.d.ts +4 -0
  417. package/lib/store/state/auth.state.d.ts +7 -0
  418. package/lib/store/state/booking.state.d.ts +16 -0
  419. package/lib/store/state/calendar.state.d.ts +19 -0
  420. package/lib/store/state/club-info.state.d.ts +6 -0
  421. package/lib/store/state/constant.state.d.ts +23 -0
  422. package/lib/store/state/data-access.state.d.ts +36 -0
  423. package/lib/store/state/email.state.d.ts +5 -0
  424. package/lib/store/state/external-link.state.d.ts +6 -0
  425. package/lib/store/state/file.state.d.ts +6 -0
  426. package/lib/store/state/index.d.ts +18 -0
  427. package/lib/store/state/invoice.state.d.ts +7 -0
  428. package/lib/store/state/member-card.state.d.ts +9 -0
  429. package/lib/store/state/member.state.d.ts +11 -0
  430. package/lib/store/state/news.state.d.ts +9 -0
  431. package/lib/store/state/public-form.state.d.ts +7 -0
  432. package/lib/store/state/public.state.d.ts +19 -0
  433. package/lib/store/state/team.state.d.ts +13 -0
  434. package/lib/store/state/token.state.d.ts +7 -0
  435. package/lib/store/state/user.state.d.ts +7 -0
  436. package/lib/types/attribute-type.d.ts +1 -1
  437. package/lib/types/booking-calendar-slot-reserved-time-position.d.ts +1 -1
  438. package/lib/types/booking-calendar-slot-type.d.ts +1 -1
  439. package/lib/types/contact-type.d.ts +1 -1
  440. package/lib/types/grant-type.d.ts +1 -1
  441. package/lib/types/payment-attempt-status-type.d.ts +1 -1
  442. package/lib/types/payment-attempt-type.d.ts +1 -1
  443. package/lib/types/sex-type.d.ts +1 -1
  444. package/package.json +13 -18
  445. package/esm2020/lib/api-models/api-invoice/api-payment-attempt-create.mjs +0 -8
  446. package/esm2020/lib/api-models/index.mjs +0 -56
  447. package/esm2020/lib/authentication/authentication.interceptor.mjs +0 -66
  448. package/esm2020/lib/authentication/authentication.service.mjs +0 -106
  449. package/esm2020/lib/authentication/guards/authenticated.guard.mjs +0 -36
  450. package/esm2020/lib/authentication/guards/handle-grant-token.guard.mjs +0 -29
  451. package/esm2020/lib/data-access.module.mjs +0 -30
  452. package/esm2020/lib/maintenance/maintenance.interceptor.mjs +0 -29
  453. package/esm2020/lib/models/activity-extra-member.mjs +0 -12
  454. package/esm2020/lib/models/activity-invite.mjs +0 -20
  455. package/esm2020/lib/models/activity-location-group.mjs +0 -21
  456. package/esm2020/lib/models/activity-location-part.mjs +0 -14
  457. package/esm2020/lib/models/activity-location-tag.mjs +0 -17
  458. package/esm2020/lib/models/activity-location.mjs +0 -36
  459. package/esm2020/lib/models/activity-participant.mjs +0 -12
  460. package/esm2020/lib/models/activity-settings.mjs +0 -14
  461. package/esm2020/lib/models/activity-type.mjs +0 -26
  462. package/esm2020/lib/models/activity.mjs +0 -92
  463. package/esm2020/lib/models/auth/auth-member.mjs +0 -10
  464. package/esm2020/lib/models/auth/auth-team.mjs +0 -9
  465. package/esm2020/lib/models/auth/auth.mjs +0 -15
  466. package/esm2020/lib/models/bookable-group.mjs +0 -21
  467. package/esm2020/lib/models/bookable-item.mjs +0 -39
  468. package/esm2020/lib/models/bookable-part.mjs +0 -14
  469. package/esm2020/lib/models/bookable-tag.mjs +0 -17
  470. package/esm2020/lib/models/booking-calendar-application-time.mjs +0 -52
  471. package/esm2020/lib/models/booking-calendar-slot-session.mjs +0 -54
  472. package/esm2020/lib/models/booking-calendar-slot.mjs +0 -53
  473. package/esm2020/lib/models/booking-calendar.mjs +0 -54
  474. package/esm2020/lib/models/booking-settings.mjs +0 -22
  475. package/esm2020/lib/models/calendar-event.mjs +0 -20
  476. package/esm2020/lib/models/calendar.mjs +0 -10
  477. package/esm2020/lib/models/card/card-deal.mjs +0 -10
  478. package/esm2020/lib/models/card/card-logo-urls.mjs +0 -13
  479. package/esm2020/lib/models/card/card-logo.mjs +0 -8
  480. package/esm2020/lib/models/card/card-member-ticket.mjs +0 -11
  481. package/esm2020/lib/models/card/card-theme.mjs +0 -10
  482. package/esm2020/lib/models/card/card-ticket-location.mjs +0 -9
  483. package/esm2020/lib/models/card/card-ticket.mjs +0 -21
  484. package/esm2020/lib/models/card/home-team.mjs +0 -8
  485. package/esm2020/lib/models/card/member-card.mjs +0 -14
  486. package/esm2020/lib/models/card/search-member-card.mjs +0 -9
  487. package/esm2020/lib/models/club-image.mjs +0 -18
  488. package/esm2020/lib/models/collection.mjs +0 -15
  489. package/esm2020/lib/models/contact.mjs +0 -46
  490. package/esm2020/lib/models/directory.mjs +0 -26
  491. package/esm2020/lib/models/email.mjs +0 -8
  492. package/esm2020/lib/models/event.mjs +0 -26
  493. package/esm2020/lib/models/file-object.mjs +0 -14
  494. package/esm2020/lib/models/general-image.mjs +0 -8
  495. package/esm2020/lib/models/group-role.mjs +0 -11
  496. package/esm2020/lib/models/image-urls.mjs +0 -10
  497. package/esm2020/lib/models/index.mjs +0 -62
  498. package/esm2020/lib/models/invoice/member-fee.mjs +0 -9
  499. package/esm2020/lib/models/invoice/member-invoice-row.mjs +0 -18
  500. package/esm2020/lib/models/invoice/member-invoice.mjs +0 -25
  501. package/esm2020/lib/models/invoice/payment-attempt.mjs +0 -13
  502. package/esm2020/lib/models/invoice/payment-types/credit-card.mjs +0 -16
  503. package/esm2020/lib/models/invoice/payment-types/giro.mjs +0 -11
  504. package/esm2020/lib/models/invoice/payment-types/swish.mjs +0 -18
  505. package/esm2020/lib/models/invoice/payment-types/zimpler.mjs +0 -12
  506. package/esm2020/lib/models/invoice/search-member-invoice.mjs +0 -17
  507. package/esm2020/lib/models/invoice/unpaid-member-invoice.mjs +0 -9
  508. package/esm2020/lib/models/member/member-attribute.mjs +0 -33
  509. package/esm2020/lib/models/member/member-contact.mjs +0 -21
  510. package/esm2020/lib/models/member/member-function.mjs +0 -19
  511. package/esm2020/lib/models/member/member-validation-settings.mjs +0 -13
  512. package/esm2020/lib/models/member/member.mjs +0 -75
  513. package/esm2020/lib/models/member/other-member.mjs +0 -13
  514. package/esm2020/lib/models/member/search-member.mjs +0 -20
  515. package/esm2020/lib/models/member-activity-invite.mjs +0 -31
  516. package/esm2020/lib/models/member-public-form-field-option.mjs +0 -9
  517. package/esm2020/lib/models/member-public-form-field.mjs +0 -16
  518. package/esm2020/lib/models/member-public-form.mjs +0 -30
  519. package/esm2020/lib/models/member-team-through.mjs +0 -14
  520. package/esm2020/lib/models/member-team.mjs +0 -13
  521. package/esm2020/lib/models/member-type.mjs +0 -8
  522. package/esm2020/lib/models/news.mjs +0 -47
  523. package/esm2020/lib/models/open-activity.mjs +0 -62
  524. package/esm2020/lib/models/optional-fee.mjs +0 -11
  525. package/esm2020/lib/models/overbooked-bookable-item.mjs +0 -10
  526. package/esm2020/lib/models/overbooked-location.mjs +0 -10
  527. package/esm2020/lib/models/partner.mjs +0 -9
  528. package/esm2020/lib/models/public-authentication.mjs +0 -7
  529. package/esm2020/lib/models/registration-qr-code.mjs +0 -12
  530. package/esm2020/lib/models/search-club.mjs +0 -14
  531. package/esm2020/lib/models/search-team.mjs +0 -18
  532. package/esm2020/lib/models/token.mjs +0 -8
  533. package/esm2020/lib/models/user-notification.mjs +0 -13
  534. package/esm2020/lib/models/user.mjs +0 -31
  535. package/esm2020/lib/services/activity.service.mjs +0 -470
  536. package/esm2020/lib/services/api.service.mjs +0 -106
  537. package/esm2020/lib/services/auth.service.mjs +0 -61
  538. package/esm2020/lib/services/bookable.service.mjs +0 -278
  539. package/esm2020/lib/services/booking-calendar.service.mjs +0 -794
  540. package/esm2020/lib/services/club.service.mjs +0 -34
  541. package/esm2020/lib/services/constant.service.mjs +0 -131
  542. package/esm2020/lib/services/email.service.mjs +0 -53
  543. package/esm2020/lib/services/external-link.service.mjs +0 -24
  544. package/esm2020/lib/services/factories/activity-settings-factory.mjs +0 -3
  545. package/esm2020/lib/services/factories/index.mjs +0 -86
  546. package/esm2020/lib/services/factories/member-public-form-factory.mjs +0 -26
  547. package/esm2020/lib/services/factories/payment-attempt-factory.mjs +0 -23
  548. package/esm2020/lib/services/file.service.mjs +0 -64
  549. package/esm2020/lib/services/index.mjs +0 -22
  550. package/esm2020/lib/services/invoice/invoice.service.mjs +0 -41
  551. package/esm2020/lib/services/invoice/payment-attempt.service.mjs +0 -51
  552. package/esm2020/lib/services/maintenance-mode.service.mjs +0 -21
  553. package/esm2020/lib/services/member-card.service.mjs +0 -103
  554. package/esm2020/lib/services/member-public-form.service.mjs +0 -32
  555. package/esm2020/lib/services/member.service.mjs +0 -63
  556. package/esm2020/lib/services/news.service.mjs +0 -102
  557. package/esm2020/lib/services/registration-qr-code.service.mjs +0 -36
  558. package/esm2020/lib/services/section.service.mjs +0 -23
  559. package/esm2020/lib/services/team.service.mjs +0 -88
  560. package/esm2020/lib/services/token.service.mjs +0 -57
  561. package/esm2020/lib/services/user-notification.service.mjs +0 -23
  562. package/esm2020/lib/services/user.service.mjs +0 -68
  563. package/fesm2015/myclub_se-data-access.mjs +0 -4835
  564. package/fesm2015/myclub_se-data-access.mjs.map +0 -1
  565. package/fesm2020/myclub_se-data-access.mjs +0 -4831
  566. package/fesm2020/myclub_se-data-access.mjs.map +0 -1
  567. /package/{esm2020 → esm2022}/lib/api-models/api-activity-extra-member.mjs +0 -0
  568. /package/{esm2020 → esm2022}/lib/api-models/api-activity-invite.mjs +0 -0
  569. /package/{esm2020 → esm2022}/lib/api-models/api-activity-location-group.mjs +0 -0
  570. /package/{esm2020 → esm2022}/lib/api-models/api-activity-location-part.mjs +0 -0
  571. /package/{esm2020 → esm2022}/lib/api-models/api-activity-location-tag.mjs +0 -0
  572. /package/{esm2020 → esm2022}/lib/api-models/api-activity-location.mjs +0 -0
  573. /package/{esm2020 → esm2022}/lib/api-models/api-activity-participant.mjs +0 -0
  574. /package/{esm2020 → esm2022}/lib/api-models/api-activity-settings.mjs +0 -0
  575. /package/{esm2020 → esm2022}/lib/api-models/api-activity-type.mjs +0 -0
  576. /package/{esm2020 → esm2022}/lib/api-models/api-activity.mjs +0 -0
  577. /package/{esm2020 → esm2022}/lib/api-models/api-auth/api-auth-member.mjs +0 -0
  578. /package/{esm2020 → esm2022}/lib/api-models/api-auth/api-auth-section.mjs +0 -0
  579. /package/{esm2020 → esm2022}/lib/api-models/api-auth/api-auth-team-section.mjs +0 -0
  580. /package/{esm2020 → esm2022}/lib/api-models/api-auth/api-auth-team.mjs +0 -0
  581. /package/{esm2020 → esm2022}/lib/api-models/api-auth/api-auth.mjs +0 -0
  582. /package/{esm2020 → esm2022}/lib/api-models/api-auth/index.mjs +0 -0
  583. /package/{esm2020 → esm2022}/lib/api-models/api-bookable-group.mjs +0 -0
  584. /package/{esm2020 → esm2022}/lib/api-models/api-bookable-item.mjs +0 -0
  585. /package/{esm2020 → esm2022}/lib/api-models/api-bookable-part.mjs +0 -0
  586. /package/{esm2020 → esm2022}/lib/api-models/api-bookable-tag.mjs +0 -0
  587. /package/{esm2020 → esm2022}/lib/api-models/api-booking-calendar-slot.mjs +0 -0
  588. /package/{esm2020 → esm2022}/lib/api-models/api-booking-settings.mjs +0 -0
  589. /package/{esm2020 → esm2022}/lib/api-models/api-calendar-event.mjs +0 -0
  590. /package/{esm2020 → esm2022}/lib/api-models/api-calendar.mjs +0 -0
  591. /package/{esm2020 → esm2022}/lib/api-models/api-card/api-card-deal.mjs +0 -0
  592. /package/{esm2020 → esm2022}/lib/api-models/api-card/api-card-logo-urls.mjs +0 -0
  593. /package/{esm2020 → esm2022}/lib/api-models/api-card/api-card-logo.mjs +0 -0
  594. /package/{esm2020 → esm2022}/lib/api-models/api-card/api-card-member-ticket.mjs +0 -0
  595. /package/{esm2020 → esm2022}/lib/api-models/api-card/api-card-theme.mjs +0 -0
  596. /package/{esm2020 → esm2022}/lib/api-models/api-card/api-card-ticket-location.mjs +0 -0
  597. /package/{esm2020 → esm2022}/lib/api-models/api-card/api-card-ticket.mjs +0 -0
  598. /package/{esm2020 → esm2022}/lib/api-models/api-card/api-card.mjs +0 -0
  599. /package/{esm2020 → esm2022}/lib/api-models/api-card/api-home-team.mjs +0 -0
  600. /package/{esm2020 → esm2022}/lib/api-models/api-card/api-member-card.mjs +0 -0
  601. /package/{esm2020 → esm2022}/lib/api-models/api-card/api-search-member-card.mjs +0 -0
  602. /package/{esm2020 → esm2022}/lib/api-models/api-card/index.mjs +0 -0
  603. /package/{esm2020 → esm2022}/lib/api-models/api-club-image.mjs +0 -0
  604. /package/{esm2020 → esm2022}/lib/api-models/api-club-section.mjs +0 -0
  605. /package/{esm2020 → esm2022}/lib/api-models/api-club.mjs +0 -0
  606. /package/{esm2020 → esm2022}/lib/api-models/api-collection.mjs +0 -0
  607. /package/{esm2020 → esm2022}/lib/api-models/api-directory.mjs +0 -0
  608. /package/{esm2020 → esm2022}/lib/api-models/api-event.mjs +0 -0
  609. /package/{esm2020 → esm2022}/lib/api-models/api-external-link.mjs +0 -0
  610. /package/{esm2020 → esm2022}/lib/api-models/api-file-object.mjs +0 -0
  611. /package/{esm2020 → esm2022}/lib/api-models/api-general-image.mjs +0 -0
  612. /package/{esm2020 → esm2022}/lib/api-models/api-group-role.mjs +0 -0
  613. /package/{esm2020 → esm2022}/lib/api-models/api-image-urls.mjs +0 -0
  614. /package/{esm2020 → esm2022}/lib/api-models/api-invoice/api-invoice-payments/api-credit-card.mjs +0 -0
  615. /package/{esm2020 → esm2022}/lib/api-models/api-invoice/api-invoice-payments/api-giro.mjs +0 -0
  616. /package/{esm2020 → esm2022}/lib/api-models/api-invoice/api-invoice-payments/api-swish.mjs +0 -0
  617. /package/{esm2020 → esm2022}/lib/api-models/api-invoice/api-invoice-payments/api-zimpler.mjs +0 -0
  618. /package/{esm2020 → esm2022}/lib/api-models/api-invoice/api-invoice-payments/index.mjs +0 -0
  619. /package/{esm2020 → esm2022}/lib/api-models/api-invoice/api-member-fee.mjs +0 -0
  620. /package/{esm2020 → esm2022}/lib/api-models/api-invoice/api-member-invoice-row.mjs +0 -0
  621. /package/{esm2020 → esm2022}/lib/api-models/api-invoice/api-member-invoice.mjs +0 -0
  622. /package/{esm2020 → esm2022}/lib/api-models/api-invoice/api-payment-attempt.mjs +0 -0
  623. /package/{esm2020 → esm2022}/lib/api-models/api-invoice/api-search-member-invoice.mjs +0 -0
  624. /package/{esm2020 → esm2022}/lib/api-models/api-invoice/api-swish-qr-code.mjs +0 -0
  625. /package/{esm2020 → esm2022}/lib/api-models/api-invoice/api-unpaid-member-invoice.mjs +0 -0
  626. /package/{esm2020 → esm2022}/lib/api-models/api-invoice/index.mjs +0 -0
  627. /package/{esm2020 → esm2022}/lib/api-models/api-invoice/payment-attempt-data-types/api-payment-attempt-credit-card-data-type.mjs +0 -0
  628. /package/{esm2020 → esm2022}/lib/api-models/api-invoice/payment-attempt-data-types/api-payment-attempt-swish-data-type.mjs +0 -0
  629. /package/{esm2020 → esm2022}/lib/api-models/api-invoice/payment-attempt-data-types/api-payment-attempt-zimpler-data-type.mjs +0 -0
  630. /package/{esm2020 → esm2022}/lib/api-models/api-invoice/payment-attempt-data-types/index.mjs +0 -0
  631. /package/{esm2020 → esm2022}/lib/api-models/api-member/api-contact.mjs +0 -0
  632. /package/{esm2020 → esm2022}/lib/api-models/api-member/api-member-attribute.mjs +0 -0
  633. /package/{esm2020 → esm2022}/lib/api-models/api-member/api-member-contact.mjs +0 -0
  634. /package/{esm2020 → esm2022}/lib/api-models/api-member/api-member-function.mjs +0 -0
  635. /package/{esm2020 → esm2022}/lib/api-models/api-member/api-member-validation-settings.mjs +0 -0
  636. /package/{esm2020 → esm2022}/lib/api-models/api-member/api-member.mjs +0 -0
  637. /package/{esm2020 → esm2022}/lib/api-models/api-member/api-other-member-field.mjs +0 -0
  638. /package/{esm2020 → esm2022}/lib/api-models/api-member/api-other-member.mjs +0 -0
  639. /package/{esm2020 → esm2022}/lib/api-models/api-member/api-search-member.mjs +0 -0
  640. /package/{esm2020 → esm2022}/lib/api-models/api-member/index.mjs +0 -0
  641. /package/{esm2020 → esm2022}/lib/api-models/api-member-activity-invite.mjs +0 -0
  642. /package/{esm2020 → esm2022}/lib/api-models/api-member-public-form-field-option.mjs +0 -0
  643. /package/{esm2020 → esm2022}/lib/api-models/api-member-public-form-field.mjs +0 -0
  644. /package/{esm2020 → esm2022}/lib/api-models/api-member-public-form.mjs +0 -0
  645. /package/{esm2020 → esm2022}/lib/api-models/api-member-team-through.mjs +0 -0
  646. /package/{esm2020 → esm2022}/lib/api-models/api-member-team.mjs +0 -0
  647. /package/{esm2020 → esm2022}/lib/api-models/api-member-type.mjs +0 -0
  648. /package/{esm2020 → esm2022}/lib/api-models/api-news.mjs +0 -0
  649. /package/{esm2020 → esm2022}/lib/api-models/api-open-activity.mjs +0 -0
  650. /package/{esm2020 → esm2022}/lib/api-models/api-optional-fee.mjs +0 -0
  651. /package/{esm2020 → esm2022}/lib/api-models/api-overbooked-bookable-item.mjs +0 -0
  652. /package/{esm2020 → esm2022}/lib/api-models/api-overbooked-location.mjs +0 -0
  653. /package/{esm2020 → esm2022}/lib/api-models/api-partner.mjs +0 -0
  654. /package/{esm2020 → esm2022}/lib/api-models/api-public-token.mjs +0 -0
  655. /package/{esm2020 → esm2022}/lib/api-models/api-registration-qr-code.mjs +0 -0
  656. /package/{esm2020 → esm2022}/lib/api-models/api-search-club.mjs +0 -0
  657. /package/{esm2020 → esm2022}/lib/api-models/api-search-team.mjs +0 -0
  658. /package/{esm2020 → esm2022}/lib/api-models/api-section.mjs +0 -0
  659. /package/{esm2020 → esm2022}/lib/api-models/api-token.mjs +0 -0
  660. /package/{esm2020 → esm2022}/lib/api-models/api-user-notification.mjs +0 -0
  661. /package/{esm2020 → esm2022}/lib/api-models/api-user.mjs +0 -0
  662. /package/{esm2020 → esm2022}/lib/authentication/authentication.config.mjs +0 -0
  663. /package/{esm2020 → esm2022}/lib/authentication/index.mjs +0 -0
  664. /package/{esm2020 → esm2022}/lib/interfaces/email-recipient.interface.mjs +0 -0
  665. /package/{esm2020 → esm2022}/lib/interfaces/index.mjs +0 -0
  666. /package/{esm2020 → esm2022}/lib/interfaces/new-account.interface.mjs +0 -0
  667. /package/{esm2020 → esm2022}/lib/interfaces/open-activity-search-params.interface.mjs +0 -0
  668. /package/{esm2020 → esm2022}/lib/interfaces/option.interface.mjs +0 -0
  669. /package/{esm2020 → esm2022}/lib/interfaces/sms-recipient.interface.mjs +0 -0
  670. /package/{esm2020 → esm2022}/lib/maintenance/index.mjs +0 -0
  671. /package/{esm2020 → esm2022}/lib/models/auth/index.mjs +0 -0
  672. /package/{esm2020 → esm2022}/lib/models/card/index.mjs +0 -0
  673. /package/{esm2020 → esm2022}/lib/models/invoice/index.mjs +0 -0
  674. /package/{esm2020 → esm2022}/lib/models/invoice/payment-attempt-data-types/index.mjs +0 -0
  675. /package/{esm2020 → esm2022}/lib/models/invoice/payment-attempt-data-types/payment-attempt-credit-card-data-type.mjs +0 -0
  676. /package/{esm2020 → esm2022}/lib/models/invoice/payment-attempt-data-types/payment-attempt-swish-data-type.mjs +0 -0
  677. /package/{esm2020 → esm2022}/lib/models/invoice/payment-attempt-data-types/payment-attempt-zimpler-data-type.mjs +0 -0
  678. /package/{esm2020 → esm2022}/lib/models/invoice/payment-types/index.mjs +0 -0
  679. /package/{esm2020 → esm2022}/lib/models/member/index.mjs +0 -0
  680. /package/{esm2020 → esm2022}/lib/models/role.mjs +0 -0
  681. /package/{esm2020 → esm2022}/lib/services/factories/activity-extra-member-factory.mjs +0 -0
  682. /package/{esm2020 → esm2022}/lib/services/factories/activity-factory.mjs +0 -0
  683. /package/{esm2020 → esm2022}/lib/services/factories/activity-invite-factory.mjs +0 -0
  684. /package/{esm2020 → esm2022}/lib/services/factories/activity-location-factory.mjs +0 -0
  685. /package/{esm2020 → esm2022}/lib/services/factories/activity-location-group-factory.mjs +0 -0
  686. /package/{esm2020 → esm2022}/lib/services/factories/activity-location-part-factory.mjs +0 -0
  687. /package/{esm2020 → esm2022}/lib/services/factories/activity-location-tag-factory.mjs +0 -0
  688. /package/{esm2020 → esm2022}/lib/services/factories/activity-participant-factory.mjs +0 -0
  689. /package/{esm2020 → esm2022}/lib/services/factories/activity-type-factory.mjs +0 -0
  690. /package/{esm2020 → esm2022}/lib/services/factories/auth-factory.mjs +0 -0
  691. /package/{esm2020 → esm2022}/lib/services/factories/auth-member-factory.mjs +0 -0
  692. /package/{esm2020 → esm2022}/lib/services/factories/auth-section-factory.mjs +0 -0
  693. /package/{esm2020 → esm2022}/lib/services/factories/auth-team-factory.mjs +0 -0
  694. /package/{esm2020 → esm2022}/lib/services/factories/auth-team-section-factory.mjs +0 -0
  695. /package/{esm2020 → esm2022}/lib/services/factories/bookable-group-factory.mjs +0 -0
  696. /package/{esm2020 → esm2022}/lib/services/factories/bookable-item-factory.mjs +0 -0
  697. /package/{esm2020 → esm2022}/lib/services/factories/bookable-part-factory.mjs +0 -0
  698. /package/{esm2020 → esm2022}/lib/services/factories/bookable-tag-factory.mjs +0 -0
  699. /package/{esm2020 → esm2022}/lib/services/factories/booking-calendar-slot-factory.mjs +0 -0
  700. /package/{esm2020 → esm2022}/lib/services/factories/booking-settings-factory.mjs +0 -0
  701. /package/{esm2020 → esm2022}/lib/services/factories/card-deal-factory.mjs +0 -0
  702. /package/{esm2020 → esm2022}/lib/services/factories/card-factory.mjs +0 -0
  703. /package/{esm2020 → esm2022}/lib/services/factories/card-logo-factory.mjs +0 -0
  704. /package/{esm2020 → esm2022}/lib/services/factories/card-logo-urls-factory.mjs +0 -0
  705. /package/{esm2020 → esm2022}/lib/services/factories/card-member-ticket-factory.mjs +0 -0
  706. /package/{esm2020 → esm2022}/lib/services/factories/card-theme-factory.mjs +0 -0
  707. /package/{esm2020 → esm2022}/lib/services/factories/card-ticket-factory.mjs +0 -0
  708. /package/{esm2020 → esm2022}/lib/services/factories/card-ticket-location-factory.mjs +0 -0
  709. /package/{esm2020 → esm2022}/lib/services/factories/club-factory.mjs +0 -0
  710. /package/{esm2020 → esm2022}/lib/services/factories/club-image-factory.mjs +0 -0
  711. /package/{esm2020 → esm2022}/lib/services/factories/club-section-factory.mjs +0 -0
  712. /package/{esm2020 → esm2022}/lib/services/factories/contact-factory.mjs +0 -0
  713. /package/{esm2020 → esm2022}/lib/services/factories/credit-card-factory.mjs +0 -0
  714. /package/{esm2020 → esm2022}/lib/services/factories/directory-factory.mjs +0 -0
  715. /package/{esm2020 → esm2022}/lib/services/factories/event-factory.mjs +0 -0
  716. /package/{esm2020 → esm2022}/lib/services/factories/external-link-factory.mjs +0 -0
  717. /package/{esm2020 → esm2022}/lib/services/factories/file-factory.mjs +0 -0
  718. /package/{esm2020 → esm2022}/lib/services/factories/general-image-factory.mjs +0 -0
  719. /package/{esm2020 → esm2022}/lib/services/factories/giro-factory.mjs +0 -0
  720. /package/{esm2020 → esm2022}/lib/services/factories/group-role-factory.mjs +0 -0
  721. /package/{esm2020 → esm2022}/lib/services/factories/home-team-factory.mjs +0 -0
  722. /package/{esm2020 → esm2022}/lib/services/factories/image-urls-factory.mjs +0 -0
  723. /package/{esm2020 → esm2022}/lib/services/factories/member-attribute-factory.mjs +0 -0
  724. /package/{esm2020 → esm2022}/lib/services/factories/member-card-factory.mjs +0 -0
  725. /package/{esm2020 → esm2022}/lib/services/factories/member-contact-factory.mjs +0 -0
  726. /package/{esm2020 → esm2022}/lib/services/factories/member-factory.mjs +0 -0
  727. /package/{esm2020 → esm2022}/lib/services/factories/member-fee-factory.mjs +0 -0
  728. /package/{esm2020 → esm2022}/lib/services/factories/member-function-factory.mjs +0 -0
  729. /package/{esm2020 → esm2022}/lib/services/factories/member-invite-factory.mjs +0 -0
  730. /package/{esm2020 → esm2022}/lib/services/factories/member-invoice-factory.mjs +0 -0
  731. /package/{esm2020 → esm2022}/lib/services/factories/member-invoice-row-factory.mjs +0 -0
  732. /package/{esm2020 → esm2022}/lib/services/factories/member-public-form-field-factory.mjs +0 -0
  733. /package/{esm2020 → esm2022}/lib/services/factories/member-public-form-field-option-factory.mjs +0 -0
  734. /package/{esm2020 → esm2022}/lib/services/factories/member-team-factory.mjs +0 -0
  735. /package/{esm2020 → esm2022}/lib/services/factories/member-team-through-factory.mjs +0 -0
  736. /package/{esm2020 → esm2022}/lib/services/factories/member-type-factory.mjs +0 -0
  737. /package/{esm2020 → esm2022}/lib/services/factories/member-validation-settings-factory.mjs +0 -0
  738. /package/{esm2020 → esm2022}/lib/services/factories/news-factory.mjs +0 -0
  739. /package/{esm2020 → esm2022}/lib/services/factories/open-activity-factory.mjs +0 -0
  740. /package/{esm2020 → esm2022}/lib/services/factories/optional-fee-factory.mjs +0 -0
  741. /package/{esm2020 → esm2022}/lib/services/factories/other-member-factory.mjs +0 -0
  742. /package/{esm2020 → esm2022}/lib/services/factories/other-member-field-factory.mjs +0 -0
  743. /package/{esm2020 → esm2022}/lib/services/factories/overbooked-bookable-item-factory.mjs +0 -0
  744. /package/{esm2020 → esm2022}/lib/services/factories/overbooked-location-factory.mjs +0 -0
  745. /package/{esm2020 → esm2022}/lib/services/factories/partner-factory.mjs +0 -0
  746. /package/{esm2020 → esm2022}/lib/services/factories/public-authentication-factory.mjs +0 -0
  747. /package/{esm2020 → esm2022}/lib/services/factories/registration-qr-code-factory.mjs +0 -0
  748. /package/{esm2020 → esm2022}/lib/services/factories/search-club-factory.mjs +0 -0
  749. /package/{esm2020 → esm2022}/lib/services/factories/search-member-card-factory.mjs +0 -0
  750. /package/{esm2020 → esm2022}/lib/services/factories/search-member-factory.mjs +0 -0
  751. /package/{esm2020 → esm2022}/lib/services/factories/search-member-invoice-factory.mjs +0 -0
  752. /package/{esm2020 → esm2022}/lib/services/factories/search-member-team-through-factory.mjs +0 -0
  753. /package/{esm2020 → esm2022}/lib/services/factories/search-team-factory.mjs +0 -0
  754. /package/{esm2020 → esm2022}/lib/services/factories/section-factory.mjs +0 -0
  755. /package/{esm2020 → esm2022}/lib/services/factories/swish-factory.mjs +0 -0
  756. /package/{esm2020 → esm2022}/lib/services/factories/token-factory.mjs +0 -0
  757. /package/{esm2020 → esm2022}/lib/services/factories/unpaid-invoice-factory.mjs +0 -0
  758. /package/{esm2020 → esm2022}/lib/services/factories/user-factory.mjs +0 -0
  759. /package/{esm2020 → esm2022}/lib/services/factories/user-notification-factory.mjs +0 -0
  760. /package/{esm2020 → esm2022}/lib/services/factories/zimpler-factory.mjs +0 -0
  761. /package/{esm2020 → esm2022}/lib/services/invoice/index.mjs +0 -0
  762. /package/{esm2020 → esm2022}/lib/types/attribute-type.mjs +0 -0
  763. /package/{esm2020 → esm2022}/lib/types/booking-calendar-slot-reserved-time-position.mjs +0 -0
  764. /package/{esm2020 → esm2022}/lib/types/booking-calendar-slot-type.mjs +0 -0
  765. /package/{esm2020 → esm2022}/lib/types/contact-type.mjs +0 -0
  766. /package/{esm2020 → esm2022}/lib/types/grant-type.mjs +0 -0
  767. /package/{esm2020 → esm2022}/lib/types/index.mjs +0 -0
  768. /package/{esm2020 → esm2022}/lib/types/payment-attempt-status-type.mjs +0 -0
  769. /package/{esm2020 → esm2022}/lib/types/payment-attempt-type.mjs +0 -0
  770. /package/{esm2020 → esm2022}/lib/types/sex-type.mjs +0 -0
  771. /package/{esm2020 → esm2022}/myclub_se-data-access.mjs +0 -0
@@ -1,4831 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { InjectionToken, Injectable, Inject, NgModule } from '@angular/core';
3
- import * as i1 from '@angular/common/http';
4
- import { HttpErrorResponse, HttpParams, HttpRequest, HTTP_INTERCEPTORS } from '@angular/common/http';
5
- import { map, catchError, tap, filter, take, switchMap, finalize } from 'rxjs/operators';
6
- import { of, BehaviorSubject, throwError } from 'rxjs';
7
- import { FormGroup, FormControl, Validators, FormArray } from '@angular/forms';
8
- import { format, sub } from 'date-fns';
9
- import * as i2 from '@angular/router';
10
-
11
- class Activity {
12
- constructor(id, activity_group_id, activity_type_id, club_id, location_id, team_id, activity_location, activity_type_name, allow_maybe, calendar_name, created, current_num_attendants, day, description, end_time, file, invitation_text, invite_first_days, invite_groups, invite_hide_before_sent, invite_last_response_date, invite_remind, invite_remind_receivers, invite_second_days, invite_settings, invited_members, last_response_date, max_num_attendants, max_num_attendants_type, meet_up_place, meet_up_time, meet_up_time_display, open_activity, qr_code, qr_code_enabled, repeat, repeat_num, repeat_to_day, repeat_type, show_other_invited, start_time, title, updated, use_invite, update_repeating) {
13
- this.id = id;
14
- this.activity_group_id = activity_group_id;
15
- this.activity_type_id = activity_type_id;
16
- this.club_id = club_id;
17
- this.location_id = location_id;
18
- this.team_id = team_id;
19
- this.activity_location = activity_location;
20
- this.activity_type_name = activity_type_name;
21
- this.allow_maybe = allow_maybe;
22
- this.calendar_name = calendar_name;
23
- this.created = created;
24
- this.current_num_attendants = current_num_attendants;
25
- this.day = day;
26
- this.description = description;
27
- this.end_time = end_time;
28
- this.file = file;
29
- this.invitation_text = invitation_text;
30
- this.invite_first_days = invite_first_days;
31
- this.invite_groups = invite_groups;
32
- this.invite_hide_before_sent = invite_hide_before_sent;
33
- this.invite_last_response_date = invite_last_response_date;
34
- this.invite_remind = invite_remind;
35
- this.invite_remind_receivers = invite_remind_receivers;
36
- this.invite_second_days = invite_second_days;
37
- this.invite_settings = invite_settings;
38
- this.invited_members = invited_members;
39
- this.last_response_date = last_response_date;
40
- this.max_num_attendants = max_num_attendants;
41
- this.max_num_attendants_type = max_num_attendants_type;
42
- this.meet_up_place = meet_up_place;
43
- this.meet_up_time = meet_up_time;
44
- this.meet_up_time_display = meet_up_time_display;
45
- this.open_activity = open_activity;
46
- this.qr_code = qr_code;
47
- this.qr_code_enabled = qr_code_enabled;
48
- this.repeat = repeat;
49
- this.repeat_num = repeat_num;
50
- this.repeat_to_day = repeat_to_day;
51
- this.repeat_type = repeat_type;
52
- this.show_other_invited = show_other_invited;
53
- this.start_time = start_time;
54
- this.title = title;
55
- this.updated = updated;
56
- this.use_invite = use_invite;
57
- this.update_repeating = update_repeating;
58
- }
59
- static asFormGroup(activity = null) {
60
- return new FormGroup({
61
- id: new FormControl(activity?.id || ''),
62
- activity_group_id: new FormControl(activity?.activity_group_id || null, { nonNullable: false }),
63
- activity_type_id: new FormControl(activity?.activity_type_id || '', [Validators.required]),
64
- club_id: new FormControl(activity?.club_id || ''),
65
- location_id: new FormControl(activity?.location_id || '', [Validators.required]),
66
- team_id: new FormControl(activity?.team_id || ''),
67
- activity_location: new FormControl(activity?.activity_location || '', [Validators.required]),
68
- activity_type_name: new FormControl(activity?.activity_type_name || ''),
69
- allow_maybe: new FormControl(typeof activity?.allow_maybe !== 'undefined' ? activity.allow_maybe : false),
70
- day: new FormControl(activity?.day || '', [Validators.required]),
71
- description: new FormControl(activity?.description || ''),
72
- end_time: new FormControl(activity?.end_time || '', [Validators.required]),
73
- file: new FormControl(''),
74
- invitation_text: new FormControl(activity?.invitation_text || ''),
75
- invite_first_days: new FormControl(Number.isInteger(activity?.invite_first_days) ? activity?.invite_first_days : 7),
76
- invite_groups: new FormControl(activity?.invite_groups || []),
77
- invite_hide_before_sent: new FormControl(typeof activity?.invite_hide_before_sent !== 'undefined' ? activity?.invite_hide_before_sent : false),
78
- invite_last_response_date: new FormControl(activity?.invite_last_response_date || ''),
79
- invite_remind: new FormControl(activity?.invite_remind || 0),
80
- invite_remind_receivers: new FormControl(activity?.invite_remind_receivers || ''),
81
- invite_second_days: new FormControl(Number.isInteger(activity?.invite_second_days) ? activity?.invite_second_days : 2),
82
- invite_settings: new FormControl(activity?.invite_settings || ''),
83
- last_response_date: new FormControl(activity?.last_response_date || ''),
84
- max_num_attendants: new FormControl(activity?.max_num_attendants || 0),
85
- max_num_attendants_type: new FormControl(activity?.max_num_attendants_type || 'only_participants'),
86
- meet_up_place: new FormControl(activity?.meet_up_place || ''),
87
- meet_up_time: new FormControl(activity?.meet_up_time || 0),
88
- open_activity: new FormControl(activity?.open_activity || false),
89
- repeat: new FormControl(activity?.repeat || 'none'),
90
- repeat_num: new FormControl(Number.isInteger(activity?.repeat_num) ? activity?.repeat_num : 6),
91
- repeat_to_day: new FormControl(activity?.repeat_to_day || ''),
92
- repeat_type: new FormControl(activity?.repeat_type || ''),
93
- show_other_invited: new FormControl(activity?.show_other_invited || 'all'),
94
- start_time: new FormControl(activity?.start_time || '', [Validators.required]),
95
- title: new FormControl(activity?.title || '', [Validators.required]),
96
- use_invite: new FormControl(typeof activity?.use_invite !== 'undefined' ? activity?.use_invite : false),
97
- update_repeating: new FormControl(typeof activity?.update_repeating !== 'undefined' ? activity?.update_repeating : false)
98
- });
99
- }
100
- }
101
-
102
- class ActivityExtraMember {
103
- constructor(id, member_id, team_id, created, leader, member, member_name) {
104
- this.id = id;
105
- this.member_id = member_id;
106
- this.team_id = team_id;
107
- this.created = created;
108
- this.leader = leader;
109
- this.member = member;
110
- this.member_name = member_name;
111
- }
112
- }
113
-
114
- class ActivityInvite {
115
- constructor(id, activity, comment, created, has_unpaid_invoices, last_invite, leader, member, next_invite, reminded, response_date, status, token, unpaid_invoices, updated) {
116
- this.id = id;
117
- this.activity = activity;
118
- this.comment = comment;
119
- this.created = created;
120
- this.has_unpaid_invoices = has_unpaid_invoices;
121
- this.last_invite = last_invite;
122
- this.leader = leader;
123
- this.member = member;
124
- this.next_invite = next_invite;
125
- this.reminded = reminded;
126
- this.response_date = response_date;
127
- this.status = status;
128
- this.token = token;
129
- this.unpaid_invoices = unpaid_invoices;
130
- this.updated = updated;
131
- }
132
- }
133
-
134
- class ActivityLocationTag {
135
- constructor(id, club_id, section_id, name, location_names = []) {
136
- this.id = id;
137
- this.club_id = club_id;
138
- this.section_id = section_id;
139
- this.name = name;
140
- this.location_names = location_names;
141
- }
142
- static asFormGroup(tag) {
143
- return new FormGroup({
144
- id: new FormControl(tag?.id || ''),
145
- name: new FormControl(tag?.name || '', Validators.required),
146
- });
147
- }
148
- }
149
-
150
- class ActivityLocationPart {
151
- constructor(id, name) {
152
- this.id = id;
153
- this.name = name;
154
- }
155
- static asFormGroup(part) {
156
- return new FormGroup({
157
- id: new FormControl(part?.id || ''),
158
- name: new FormControl(part?.name || '', Validators.required),
159
- });
160
- }
161
- }
162
-
163
- class ActivityLocation {
164
- constructor(id, club_id, section_id, group_id, active, mun_location_city_area, mun_location_name, name, tags, parts) {
165
- this.id = id;
166
- this.club_id = club_id;
167
- this.section_id = section_id;
168
- this.group_id = group_id;
169
- this.active = active;
170
- this.mun_location_city_area = mun_location_city_area;
171
- this.mun_location_name = mun_location_name;
172
- this.name = name;
173
- this.tags = tags;
174
- this.parts = parts;
175
- }
176
- static asFormGroup(location) {
177
- const tags = [];
178
- const parts = [];
179
- if (location?.tags) {
180
- location.tags.forEach((tag) => tags.push(ActivityLocationTag.asFormGroup(tag)));
181
- }
182
- if (location?.parts) {
183
- location.parts.forEach((part) => parts.push(ActivityLocationPart.asFormGroup(part)));
184
- }
185
- return new FormGroup({
186
- id: new FormControl(location?.id || ''),
187
- club_id: new FormControl(location?.club_id || '', Validators.required),
188
- active: new FormControl(typeof location?.active !== 'undefined' ? location?.active : false),
189
- group_id: new FormControl(location?.group_id || ''),
190
- tags: new FormArray(tags),
191
- parts: new FormArray(parts),
192
- });
193
- }
194
- }
195
-
196
- class ActivityLocationGroup {
197
- constructor(id, club_id, section_id, active, name, locations) {
198
- this.id = id;
199
- this.club_id = club_id;
200
- this.section_id = section_id;
201
- this.active = active;
202
- this.name = name;
203
- this.locations = locations;
204
- }
205
- static asFormGroup(locationGroup) {
206
- return new FormGroup({
207
- id: new FormControl(locationGroup?.id || ''),
208
- club_id: new FormControl(locationGroup?.club_id || '', Validators.required),
209
- section_id: new FormControl(locationGroup?.section_id || ''),
210
- name: new FormControl(locationGroup?.name || '', Validators.required),
211
- active: new FormControl(typeof locationGroup?.active !== 'undefined' ? locationGroup?.active : false),
212
- });
213
- }
214
- }
215
-
216
- class ActivityParticipant {
217
- constructor(id, activityId, memberId, teamId, memberEmail, memberName, rfLeader) {
218
- this.id = id;
219
- this.activityId = activityId;
220
- this.memberId = memberId;
221
- this.teamId = teamId;
222
- this.memberEmail = memberEmail;
223
- this.memberName = memberName;
224
- this.rfLeader = rfLeader;
225
- }
226
- }
227
-
228
- class ActivitySettings {
229
- constructor(dayOptions, hourOptions, inviteGroupOptions, inviteSettingsOptions, maxAttendanceOptions, meetUpTimeOptions, remindReceiverOptions, repeatOptions, repeatTypeOptions) {
230
- this.dayOptions = dayOptions;
231
- this.hourOptions = hourOptions;
232
- this.inviteGroupOptions = inviteGroupOptions;
233
- this.inviteSettingsOptions = inviteSettingsOptions;
234
- this.maxAttendanceOptions = maxAttendanceOptions;
235
- this.meetUpTimeOptions = meetUpTimeOptions;
236
- this.remindReceiverOptions = remindReceiverOptions;
237
- this.repeatOptions = repeatOptions;
238
- this.repeatTypeOptions = repeatTypeOptions;
239
- }
240
- }
241
-
242
- class ActivityType {
243
- constructor(id, club_id, section_id, active, base_type, name, is_available_for_booking = true, color = '#FFFFFF') {
244
- this.id = id;
245
- this.club_id = club_id;
246
- this.section_id = section_id;
247
- this.active = active;
248
- this.base_type = base_type;
249
- this.name = name;
250
- this.is_available_for_booking = is_available_for_booking;
251
- this.color = color;
252
- }
253
- static asFormGroup(type) {
254
- return new FormGroup({
255
- id: new FormControl(type?.id || ''),
256
- club_id: new FormControl(type?.club_id || ''),
257
- section_id: new FormControl(type?.section_id || ''),
258
- active: new FormControl(typeof type?.active === 'undefined' ? true : type?.active),
259
- base_type: new FormControl(type?.base_type || ''),
260
- name: new FormControl(type?.name || '', Validators.required),
261
- is_available_for_booking: new FormControl(typeof type?.is_available_for_booking === 'undefined' ? true : type?.is_available_for_booking),
262
- color: new FormControl(type?.color || '#FFFFFF'),
263
- });
264
- }
265
- }
266
-
267
- class Auth {
268
- constructor(id, name, clubAdmin, isSectionClub, members, registrationEnabled, sections, siteEnabled, teams, user_name) {
269
- this.id = id;
270
- this.name = name;
271
- this.clubAdmin = clubAdmin;
272
- this.isSectionClub = isSectionClub;
273
- this.members = members;
274
- this.registrationEnabled = registrationEnabled;
275
- this.sections = sections;
276
- this.siteEnabled = siteEnabled;
277
- this.teams = teams;
278
- this.user_name = user_name;
279
- }
280
- }
281
-
282
- class AuthMember {
283
- constructor(id, name, calendar_url) {
284
- this.id = id;
285
- this.name = name;
286
- this.calendar_url = calendar_url;
287
- this.eventColor = '';
288
- this.eventBackgroundColor = '';
289
- }
290
- }
291
-
292
- class AuthSection {
293
- constructor(id, name) {
294
- this.id = id;
295
- this.name = name;
296
- }
297
- }
298
-
299
- class AuthTeam {
300
- constructor(id, calendar_url, name, section) {
301
- this.id = id;
302
- this.calendar_url = calendar_url;
303
- this.name = name;
304
- this.section = section;
305
- }
306
- }
307
-
308
- class AuthTeamSection {
309
- constructor(id, name) {
310
- this.id = id;
311
- this.name = name;
312
- }
313
- }
314
-
315
- class Authentication {
316
- constructor(accessToken, refreshToken) {
317
- this.accessToken = accessToken;
318
- this.refreshToken = refreshToken;
319
- }
320
- }
321
-
322
- class BookableGroup {
323
- constructor(id, club_id, section_id, active, name, bookable_items) {
324
- this.id = id;
325
- this.club_id = club_id;
326
- this.section_id = section_id;
327
- this.active = active;
328
- this.name = name;
329
- this.bookable_items = bookable_items;
330
- }
331
- static asFormGroup(bookableGroup) {
332
- return new FormGroup({
333
- id: new FormControl(bookableGroup?.id || ''),
334
- club_id: new FormControl(bookableGroup?.club_id || '', Validators.required),
335
- section_id: new FormControl(bookableGroup?.section_id || ''),
336
- name: new FormControl(bookableGroup?.name || '', Validators.required),
337
- active: new FormControl(typeof bookableGroup?.active !== 'undefined' ? bookableGroup?.active : false),
338
- });
339
- }
340
- }
341
-
342
- class BookableTag {
343
- constructor(id, club_id, section_id, name, bookable_item_names = []) {
344
- this.id = id;
345
- this.club_id = club_id;
346
- this.section_id = section_id;
347
- this.name = name;
348
- this.bookable_item_names = bookable_item_names;
349
- }
350
- static asFormGroup(tag) {
351
- return new FormGroup({
352
- id: new FormControl(tag?.id || ''),
353
- name: new FormControl(tag?.name || '', Validators.required),
354
- });
355
- }
356
- }
357
-
358
- class BookablePart {
359
- constructor(id, name) {
360
- this.id = id;
361
- this.name = name;
362
- }
363
- static asFormGroup(part) {
364
- return new FormGroup({
365
- id: new FormControl(part?.id || ''),
366
- name: new FormControl(part?.name || '', Validators.required),
367
- });
368
- }
369
- }
370
-
371
- class BookableItem {
372
- constructor(id, club_id, section_id, group_id, active, name, location_id, description, tags, parts) {
373
- this.id = id;
374
- this.club_id = club_id;
375
- this.section_id = section_id;
376
- this.group_id = group_id;
377
- this.active = active;
378
- this.name = name;
379
- this.location_id = location_id;
380
- this.description = description;
381
- this.tags = tags;
382
- this.parts = parts;
383
- }
384
- static asFormGroup(bookable) {
385
- const tags = [];
386
- const parts = [];
387
- if (bookable?.tags) {
388
- bookable.tags.forEach((tag) => tags.push(BookableTag.asFormGroup(tag)));
389
- }
390
- if (bookable?.parts) {
391
- bookable.parts.forEach((part) => parts.push(BookablePart.asFormGroup(part)));
392
- }
393
- return new FormGroup({
394
- id: new FormControl(bookable?.id || ''),
395
- club_id: new FormControl(bookable?.club_id || '', Validators.required),
396
- active: new FormControl(typeof bookable?.active !== 'undefined' ? bookable?.active : false),
397
- group_id: new FormControl(bookable?.group_id || ''),
398
- location_id: new FormControl(bookable?.location_id),
399
- name: new FormControl(bookable?.name || '', Validators.required),
400
- description: new FormControl(bookable?.description || ''),
401
- tags: new FormArray(tags),
402
- parts: new FormArray(parts),
403
- });
404
- }
405
- }
406
-
407
- class SearchTeam {
408
- constructor(club, section, id, club_name, name, section_name) {
409
- this.club = club;
410
- this.section = section;
411
- this.id = id;
412
- this.club_name = club_name;
413
- this.name = name;
414
- this.section_name = section_name;
415
- }
416
- static asFormGroup(team) {
417
- return new FormGroup({
418
- id: new FormControl(team?.id || ''),
419
- name: new FormControl(team?.name || '', Validators.required),
420
- });
421
- }
422
- }
423
-
424
- class BookingCalendar {
425
- constructor(id, club_id, section_id, team_id, club_name, name, section_name, team_name, status, max_application_number, allow_team_export, allow_repeated_bookings, is_default, available_for_teams, bookable_groups) {
426
- this.id = id;
427
- this.club_id = club_id;
428
- this.section_id = section_id;
429
- this.team_id = team_id;
430
- this.club_name = club_name;
431
- this.name = name;
432
- this.section_name = section_name;
433
- this.team_name = team_name;
434
- this.status = status;
435
- this.max_application_number = max_application_number;
436
- this.allow_team_export = allow_team_export;
437
- this.allow_repeated_bookings = allow_repeated_bookings;
438
- this.is_default = is_default;
439
- this.available_for_teams = available_for_teams;
440
- this.bookable_groups = bookable_groups;
441
- }
442
- static asFormGroup(calendar) {
443
- const bookableGroups = [];
444
- const availableForTeams = [];
445
- if (calendar?.bookable_groups) {
446
- calendar.bookable_groups.forEach((bookableGroup) => {
447
- bookableGroups.push(BookableGroup.asFormGroup(bookableGroup));
448
- });
449
- }
450
- if (calendar?.available_for_teams) {
451
- calendar.available_for_teams.forEach((team) => {
452
- availableForTeams.push(SearchTeam.asFormGroup(team));
453
- });
454
- }
455
- return new FormGroup({
456
- id: new FormControl(calendar?.id || ''),
457
- club_id: new FormControl(calendar?.club_id || ''),
458
- section_id: new FormControl(calendar?.section_id || ''),
459
- team_id: new FormControl(calendar?.team_id || ''),
460
- club_name: new FormControl(calendar?.club_name || ''),
461
- name: new FormControl(calendar?.name || '', Validators.required),
462
- section_name: new FormControl(calendar?.section_name || ''),
463
- team_name: new FormControl(calendar?.team_name || ''),
464
- status: new FormControl(calendar?.status || 'preliminary'),
465
- bookable_groups: new FormArray(bookableGroups),
466
- available_for_teams: new FormArray(availableForTeams),
467
- max_application_number: new FormControl(calendar?.max_application_number || 0),
468
- is_default: new FormControl(calendar?.is_default || false),
469
- allow_team_export: new FormControl(calendar?.allow_team_export || false),
470
- allow_repeated_bookings: new FormControl(calendar?.allow_repeated_bookings || false)
471
- });
472
- }
473
- }
474
-
475
- class BookingCalendarApplicationTime {
476
- constructor(id, section_id, slot_id, team_id, title, end_time, section_name, start_time, team_name, applicant_comment, reviewer_comment, status, repeat, activity_type_id, color = null, slot_start_time, slot_end_time, slot_day, slot_number_of_available_sessions, slot_last_repeating_date, created, bookable_zones_taken, bookable_part_id, bookable_part_name, bookable_id, bookable_name) {
477
- this.id = id;
478
- this.section_id = section_id;
479
- this.slot_id = slot_id;
480
- this.team_id = team_id;
481
- this.title = title;
482
- this.end_time = end_time;
483
- this.section_name = section_name;
484
- this.start_time = start_time;
485
- this.team_name = team_name;
486
- this.applicant_comment = applicant_comment;
487
- this.reviewer_comment = reviewer_comment;
488
- this.status = status;
489
- this.repeat = repeat;
490
- this.activity_type_id = activity_type_id;
491
- this.color = color;
492
- this.slot_start_time = slot_start_time;
493
- this.slot_end_time = slot_end_time;
494
- this.slot_day = slot_day;
495
- this.slot_number_of_available_sessions = slot_number_of_available_sessions;
496
- this.slot_last_repeating_date = slot_last_repeating_date;
497
- this.created = created;
498
- this.bookable_zones_taken = bookable_zones_taken;
499
- this.bookable_part_id = bookable_part_id;
500
- this.bookable_part_name = bookable_part_name;
501
- this.bookable_id = bookable_id;
502
- this.bookable_name = bookable_name;
503
- }
504
- static asFormGroup(session) {
505
- return new FormGroup({
506
- id: new FormControl(session?.id || ''),
507
- section_id: new FormControl(session?.section_id || ''),
508
- slot_id: new FormControl(session?.slot_id || '', Validators.required),
509
- team_id: new FormControl(session?.team_id || '', Validators.required),
510
- title: new FormControl(session?.title || '', Validators.required),
511
- end_time: new FormControl(session?.end_time || '', Validators.required),
512
- section_name: new FormControl(session?.section_name || ''),
513
- start_time: new FormControl(session?.start_time || '', Validators.required),
514
- team_name: new FormControl(session?.team_name || ''),
515
- applicant_comment: new FormControl(session?.applicant_comment || null),
516
- reviewer_comment: new FormControl(session?.reviewer_comment || null),
517
- status: new FormControl(session?.status || ''),
518
- repeat: new FormControl(session?.repeat || false),
519
- activity_type_id: new FormControl(session?.activity_type_id || null),
520
- bookable_zones_taken: new FormControl(session?.bookable_zones_taken || 1, [Validators.min(1), Validators.required]),
521
- bookable_part_id: new FormControl(session?.bookable_part_id || ''),
522
- });
523
- }
524
- }
525
-
526
- class BookingCalendarSlot {
527
- constructor(id, calendar_id, calendar_status, color, day, end_time, group_id, number_of_available_sessions, sessions, open_sessions, start_time, type, repeat, update_repeating, update_until_date = null, reserved_time_enabled, repeat_num, repeat_to_day, repeat_type, reserved_time, reserved_time_position, application_times, last_repeating_date, bookable_name, bookable_id) {
528
- this.id = id;
529
- this.calendar_id = calendar_id;
530
- this.calendar_status = calendar_status;
531
- this.color = color;
532
- this.day = day;
533
- this.end_time = end_time;
534
- this.group_id = group_id;
535
- this.number_of_available_sessions = number_of_available_sessions;
536
- this.sessions = sessions;
537
- this.open_sessions = open_sessions;
538
- this.start_time = start_time;
539
- this.type = type;
540
- this.repeat = repeat;
541
- this.update_repeating = update_repeating;
542
- this.update_until_date = update_until_date;
543
- this.reserved_time_enabled = reserved_time_enabled;
544
- this.repeat_num = repeat_num;
545
- this.repeat_to_day = repeat_to_day;
546
- this.repeat_type = repeat_type;
547
- this.reserved_time = reserved_time;
548
- this.reserved_time_position = reserved_time_position;
549
- this.application_times = application_times;
550
- this.last_repeating_date = last_repeating_date;
551
- this.bookable_name = bookable_name;
552
- this.bookable_id = bookable_id;
553
- }
554
- static asFormGroup(slot) {
555
- return new FormGroup({
556
- id: new FormControl(slot?.id || ''),
557
- calendar_id: new FormControl(slot?.calendar_id || '', Validators.required),
558
- day: new FormControl(slot?.day || '', Validators.required),
559
- end_time: new FormControl(slot?.end_time || '', Validators.required),
560
- group_id: new FormControl(slot?.group_id || null, { nonNullable: false }),
561
- number_of_available_sessions: new FormControl(slot?.number_of_available_sessions || 1, [Validators.required, Validators.min(1)]),
562
- start_time: new FormControl(slot?.start_time || '', Validators.required),
563
- type: new FormControl(slot?.type || '', Validators.required),
564
- repeat: new FormControl(slot?.repeat || 'none'),
565
- repeat_num: new FormControl(slot?.repeat_num || 6, Validators.max(24)),
566
- repeat_to_day: new FormControl(slot?.repeat_to_day || ''),
567
- repeat_type: new FormControl(slot?.repeat_type || ''),
568
- update_repeating: new FormControl(!!slot?.update_repeating || false),
569
- update_until_date: new FormControl(null),
570
- reserved_time_enabled: new FormControl(typeof slot?.reserved_time_enabled !== 'undefined' ? slot?.reserved_time_enabled : false),
571
- reserved_time: new FormControl(slot?.reserved_time || '00:00'),
572
- reserved_time_position: new FormControl(slot?.reserved_time_position || ''),
573
- bookable_id: new FormControl(slot?.bookable_id || '', Validators.required),
574
- });
575
- }
576
- }
577
-
578
- class BookingCalendarSlotSession {
579
- constructor(id, section_id, slot_id, team_id, title, end_time, section_name, start_time, team_name, is_overbooked, last_repeating_date, type, slot_index, comment, day, repeat, activity_type_id, color = null, update_repeating, update_until_date = null, bookable_zones_taken, bookable_part_id, bookable_part_name, bookable_name, bookable_id) {
580
- this.id = id;
581
- this.section_id = section_id;
582
- this.slot_id = slot_id;
583
- this.team_id = team_id;
584
- this.title = title;
585
- this.end_time = end_time;
586
- this.section_name = section_name;
587
- this.start_time = start_time;
588
- this.team_name = team_name;
589
- this.is_overbooked = is_overbooked;
590
- this.last_repeating_date = last_repeating_date;
591
- this.type = type;
592
- this.slot_index = slot_index;
593
- this.comment = comment;
594
- this.day = day;
595
- this.repeat = repeat;
596
- this.activity_type_id = activity_type_id;
597
- this.color = color;
598
- this.update_repeating = update_repeating;
599
- this.update_until_date = update_until_date;
600
- this.bookable_zones_taken = bookable_zones_taken;
601
- this.bookable_part_id = bookable_part_id;
602
- this.bookable_part_name = bookable_part_name;
603
- this.bookable_name = bookable_name;
604
- this.bookable_id = bookable_id;
605
- }
606
- static asFormGroup(session) {
607
- return new FormGroup({
608
- id: new FormControl(session?.id || ''),
609
- section_id: new FormControl(session?.section_id || ''),
610
- slot_id: new FormControl(session?.slot_id || '', Validators.required),
611
- team_id: new FormControl(session?.team_id || '', Validators.required),
612
- title: new FormControl(session?.title || '', Validators.required),
613
- end_time: new FormControl(session?.end_time || '', Validators.required),
614
- section_name: new FormControl(session?.section_name || ''),
615
- start_time: new FormControl(session?.start_time || '', Validators.required),
616
- team_name: new FormControl(session?.team_name || ''),
617
- is_overbooked: new FormControl(session?.is_overbooked || false),
618
- last_repeating_date: new FormControl(session?.last_repeating_date || null),
619
- type: new FormControl(session?.type || ''),
620
- comment: new FormControl(session?.comment || ''),
621
- repeat: new FormControl(session?.repeat || false),
622
- activity_type_id: new FormControl(session?.activity_type_id || null),
623
- update_repeating: new FormControl(!!session?.update_repeating || false),
624
- update_until_date: new FormControl(null),
625
- bookable_zones_taken: new FormControl(session?.bookable_zones_taken || 1, [Validators.min(1), Validators.required]),
626
- bookable_part_id: new FormControl(session?.bookable_part_id || ''),
627
- });
628
- }
629
- }
630
-
631
- class BookingSettings {
632
- constructor(id, calendar_step, calendar_min_time, calendar_max_time, calendar_session_duration, should_split_booking_into_zones) {
633
- this.id = id;
634
- this.calendar_step = calendar_step;
635
- this.calendar_min_time = calendar_min_time;
636
- this.calendar_max_time = calendar_max_time;
637
- this.calendar_session_duration = calendar_session_duration;
638
- this.should_split_booking_into_zones = should_split_booking_into_zones;
639
- }
640
- static asFormGroup(settings) {
641
- return new FormGroup({
642
- id: new FormControl(settings?.id || ''),
643
- calendar_step: new FormControl(settings?.calendar_step || '01:00:00', [Validators.required]),
644
- calendar_min_time: new FormControl(settings?.calendar_min_time || '00:00:00', [Validators.required]),
645
- calendar_max_time: new FormControl(settings?.calendar_max_time || '23:00:00', [Validators.required]),
646
- calendar_session_duration: new FormControl(settings?.calendar_session_duration || '01:00:00', [Validators.required]),
647
- should_split_booking_into_zones: new FormControl(typeof settings?.should_split_booking_into_zones !== 'undefined' ? settings?.should_split_booking_into_zones : true, [Validators.required]),
648
- });
649
- }
650
- }
651
-
652
- class Calendar {
653
- constructor(id, club_id, section_id, name, types_to_show) {
654
- this.id = id;
655
- this.club_id = club_id;
656
- this.section_id = section_id;
657
- this.name = name;
658
- this.types_to_show = types_to_show;
659
- }
660
- }
661
-
662
- class CalendarEvent {
663
- constructor(id, calendar, created, day, description, end_time, location, meet_up_place, meet_up_time, meet_up_time_display, push_to_all, sequence, start_time, title, updated) {
664
- this.id = id;
665
- this.calendar = calendar;
666
- this.created = created;
667
- this.day = day;
668
- this.description = description;
669
- this.end_time = end_time;
670
- this.location = location;
671
- this.meet_up_place = meet_up_place;
672
- this.meet_up_time = meet_up_time;
673
- this.meet_up_time_display = meet_up_time_display;
674
- this.push_to_all = push_to_all;
675
- this.sequence = sequence;
676
- this.start_time = start_time;
677
- this.title = title;
678
- this.updated = updated;
679
- }
680
- }
681
-
682
- class Card {
683
- constructor(id, deals_count, header_1, name, logo, theme, ticket_count, use_pdf_version) {
684
- this.id = id;
685
- this.deals_count = deals_count;
686
- this.header_1 = header_1;
687
- this.name = name;
688
- this.logo = logo;
689
- this.theme = theme;
690
- this.ticket_count = ticket_count;
691
- this.use_pdf_version = use_pdf_version;
692
- }
693
- }
694
-
695
- class CardDeal {
696
- constructor(id, partner, text, title, url) {
697
- this.id = id;
698
- this.partner = partner;
699
- this.text = text;
700
- this.title = title;
701
- this.url = url;
702
- }
703
- }
704
-
705
- class CardLogo {
706
- constructor(id, name, urls) {
707
- this.id = id;
708
- this.name = name;
709
- this.urls = urls;
710
- }
711
- }
712
-
713
- class CardLogoUrls {
714
- constructor(lg, md, sm, w16, w32, w64, w180, w192) {
715
- this.lg = lg;
716
- this.md = md;
717
- this.sm = sm;
718
- this.w16 = w16;
719
- this.w32 = w32;
720
- this.w64 = w64;
721
- this.w180 = w180;
722
- this.w192 = w192;
723
- }
724
- }
725
-
726
- class CardMemberTicket {
727
- constructor(id, member_id, ticket_id, member_name, ticket_image_url, ticket_number) {
728
- this.id = id;
729
- this.member_id = member_id;
730
- this.ticket_id = ticket_id;
731
- this.member_name = member_name;
732
- this.ticket_image_url = ticket_image_url;
733
- this.ticket_number = ticket_number;
734
- }
735
- }
736
-
737
- class CardTicket {
738
- constructor(id, activation_end_hours, activation_end_time, activation_start_hours, activation_start_time, away_team, card_member_ticket, description, event_time, home_team, image, location, name, ticket_type, ticket_type_nice, uses_pin) {
739
- this.id = id;
740
- this.activation_end_hours = activation_end_hours;
741
- this.activation_end_time = activation_end_time;
742
- this.activation_start_hours = activation_start_hours;
743
- this.activation_start_time = activation_start_time;
744
- this.away_team = away_team;
745
- this.card_member_ticket = card_member_ticket;
746
- this.description = description;
747
- this.event_time = event_time;
748
- this.home_team = home_team;
749
- this.image = image;
750
- this.location = location;
751
- this.name = name;
752
- this.ticket_type = ticket_type;
753
- this.ticket_type_nice = ticket_type_nice;
754
- this.uses_pin = uses_pin;
755
- }
756
- }
757
-
758
- class CardTicketLocation {
759
- constructor(id, club_id, section_id, location) {
760
- this.id = id;
761
- this.club_id = club_id;
762
- this.section_id = section_id;
763
- this.location = location;
764
- }
765
- }
766
-
767
- class CardTheme {
768
- constructor(id, background_color, background_image_urls, name, text_color) {
769
- this.id = id;
770
- this.background_color = background_color;
771
- this.background_image_urls = background_image_urls;
772
- this.name = name;
773
- this.text_color = text_color;
774
- }
775
- }
776
-
777
- class HomeTeam {
778
- constructor(id, logo, name) {
779
- this.id = id;
780
- this.logo = logo;
781
- this.name = name;
782
- }
783
- }
784
-
785
- class MemberCard {
786
- constructor(id, card, header_2, member_name, membership_text, name, pdf_url, qr_code, qr_code_enabled) {
787
- this.id = id;
788
- this.card = card;
789
- this.header_2 = header_2;
790
- this.member_name = member_name;
791
- this.membership_text = membership_text;
792
- this.name = name;
793
- this.pdf_url = pdf_url;
794
- this.qr_code = qr_code;
795
- this.qr_code_enabled = qr_code_enabled;
796
- }
797
- }
798
-
799
- class SearchMemberCard {
800
- constructor(id, name, notification_count, pdf_url) {
801
- this.id = id;
802
- this.name = name;
803
- this.notification_count = notification_count;
804
- this.pdf_url = pdf_url;
805
- }
806
- }
807
-
808
- class Club {
809
- constructor(id, name) {
810
- this.id = id;
811
- this.name = name;
812
- }
813
- }
814
-
815
- class ClubImage {
816
- constructor(clubId, sectionId, comment, created, image, imageSmPath, imageLgPath, inUse, isLogo, originalHeight, originalWidth, title, updated) {
817
- this.clubId = clubId;
818
- this.sectionId = sectionId;
819
- this.comment = comment;
820
- this.created = created;
821
- this.image = image;
822
- this.imageSmPath = imageSmPath;
823
- this.imageLgPath = imageLgPath;
824
- this.inUse = inUse;
825
- this.isLogo = isLogo;
826
- this.originalHeight = originalHeight;
827
- this.originalWidth = originalWidth;
828
- this.title = title;
829
- this.updated = updated;
830
- }
831
- }
832
-
833
- class ClubSection {
834
- constructor(id, name) {
835
- this.id = id;
836
- this.name = name;
837
- }
838
- }
839
-
840
- class Collection {
841
- constructor(count, next, previous, resources) {
842
- this.count = count;
843
- this.next = next;
844
- this.previous = previous;
845
- this.resources = resources;
846
- }
847
- [Symbol.iterator]() {
848
- return this.resources.values();
849
- }
850
- toArray() {
851
- return this.resources;
852
- }
853
- }
854
-
855
- class Contact {
856
- constructor(id, club_id, member_id, address1, address2, address3, country, district, email, first_name, home_phone, last_name, mobile_phone, work_phone, zip) {
857
- this.id = id;
858
- this.club_id = club_id;
859
- this.member_id = member_id;
860
- this.address1 = address1;
861
- this.address2 = address2;
862
- this.address3 = address3;
863
- this.country = country;
864
- this.district = district;
865
- this.email = email;
866
- this.first_name = first_name;
867
- this.home_phone = home_phone;
868
- this.last_name = last_name;
869
- this.mobile_phone = mobile_phone;
870
- this.work_phone = work_phone;
871
- this.zip = zip;
872
- }
873
- static asFormGroup(contact) {
874
- return new FormGroup({
875
- id: new FormControl(contact?.id || ''),
876
- club_id: new FormControl(contact?.club_id || ''),
877
- member_id: new FormControl(contact?.member_id || ''),
878
- address1: new FormControl(contact?.address1 || ''),
879
- address2: new FormControl(contact?.address2 || ''),
880
- address3: new FormControl(contact?.address3 || ''),
881
- country: new FormControl(contact?.country || ''),
882
- district: new FormControl(contact?.district || ''),
883
- email: new FormControl(contact?.email || '', Validators.email),
884
- first_name: new FormControl(contact?.first_name || '', Validators.required),
885
- home_phone: new FormControl(contact?.home_phone || ''),
886
- last_name: new FormControl(contact?.last_name || '', Validators.required),
887
- mobile_phone: new FormControl(contact?.mobile_phone || ''),
888
- work_phone: new FormControl(contact?.work_phone || ''),
889
- zip: new FormControl(contact?.zip || '')
890
- });
891
- }
892
- get name() {
893
- if (this.first_name) {
894
- return [this.first_name, this.last_name].join(' ');
895
- }
896
- return this.email;
897
- }
898
- }
899
-
900
- class Directory {
901
- constructor(id, club_id, section_id, team_id, created, files, name, location_name, updated) {
902
- this.id = id;
903
- this.club_id = club_id;
904
- this.section_id = section_id;
905
- this.team_id = team_id;
906
- this.created = created;
907
- this.files = files;
908
- this.name = name;
909
- this.location_name = location_name;
910
- this.updated = updated;
911
- }
912
- belongsToTeam(teamId = null) {
913
- if (teamId) {
914
- return this.team_id === teamId;
915
- }
916
- return this.team_id !== null;
917
- }
918
- belongsToSection(sectionId = null) {
919
- if (sectionId) {
920
- return this.section_id === sectionId;
921
- }
922
- return this.section_id !== null;
923
- }
924
- }
925
-
926
- class Email {
927
- constructor(body, subject, recipients = []) {
928
- this.body = body;
929
- this.subject = subject;
930
- this.recipients = recipients;
931
- }
932
- }
933
-
934
- class Event {
935
- constructor(id, activity_id, activity_type, base_background_color, base_color, base_name, calendar_name, description, end, invitation_id, invitation_response, invited_members, location, meet_up_place, meet_up_time, member_id, open_activity, participants, start, title, type) {
936
- this.id = id;
937
- this.activity_id = activity_id;
938
- this.activity_type = activity_type;
939
- this.base_background_color = base_background_color;
940
- this.base_color = base_color;
941
- this.base_name = base_name;
942
- this.calendar_name = calendar_name;
943
- this.description = description;
944
- this.end = end;
945
- this.invitation_id = invitation_id;
946
- this.invitation_response = invitation_response;
947
- this.invited_members = invited_members;
948
- this.location = location;
949
- this.meet_up_place = meet_up_place;
950
- this.meet_up_time = meet_up_time;
951
- this.member_id = member_id;
952
- this.open_activity = open_activity;
953
- this.participants = participants;
954
- this.start = start;
955
- this.title = title;
956
- this.type = type;
957
- }
958
- }
959
-
960
- class ExternalLink {
961
- constructor(text, value) {
962
- this.text = text;
963
- this.value = value;
964
- }
965
- }
966
-
967
- class FileObject {
968
- constructor(id, created, file, member, name, section, team, updated, url) {
969
- this.id = id;
970
- this.created = created;
971
- this.file = file;
972
- this.member = member;
973
- this.name = name;
974
- this.section = section;
975
- this.team = team;
976
- this.updated = updated;
977
- this.url = url;
978
- }
979
- }
980
-
981
- class GeneralImage {
982
- constructor(id, name, urls) {
983
- this.id = id;
984
- this.name = name;
985
- this.urls = urls;
986
- }
987
- }
988
-
989
- class GroupRole {
990
- constructor(id, club_id, section_id, created, name, updated) {
991
- this.id = id;
992
- this.club_id = club_id;
993
- this.section_id = section_id;
994
- this.created = created;
995
- this.name = name;
996
- this.updated = updated;
997
- }
998
- }
999
-
1000
- class ImageUrls {
1001
- constructor(lg, md, raw, sm, xs) {
1002
- this.lg = lg;
1003
- this.md = md;
1004
- this.raw = raw;
1005
- this.sm = sm;
1006
- this.xs = xs;
1007
- }
1008
- }
1009
-
1010
- class MemberFee {
1011
- constructor(id, clubId, sectionId, name) {
1012
- this.id = id;
1013
- this.clubId = clubId;
1014
- this.sectionId = sectionId;
1015
- this.name = name;
1016
- }
1017
- }
1018
-
1019
- class MemberInvoice {
1020
- constructor(id, amount, amountPaid, balance, clubBillId, clubName, creditCard, datePaid, dueDate, giro, invoiceRows, invoiceText, isPaid, memberId, organisationName, payee, paymentUrl, reference, swish, zimpler) {
1021
- this.id = id;
1022
- this.amount = amount;
1023
- this.amountPaid = amountPaid;
1024
- this.balance = balance;
1025
- this.clubBillId = clubBillId;
1026
- this.clubName = clubName;
1027
- this.creditCard = creditCard;
1028
- this.datePaid = datePaid;
1029
- this.dueDate = dueDate;
1030
- this.giro = giro;
1031
- this.invoiceRows = invoiceRows;
1032
- this.invoiceText = invoiceText;
1033
- this.isPaid = isPaid;
1034
- this.memberId = memberId;
1035
- this.organisationName = organisationName;
1036
- this.payee = payee;
1037
- this.paymentUrl = paymentUrl;
1038
- this.reference = reference;
1039
- this.swish = swish;
1040
- this.zimpler = zimpler;
1041
- }
1042
- }
1043
-
1044
- class MemberInvoiceRow {
1045
- constructor(id, amount, amountPaid, balance, created, datePaid, fee, hasCreditType, invoice, isCredit, isPaid, text, updated) {
1046
- this.id = id;
1047
- this.amount = amount;
1048
- this.amountPaid = amountPaid;
1049
- this.balance = balance;
1050
- this.created = created;
1051
- this.datePaid = datePaid;
1052
- this.fee = fee;
1053
- this.hasCreditType = hasCreditType;
1054
- this.invoice = invoice;
1055
- this.isCredit = isCredit;
1056
- this.isPaid = isPaid;
1057
- this.text = text;
1058
- this.updated = updated;
1059
- }
1060
- }
1061
-
1062
- class PaymentAttempt {
1063
- constructor(id, amount, error, invoiceId, paidDate, paymentData, status, type) {
1064
- this.id = id;
1065
- this.amount = amount;
1066
- this.error = error;
1067
- this.invoiceId = invoiceId;
1068
- this.paidDate = paidDate;
1069
- this.paymentData = paymentData;
1070
- this.status = status;
1071
- this.type = type;
1072
- }
1073
- }
1074
-
1075
- class CreditCard {
1076
- constructor(clubId, sectionId, defaultActivated, merchantId, name, paymentTermsName, paymentTermsOrganisationId, paymentTermsUrl, rsaKey, status, testAccount) {
1077
- this.clubId = clubId;
1078
- this.sectionId = sectionId;
1079
- this.defaultActivated = defaultActivated;
1080
- this.merchantId = merchantId;
1081
- this.name = name;
1082
- this.paymentTermsName = paymentTermsName;
1083
- this.paymentTermsOrganisationId = paymentTermsOrganisationId;
1084
- this.paymentTermsUrl = paymentTermsUrl;
1085
- this.rsaKey = rsaKey;
1086
- this.status = status;
1087
- this.testAccount = testAccount;
1088
- }
1089
- }
1090
-
1091
- class Giro {
1092
- constructor(clubId, sectionId, giroType, name, number, ocr) {
1093
- this.clubId = clubId;
1094
- this.sectionId = sectionId;
1095
- this.giroType = giroType;
1096
- this.name = name;
1097
- this.number = number;
1098
- this.ocr = ocr;
1099
- }
1100
- }
1101
-
1102
- class Swish {
1103
- constructor(clubId, sectionId, certificateValidUntil, defaultActivated, name, paymentTermsName, paymentTermsOrganisationId, paymentTermsUrl, status, swishPayeeAlias, testAccount, usePaymentTerms, usesMyClubCertificate) {
1104
- this.clubId = clubId;
1105
- this.sectionId = sectionId;
1106
- this.certificateValidUntil = certificateValidUntil;
1107
- this.defaultActivated = defaultActivated;
1108
- this.name = name;
1109
- this.paymentTermsName = paymentTermsName;
1110
- this.paymentTermsOrganisationId = paymentTermsOrganisationId;
1111
- this.paymentTermsUrl = paymentTermsUrl;
1112
- this.status = status;
1113
- this.swishPayeeAlias = swishPayeeAlias;
1114
- this.testAccount = testAccount;
1115
- this.usePaymentTerms = usePaymentTerms;
1116
- this.usesMyClubCertificate = usesMyClubCertificate;
1117
- }
1118
- }
1119
-
1120
- class Zimpler {
1121
- constructor(clubId, sectionId, defaultActivated, merchantId, name, status, testAccount) {
1122
- this.clubId = clubId;
1123
- this.sectionId = sectionId;
1124
- this.defaultActivated = defaultActivated;
1125
- this.merchantId = merchantId;
1126
- this.name = name;
1127
- this.status = status;
1128
- this.testAccount = testAccount;
1129
- }
1130
- }
1131
-
1132
- class SearchMemberInvoice {
1133
- constructor(id, amount, amountPaid, balance, clubBillId, datePaid, dueDate, isPaid, member) {
1134
- this.id = id;
1135
- this.amount = amount;
1136
- this.amountPaid = amountPaid;
1137
- this.balance = balance;
1138
- this.clubBillId = clubBillId;
1139
- this.datePaid = datePaid;
1140
- this.dueDate = dueDate;
1141
- this.isPaid = isPaid;
1142
- this.member = member;
1143
- }
1144
- is_due() {
1145
- return new Date().toISOString() > this.dueDate;
1146
- }
1147
- }
1148
-
1149
- class SwishQrCode {
1150
- constructor(qrCode) {
1151
- this.qrCode = qrCode;
1152
- }
1153
- }
1154
-
1155
- class UnpaidMemberInvoice {
1156
- constructor(id, club_bill_id, member_id, token) {
1157
- this.id = id;
1158
- this.club_bill_id = club_bill_id;
1159
- this.member_id = member_id;
1160
- this.token = token;
1161
- }
1162
- }
1163
-
1164
- class Member {
1165
- constructor(id, club_id, address1, address2, address_field, attributes, birth_date, calendar_url, comment, contacts, country, created, district, email, first_name, functions, home_phone, image, last_name, mobile_phone, public_member_id, sex, updated, validation_settings, work_phone, zip) {
1166
- this.id = id;
1167
- this.club_id = club_id;
1168
- this.address1 = address1;
1169
- this.address2 = address2;
1170
- this.address_field = address_field;
1171
- this.attributes = attributes;
1172
- this.birth_date = birth_date;
1173
- this.calendar_url = calendar_url;
1174
- this.comment = comment;
1175
- this.contacts = contacts;
1176
- this.country = country;
1177
- this.created = created;
1178
- this.district = district;
1179
- this.email = email;
1180
- this.first_name = first_name;
1181
- this.functions = functions;
1182
- this.home_phone = home_phone;
1183
- this.image = image;
1184
- this.last_name = last_name;
1185
- this.mobile_phone = mobile_phone;
1186
- this.public_member_id = public_member_id;
1187
- this.sex = sex;
1188
- this.updated = updated;
1189
- this.validation_settings = validation_settings;
1190
- this.work_phone = work_phone;
1191
- this.zip = zip;
1192
- }
1193
- static asFormGroup(member = null) {
1194
- const attributes = [];
1195
- const contacts = [];
1196
- const functions = [];
1197
- if (member?.attributes) {
1198
- member.attributes.forEach((attribute) => attributes.push(MemberAttribute.asFormGroup(attribute)));
1199
- }
1200
- if (member?.contacts) {
1201
- member.contacts.forEach((memberContact) => contacts.push(MemberContact.asFormGroup(memberContact)));
1202
- }
1203
- if (member?.functions) {
1204
- member.functions.forEach((memberFunction) => functions.push(MemberFunction.asFormGroup(memberFunction)));
1205
- }
1206
- return new FormGroup({
1207
- id: new FormControl(member?.id || ''),
1208
- club_id: new FormControl(member?.club_id || ''),
1209
- address1: new FormControl(member?.address1 || ''),
1210
- address2: new FormControl(member?.address2 || ''),
1211
- attributes: new FormArray(attributes),
1212
- birth_date: new FormControl(member?.birth_date || ''),
1213
- comment: new FormControl(member?.comment || ''),
1214
- contacts: new FormArray(contacts),
1215
- country: new FormControl(member?.country || ''),
1216
- district: new FormControl(member?.district || ''),
1217
- email: new FormControl(member?.email || '', Validators.email),
1218
- first_name: new FormControl(member?.first_name || '', Validators.required),
1219
- functions: new FormArray(functions),
1220
- home_phone: new FormControl(member?.home_phone || ''),
1221
- last_name: new FormControl(member?.last_name || '', Validators.required),
1222
- mobile_phone: new FormControl(member?.mobile_phone || ''),
1223
- public_member_id: new FormControl(member?.public_member_id || 0),
1224
- sex: new FormControl(member?.sex || ''),
1225
- work_phone: new FormControl(member?.work_phone || ''),
1226
- zip: new FormControl(member?.zip || '')
1227
- });
1228
- }
1229
- get name() {
1230
- if (this.first_name) {
1231
- return [this.first_name, this.last_name].join(' ');
1232
- }
1233
- return this.email;
1234
- }
1235
- }
1236
-
1237
- class MemberAttribute {
1238
- constructor(display_value, field_id, leader_editable, member_id, member_editable, name, options, order, section_id, type, value) {
1239
- this.display_value = display_value;
1240
- this.field_id = field_id;
1241
- this.leader_editable = leader_editable;
1242
- this.member_id = member_id;
1243
- this.member_editable = member_editable;
1244
- this.name = name;
1245
- this.options = options;
1246
- this.order = order;
1247
- this.section_id = section_id;
1248
- this.type = type;
1249
- this.value = value;
1250
- }
1251
- static asFormGroup(attribute = null) {
1252
- const attributeOptions = new FormArray(attribute?.options?.map((option) => new FormGroup({
1253
- text: new FormControl(option.text),
1254
- value: new FormControl(option.value)
1255
- })) || []);
1256
- return new FormGroup({
1257
- field_id: new FormControl(attribute?.field_id || ''),
1258
- member_id: new FormControl(attribute?.member_id || ''),
1259
- leader_editable: new FormControl(attribute?.leader_editable || false),
1260
- member_editable: new FormControl(attribute?.member_editable || false),
1261
- name: new FormControl(attribute?.name || ''),
1262
- options: attributeOptions,
1263
- type: new FormControl(attribute?.type || 'text'),
1264
- value: new FormControl(attribute?.type === 'bool' ? attribute?.value : (attribute?.type === 'date' ? attribute?.value || undefined : attribute?.value || ''))
1265
- });
1266
- }
1267
- }
1268
-
1269
- class MemberContact {
1270
- constructor(id, club_id, member_id, contact, contact_type) {
1271
- this.id = id;
1272
- this.club_id = club_id;
1273
- this.member_id = member_id;
1274
- this.contact = contact;
1275
- this.contact_type = contact_type;
1276
- }
1277
- static asFormGroup(memberContact) {
1278
- return new FormGroup({
1279
- id: new FormControl(memberContact?.id || ''),
1280
- club_id: new FormControl(memberContact?.club_id || ''),
1281
- member_id: new FormControl(memberContact?.member_id || ''),
1282
- contact: Contact.asFormGroup(memberContact?.contact),
1283
- contact_type: new FormControl(memberContact?.contact_type || '')
1284
- });
1285
- }
1286
- }
1287
-
1288
- class MemberFunction {
1289
- constructor(id, comment, end_date, name, start_date) {
1290
- this.id = id;
1291
- this.comment = comment;
1292
- this.end_date = end_date;
1293
- this.name = name;
1294
- this.start_date = start_date;
1295
- }
1296
- static asFormGroup(memberFunction = null) {
1297
- return new FormGroup({
1298
- id: new FormControl(memberFunction?.id || ''),
1299
- comment: new FormControl(memberFunction?.comment || ''),
1300
- start_date: new FormControl(memberFunction?.start_date || ''),
1301
- end_date: new FormControl(memberFunction?.end_date || ''),
1302
- });
1303
- }
1304
- }
1305
-
1306
- class MemberValidationSettings {
1307
- constructor(address, birth_date, district, email, home_phone, mobile_phone, work_phone, zip) {
1308
- this.address = address;
1309
- this.birth_date = birth_date;
1310
- this.district = district;
1311
- this.email = email;
1312
- this.home_phone = home_phone;
1313
- this.mobile_phone = mobile_phone;
1314
- this.work_phone = work_phone;
1315
- this.zip = zip;
1316
- }
1317
- }
1318
-
1319
- class OtherMember {
1320
- constructor(id, country, created, firstName, image, lastName, name, fields) {
1321
- this.id = id;
1322
- this.country = country;
1323
- this.created = created;
1324
- this.firstName = firstName;
1325
- this.image = image;
1326
- this.lastName = lastName;
1327
- this.name = name;
1328
- this.fields = fields;
1329
- }
1330
- }
1331
-
1332
- class OtherMemberField {
1333
- constructor(displayName, fieldName, value) {
1334
- this.displayName = displayName;
1335
- this.fieldName = fieldName;
1336
- this.value = value;
1337
- }
1338
- }
1339
-
1340
- class SearchMember {
1341
- constructor(id, club_id, team_id, address1, address2, calendar_url, country, district, email, first_name, image, last_name, mobile_phone, name, zip) {
1342
- this.id = id;
1343
- this.club_id = club_id;
1344
- this.team_id = team_id;
1345
- this.address1 = address1;
1346
- this.address2 = address2;
1347
- this.calendar_url = calendar_url;
1348
- this.country = country;
1349
- this.district = district;
1350
- this.email = email;
1351
- this.first_name = first_name;
1352
- this.image = image;
1353
- this.last_name = last_name;
1354
- this.mobile_phone = mobile_phone;
1355
- this.name = name;
1356
- this.zip = zip;
1357
- }
1358
- }
1359
-
1360
- class MemberActivityInvite {
1361
- constructor(id, comment, current_num_attendants, last_invite, leader, member_email, member_id, member_name, next_invite, response_date, status) {
1362
- this.id = id;
1363
- this.comment = comment;
1364
- this.current_num_attendants = current_num_attendants;
1365
- this.last_invite = last_invite;
1366
- this.leader = leader;
1367
- this.member_email = member_email;
1368
- this.member_id = member_id;
1369
- this.member_name = member_name;
1370
- this.next_invite = next_invite;
1371
- this.response_date = response_date;
1372
- this.status = status;
1373
- }
1374
- getColorByStatus() {
1375
- let color = 'none';
1376
- switch (this.status) {
1377
- case 'accepted':
1378
- color = 'myclub-accepted';
1379
- break;
1380
- case 'denied':
1381
- color = 'myclub-denied';
1382
- break;
1383
- case 'maybe':
1384
- color = 'myclub-maybe';
1385
- break;
1386
- }
1387
- return color;
1388
- }
1389
- }
1390
-
1391
- class MemberPublicForm {
1392
- constructor(id, active_form, active_to, userToken, comment, dataprotection_policy_choice, dataprotection_policy_url, fields, full_text, has_nationality_field, max_members_per_team, max_registered_in_form_total, member_fields, member_types, member_type_help_text, name, num_chars_birth_date, num_registered, registered, register_family, role_help_text, roles, team_help_text, teams, url) {
1393
- this.id = id;
1394
- this.active_form = active_form;
1395
- this.active_to = active_to;
1396
- this.userToken = userToken;
1397
- this.comment = comment;
1398
- this.dataprotection_policy_choice = dataprotection_policy_choice;
1399
- this.dataprotection_policy_url = dataprotection_policy_url;
1400
- this.fields = fields;
1401
- this.full_text = full_text;
1402
- this.has_nationality_field = has_nationality_field;
1403
- this.max_members_per_team = max_members_per_team;
1404
- this.max_registered_in_form_total = max_registered_in_form_total;
1405
- this.member_fields = member_fields;
1406
- this.member_types = member_types;
1407
- this.member_type_help_text = member_type_help_text;
1408
- this.name = name;
1409
- this.num_chars_birth_date = num_chars_birth_date;
1410
- this.num_registered = num_registered;
1411
- this.registered = registered;
1412
- this.register_family = register_family;
1413
- this.role_help_text = role_help_text;
1414
- this.roles = roles;
1415
- this.team_help_text = team_help_text;
1416
- this.teams = teams;
1417
- this.url = url;
1418
- }
1419
- }
1420
-
1421
- class MemberPublicFormField {
1422
- constructor(all_choice_options, divider, familys, field_id, field_name, field_order, header, help_text, required, type, value) {
1423
- this.all_choice_options = all_choice_options;
1424
- this.divider = divider;
1425
- this.familys = familys;
1426
- this.field_id = field_id;
1427
- this.field_name = field_name;
1428
- this.field_order = field_order;
1429
- this.header = header;
1430
- this.help_text = help_text;
1431
- this.required = required;
1432
- this.type = type;
1433
- this.value = value;
1434
- }
1435
- }
1436
-
1437
- class MemberPublicFormFieldOption {
1438
- constructor(id, name, selected, defaultValue) {
1439
- this.id = id;
1440
- this.name = name;
1441
- this.selected = selected;
1442
- this.defaultValue = defaultValue;
1443
- }
1444
- }
1445
-
1446
- class MemberTeam {
1447
- constructor(club, section, id, email, has_extra_members, name, phone, section_name) {
1448
- this.club = club;
1449
- this.section = section;
1450
- this.id = id;
1451
- this.email = email;
1452
- this.has_extra_members = has_extra_members;
1453
- this.name = name;
1454
- this.phone = phone;
1455
- this.section_name = section_name;
1456
- }
1457
- }
1458
-
1459
- class MemberTeamThrough {
1460
- constructor(id, created, dateHidden, image, leader, member, roleId, showOnWeb, updated) {
1461
- this.id = id;
1462
- this.created = created;
1463
- this.dateHidden = dateHidden;
1464
- this.image = image;
1465
- this.leader = leader;
1466
- this.member = member;
1467
- this.roleId = roleId;
1468
- this.showOnWeb = showOnWeb;
1469
- this.updated = updated;
1470
- }
1471
- }
1472
-
1473
- class MemberType {
1474
- constructor(id, club_id, name) {
1475
- this.id = id;
1476
- this.club_id = club_id;
1477
- this.name = name;
1478
- }
1479
- }
1480
-
1481
- class News {
1482
- constructor(id, club_id, created, created_by_id, section_id, team_id, active_to, author, ingress, news_image, news_image_text, published_date, read, show_on_my_pages, show_on_webpage, text, title, updated, urls) {
1483
- this.id = id;
1484
- this.club_id = club_id;
1485
- this.created = created;
1486
- this.created_by_id = created_by_id;
1487
- this.section_id = section_id;
1488
- this.team_id = team_id;
1489
- this.active_to = active_to;
1490
- this.author = author;
1491
- this.ingress = ingress;
1492
- this.news_image = news_image;
1493
- this.news_image_text = news_image_text;
1494
- this.published_date = published_date;
1495
- this.read = read;
1496
- this.show_on_my_pages = show_on_my_pages;
1497
- this.show_on_webpage = show_on_webpage;
1498
- this.text = text;
1499
- this.title = title;
1500
- this.updated = updated;
1501
- this.urls = urls;
1502
- }
1503
- static asFormGroup(news = null) {
1504
- let show_on_my_pages = false;
1505
- let show_on_webpage = false;
1506
- if (typeof news?.show_on_my_pages !== 'undefined') {
1507
- show_on_my_pages = news.show_on_my_pages;
1508
- }
1509
- if (typeof news?.show_on_webpage !== 'undefined') {
1510
- show_on_webpage = news.show_on_webpage;
1511
- }
1512
- return new FormGroup({
1513
- id: new FormControl(news?.id || ''),
1514
- active_to: new FormControl(news?.active_to || undefined),
1515
- ingress: new FormControl(news?.ingress || '', [Validators.required, Validators.minLength(1)]),
1516
- news_image: new FormControl(news?.news_image || ''),
1517
- news_image_text: new FormControl(news?.news_image_text || ''),
1518
- published_date: new FormControl(news?.published_date || undefined),
1519
- show_on_my_pages: new FormControl(show_on_my_pages),
1520
- show_on_webpage: new FormControl(show_on_webpage),
1521
- text: new FormControl(news?.text || '', [Validators.required, Validators.minLength(1)]),
1522
- title: new FormControl(news?.title || '', [Validators.required, Validators.minLength(1)])
1523
- });
1524
- }
1525
- }
1526
-
1527
- class OpenActivity {
1528
- constructor(id, activity_group_id, activity_type_id, club_id, location_id, member_id, team_id, activity_location, activity_type_name, allow_maybe, calendar_name, created, current_num_attendants, day, default_fee, description, end, end_time, file, invitation_text, invite_first_days, invite_groups, invite_hide_before_sent, invite_last_response_date, invite_remind, invite_remind_receivers, invite_second_days, invite_settings, invited_members, last_response_date, location_name, max_num_attendants, max_num_attendants_type, meet_up_place, meet_up_time, meet_up_time_display, meet_up_time_show, member_invoice, member_name, open_activity, optional_fees, optional_fee_required, optional_fee_type, repeat, repeat_num, repeat_to_day, repeat_type, show_other_invited, start, start_time, status, title, updated, use_invite, update_repeating) {
1529
- this.id = id;
1530
- this.activity_group_id = activity_group_id;
1531
- this.activity_type_id = activity_type_id;
1532
- this.club_id = club_id;
1533
- this.location_id = location_id;
1534
- this.member_id = member_id;
1535
- this.team_id = team_id;
1536
- this.activity_location = activity_location;
1537
- this.activity_type_name = activity_type_name;
1538
- this.allow_maybe = allow_maybe;
1539
- this.calendar_name = calendar_name;
1540
- this.created = created;
1541
- this.current_num_attendants = current_num_attendants;
1542
- this.day = day;
1543
- this.default_fee = default_fee;
1544
- this.description = description;
1545
- this.end = end;
1546
- this.end_time = end_time;
1547
- this.file = file;
1548
- this.invitation_text = invitation_text;
1549
- this.invite_first_days = invite_first_days;
1550
- this.invite_groups = invite_groups;
1551
- this.invite_hide_before_sent = invite_hide_before_sent;
1552
- this.invite_last_response_date = invite_last_response_date;
1553
- this.invite_remind = invite_remind;
1554
- this.invite_remind_receivers = invite_remind_receivers;
1555
- this.invite_second_days = invite_second_days;
1556
- this.invite_settings = invite_settings;
1557
- this.invited_members = invited_members;
1558
- this.last_response_date = last_response_date;
1559
- this.location_name = location_name;
1560
- this.max_num_attendants = max_num_attendants;
1561
- this.max_num_attendants_type = max_num_attendants_type;
1562
- this.meet_up_place = meet_up_place;
1563
- this.meet_up_time = meet_up_time;
1564
- this.meet_up_time_display = meet_up_time_display;
1565
- this.meet_up_time_show = meet_up_time_show;
1566
- this.member_invoice = member_invoice;
1567
- this.member_name = member_name;
1568
- this.open_activity = open_activity;
1569
- this.optional_fees = optional_fees;
1570
- this.optional_fee_required = optional_fee_required;
1571
- this.optional_fee_type = optional_fee_type;
1572
- this.repeat = repeat;
1573
- this.repeat_num = repeat_num;
1574
- this.repeat_to_day = repeat_to_day;
1575
- this.repeat_type = repeat_type;
1576
- this.show_other_invited = show_other_invited;
1577
- this.start = start;
1578
- this.start_time = start_time;
1579
- this.status = status;
1580
- this.title = title;
1581
- this.updated = updated;
1582
- this.use_invite = use_invite;
1583
- this.update_repeating = update_repeating;
1584
- this.qr_code = null;
1585
- this.qr_code_enabled = false;
1586
- }
1587
- }
1588
-
1589
- class OptionalFee {
1590
- constructor(id, activity_id, fee_id, amount, text) {
1591
- this.id = id;
1592
- this.activity_id = activity_id;
1593
- this.fee_id = fee_id;
1594
- this.amount = amount;
1595
- this.text = text;
1596
- this.checked = false;
1597
- }
1598
- }
1599
-
1600
- class OverbookedBookableItem {
1601
- constructor(start_time, end_time, day, bookable_name, session_names) {
1602
- this.start_time = start_time;
1603
- this.end_time = end_time;
1604
- this.day = day;
1605
- this.bookable_name = bookable_name;
1606
- this.session_names = session_names;
1607
- }
1608
- }
1609
-
1610
- class OverbookedLocation {
1611
- constructor(start_time, end_time, day, location_name, session_names) {
1612
- this.start_time = start_time;
1613
- this.end_time = end_time;
1614
- this.day = day;
1615
- this.location_name = location_name;
1616
- this.session_names = session_names;
1617
- }
1618
- }
1619
-
1620
- class Partner {
1621
- constructor(id, image, name, url) {
1622
- this.id = id;
1623
- this.image = image;
1624
- this.name = name;
1625
- this.url = url;
1626
- }
1627
- }
1628
-
1629
- class PublicAuthentication {
1630
- constructor(token, tokenExpires) {
1631
- this.token = token;
1632
- this.tokenExpires = tokenExpires;
1633
- }
1634
- }
1635
-
1636
- class RegistrationQRCode {
1637
- constructor(id, club_id, section_id, display_text, is_active, name, successful_text) {
1638
- this.id = id;
1639
- this.club_id = club_id;
1640
- this.section_id = section_id;
1641
- this.display_text = display_text;
1642
- this.is_active = is_active;
1643
- this.name = name;
1644
- this.successful_text = successful_text;
1645
- }
1646
- }
1647
-
1648
- var Role;
1649
- (function (Role) {
1650
- Role[Role["ClubAdmin"] = 0] = "ClubAdmin";
1651
- Role[Role["SectionAdmin"] = 1] = "SectionAdmin";
1652
- Role[Role["TeamAdmin"] = 2] = "TeamAdmin";
1653
- Role[Role["MemberAdmin"] = 3] = "MemberAdmin";
1654
- Role[Role["Public"] = 4] = "Public";
1655
- Role[Role["None"] = 5] = "None";
1656
- })(Role || (Role = {}));
1657
-
1658
- class SearchClub {
1659
- constructor(id, leader_member_search, member_search, member_view, name, open_activities, open_activities_name, open_activities_search_type, qr_codes_enabled) {
1660
- this.id = id;
1661
- this.leader_member_search = leader_member_search;
1662
- this.member_search = member_search;
1663
- this.member_view = member_view;
1664
- this.name = name;
1665
- this.open_activities = open_activities;
1666
- this.open_activities_name = open_activities_name;
1667
- this.open_activities_search_type = open_activities_search_type;
1668
- this.qr_codes_enabled = qr_codes_enabled;
1669
- }
1670
- }
1671
-
1672
- class Section {
1673
- constructor(id, name) {
1674
- this.id = id;
1675
- this.name = name;
1676
- }
1677
- }
1678
-
1679
- class Token {
1680
- constructor(accessToken, refreshToken, grantType = null) {
1681
- this.accessToken = accessToken;
1682
- this.refreshToken = refreshToken;
1683
- this.grantType = grantType;
1684
- }
1685
- }
1686
-
1687
- class User {
1688
- constructor(deviceToken, email, firstName, isStaff, language, lastName, newEmail, newPassword = '', verifyPassword = '', password = '') {
1689
- this.deviceToken = deviceToken;
1690
- this.email = email;
1691
- this.firstName = firstName;
1692
- this.isStaff = isStaff;
1693
- this.language = language;
1694
- this.lastName = lastName;
1695
- this.newEmail = newEmail;
1696
- this.newPassword = newPassword;
1697
- this.verifyPassword = verifyPassword;
1698
- this.password = password;
1699
- }
1700
- static asFormGroup(user = null) {
1701
- return new FormGroup({
1702
- email: new FormControl(user?.email || '', [Validators.required, Validators.email]),
1703
- firstName: new FormControl(user?.firstName || ''),
1704
- language: new FormControl(user?.language || 'sv'),
1705
- lastName: new FormControl(user?.lastName || ''),
1706
- newEmail: new FormControl(user?.newEmail || ''),
1707
- newPassword: new FormControl(''),
1708
- verifyPassword: new FormControl(''),
1709
- password: new FormControl('')
1710
- });
1711
- }
1712
- name() {
1713
- return `${this.firstName} ${this.lastName}`;
1714
- }
1715
- }
1716
-
1717
- class UserNotification {
1718
- constructor(id, club_id, member_id, object_id, created, message, title, type) {
1719
- this.id = id;
1720
- this.club_id = club_id;
1721
- this.member_id = member_id;
1722
- this.object_id = object_id;
1723
- this.created = created;
1724
- this.message = message;
1725
- this.title = title;
1726
- this.type = type;
1727
- }
1728
- }
1729
-
1730
- const searchMemberFactory = (apiSearchMember) => new SearchMember(apiSearchMember.id, apiSearchMember.club_id, apiSearchMember.team_id, apiSearchMember.address1, apiSearchMember.address2, apiSearchMember.calendar_url, apiSearchMember.country, apiSearchMember.district, apiSearchMember.email, apiSearchMember.first_name, apiSearchMember.image, apiSearchMember.last_name, apiSearchMember.mobile_phone, apiSearchMember.name, apiSearchMember.zip);
1731
-
1732
- const memberAttributeFactory = (attribute) => new MemberAttribute(attribute.display_value, attribute.field_id, attribute.leader_editable, attribute.member_id, attribute.member_editable, attribute.name, attribute.options, attribute.order, attribute.section_id, attribute.type, attribute.value);
1733
-
1734
- const contactFactory = (contact) => new Contact(contact.id, contact.club_id, contact.member_id, contact.address1, contact.address2, contact.address3, contact.country, contact.district, contact.email, contact.first_name, contact.home_phone, contact.last_name, contact.mobile_phone, contact.work_phone, contact.zip);
1735
-
1736
- const memberContactFactory = (memberContact) => new MemberContact(memberContact.id, memberContact.club_id, memberContact.member_id, contactFactory(memberContact.contact), memberContact.contact_type);
1737
-
1738
- const memberFunctionFactory = (memberFunction) => new MemberFunction(memberFunction.id, memberFunction.comment, memberFunction.end_date, memberFunction.name, memberFunction.start_date);
1739
-
1740
- const memberValidationSettingsFactory = (apiMemberValidationSettings) => new MemberValidationSettings(apiMemberValidationSettings.address, apiMemberValidationSettings.birth_date, apiMemberValidationSettings.district, apiMemberValidationSettings.email, apiMemberValidationSettings.home_phone, apiMemberValidationSettings.mobile_phone, apiMemberValidationSettings.work_phone, apiMemberValidationSettings.zip);
1741
-
1742
- const memberFactory = (apiMember) => new Member(apiMember.id, apiMember.club_id, apiMember.address1, apiMember.address2, apiMember.address_field, apiMember.attributes.map((attribute) => memberAttributeFactory(attribute)), apiMember.birth_date, apiMember.calendar_url, apiMember.comment, apiMember.contacts.map((contactMember) => memberContactFactory(contactMember)), apiMember.country, apiMember.created, apiMember.district, apiMember.email, apiMember.first_name, apiMember.functions ?
1743
- apiMember.functions.map((memberFunction) => memberFunctionFactory(memberFunction)) : [], apiMember.home_phone, apiMember.image, apiMember.last_name, apiMember.mobile_phone, apiMember.public_member_id, apiMember.sex, apiMember.updated, memberValidationSettingsFactory(apiMember.validation_settings), apiMember.work_phone, apiMember.zip);
1744
-
1745
- const activityExtraMemberFactory = (apiActivityExtraMember) => new ActivityExtraMember(apiActivityExtraMember.id, apiActivityExtraMember.member_id, apiActivityExtraMember.team_id, apiActivityExtraMember.created, apiActivityExtraMember.leader, apiActivityExtraMember.member.birth_date ?
1746
- memberFactory(apiActivityExtraMember.member) : searchMemberFactory(apiActivityExtraMember.member), apiActivityExtraMember.member_name);
1747
-
1748
- const memberActivityInviteFactory = (invitedMember) => new MemberActivityInvite(invitedMember.id, invitedMember.comment, invitedMember.current_num_attendants, invitedMember.last_invite, invitedMember.leader, invitedMember.member_email, invitedMember.member_id, invitedMember.member_name, invitedMember.next_invite, invitedMember.response_date, invitedMember.status);
1749
-
1750
- const activityFactory = (apiActivity) => new Activity(apiActivity.id, apiActivity.activity_group_id, apiActivity.activity_type_id, apiActivity.club_id, apiActivity.location_id, apiActivity.team_id, apiActivity.activity_location, apiActivity.activity_type_name, apiActivity.allow_maybe, apiActivity.calendar_name, apiActivity.created, apiActivity.current_num_attendants, apiActivity.day, apiActivity.description, apiActivity.end_time, apiActivity.file, apiActivity.invitation_text, apiActivity.invite_first_days, [], apiActivity.invite_hide_before_sent, apiActivity.invite_last_response_date, apiActivity.invite_remind, apiActivity.invite_remind_receivers, apiActivity.invite_second_days, 'same_as_last', (apiActivity.invited_members && apiActivity.invited_members.length) ? apiActivity.invited_members.map((invitedMember) => memberActivityInviteFactory(invitedMember)) : [], apiActivity.last_response_date, apiActivity.max_num_attendants, apiActivity.max_num_attendants_type, apiActivity.meet_up_place, apiActivity.meet_up_time, apiActivity.meet_up_time_display, apiActivity.open_activity, apiActivity.qr_code, apiActivity.qr_code_enabled, 'none', 6, format(new Date(), 'yyyy-MM-dd'), 'repeat_until', apiActivity.show_other_invited, apiActivity.start_time, apiActivity.title, apiActivity.updated, apiActivity.use_invite, false);
1751
-
1752
- const unpaidInvoiceFactory = (apiUnpaidInvoice) => new UnpaidMemberInvoice(apiUnpaidInvoice.id, apiUnpaidInvoice.club_bill_id, apiUnpaidInvoice.member_id, apiUnpaidInvoice.token);
1753
-
1754
- const activityInviteFactory = (apiActivityInvite) => new ActivityInvite(apiActivityInvite.id, activityFactory(apiActivityInvite.activity), apiActivityInvite.comment, apiActivityInvite.created, apiActivityInvite.has_unpaid_invoices, apiActivityInvite.last_invite, apiActivityInvite.leader, searchMemberFactory(apiActivityInvite.member), apiActivityInvite.next_invite, apiActivityInvite.reminded, apiActivityInvite.response_date, apiActivityInvite.status, apiActivityInvite.token, apiActivityInvite.unpaid_invoices && apiActivityInvite.unpaid_invoices.length ? apiActivityInvite.unpaid_invoices.map((apiUnpaidInvoice) => unpaidInvoiceFactory(apiUnpaidInvoice)) : [], apiActivityInvite.updated);
1755
-
1756
- const activityLocationTagFactory = (apiActivityLocationTag) => {
1757
- return new ActivityLocationTag(apiActivityLocationTag.id, apiActivityLocationTag.club_id, apiActivityLocationTag.section_id, apiActivityLocationTag.name, apiActivityLocationTag.location_names);
1758
- };
1759
-
1760
- const activityLocationPartFactory = (apiActivityLocationPart) => {
1761
- return new ActivityLocationPart(apiActivityLocationPart.id, apiActivityLocationPart.name);
1762
- };
1763
-
1764
- const activityLocationFactory = (apiActivityLocation) => new ActivityLocation(apiActivityLocation.id, apiActivityLocation.club_id, apiActivityLocation.section_id, apiActivityLocation.group_id, apiActivityLocation.active, apiActivityLocation.mun_location_city_area, apiActivityLocation.mun_location_name, apiActivityLocation.name, apiActivityLocation.tags && apiActivityLocation.tags.length > 0 ? apiActivityLocation.tags.map((apiActivityLocationTag) => activityLocationTagFactory(apiActivityLocationTag)) : [], apiActivityLocation.parts && apiActivityLocation.parts.length > 0 ? apiActivityLocation.parts.map((apiActivityLocationPart) => activityLocationPartFactory(apiActivityLocationPart)) : []);
1765
-
1766
- const activityLocationGroupFactory = (apiActivityLocationGroup) => {
1767
- return new ActivityLocationGroup(apiActivityLocationGroup.id, apiActivityLocationGroup.club_id, apiActivityLocationGroup.section_id, apiActivityLocationGroup.active, apiActivityLocationGroup.name, apiActivityLocationGroup.locations && apiActivityLocationGroup.locations.length ? apiActivityLocationGroup.locations.map((apiActivityLocation) => activityLocationFactory(apiActivityLocation)) : []);
1768
- };
1769
-
1770
- const activityParticipantFactory = (apiActivityParticipant) => new ActivityParticipant(apiActivityParticipant.id, apiActivityParticipant.activity_id, apiActivityParticipant.member_id, apiActivityParticipant.team_id, apiActivityParticipant.member_email, apiActivityParticipant.member_name, apiActivityParticipant.rf_leader);
1771
-
1772
- const activitySettingsFactory = (apiActivitySettings) => new ActivitySettings(apiActivitySettings.day_options, apiActivitySettings.hour_options, apiActivitySettings.invite_group_options, apiActivitySettings.invite_settings_options, apiActivitySettings.max_attendance_options, apiActivitySettings.meet_up_time_options, apiActivitySettings.remind_receiver_options, apiActivitySettings.repeat_options, apiActivitySettings.repeat_type_options);
1773
-
1774
- const activityTypeFactory = (apiActivityType) => new ActivityType(apiActivityType.id, apiActivityType.club_id, apiActivityType.section_id, apiActivityType.active, apiActivityType.base_type, apiActivityType.name, apiActivityType.is_available_for_booking, apiActivityType.color);
1775
-
1776
- const authSectionFactory = (apiAuthSection) => new AuthSection(apiAuthSection.id, apiAuthSection.name);
1777
-
1778
- const authMemberFactory = (apiAuthMember) => new AuthMember(apiAuthMember.id, apiAuthMember.name, apiAuthMember.calendar_url);
1779
-
1780
- const authTeamSectionFactory = (apiAuthTeamSection) => new AuthTeamSection(apiAuthTeamSection.id, apiAuthTeamSection.name);
1781
-
1782
- const authTeamFactory = (apiAuthTeam) => new AuthTeam(apiAuthTeam.id, apiAuthTeam.calendar_url, apiAuthTeam.name, apiAuthTeam.section ? authTeamSectionFactory(apiAuthTeam.section) : null);
1783
-
1784
- const authFactory = (apiAuth) => new Auth(apiAuth.id, apiAuth.name, apiAuth.club_admin, apiAuth.is_section_club, apiAuth.members.map((apiAuthMember) => authMemberFactory(apiAuthMember)), apiAuth.registration_enabled, apiAuth.sections.map((apiAuthSection) => authSectionFactory(apiAuthSection)), apiAuth.site_enabled, apiAuth.teams.map((apiAuthTeam) => authTeamFactory(apiAuthTeam)), apiAuth.user_name);
1785
-
1786
- const bookablePartFactory = (apiBookablePart) => {
1787
- return new BookablePart(apiBookablePart.id, apiBookablePart.name);
1788
- };
1789
-
1790
- const bookableTagFactory = (apiBookableTag) => {
1791
- return new BookableTag(apiBookableTag.id, apiBookableTag.club_id, apiBookableTag.section_id, apiBookableTag.name, apiBookableTag.bookable_item_names);
1792
- };
1793
-
1794
- const bookableItemFactory = (apiBookableItem) => new BookableItem(apiBookableItem.id, apiBookableItem.club_id, apiBookableItem.section_id, apiBookableItem.group_id, apiBookableItem.active, apiBookableItem.name, apiBookableItem.location_id, apiBookableItem.description, apiBookableItem.tags && apiBookableItem.tags.length > 0 ? apiBookableItem.tags.map((apiBookableTag) => bookableTagFactory(apiBookableTag)) : [], apiBookableItem.parts && apiBookableItem.parts.length > 0 ? apiBookableItem.parts.map((apiBookablePart) => bookablePartFactory(apiBookablePart)) : []);
1795
-
1796
- const bookableGroupFactory = (apiBookableGroup) => {
1797
- return new BookableGroup(apiBookableGroup.id, apiBookableGroup.club_id, apiBookableGroup.section_id, apiBookableGroup.active, apiBookableGroup.name, apiBookableGroup.bookable_items && apiBookableGroup.bookable_items.length ? apiBookableGroup.bookable_items.map((apiBookableItem) => bookableItemFactory(apiBookableItem)) : []);
1798
- };
1799
-
1800
- const clubFactory = (apiClub) => new Club(apiClub.id, apiClub.name);
1801
-
1802
- const sectionFactory = (apiSection) => new Section(apiSection.id, apiSection.name);
1803
-
1804
- const searchTeamFactory = (apiSearchTeam) => new SearchTeam(apiSearchTeam.club ? clubFactory(apiSearchTeam.club) : undefined, apiSearchTeam.section ? sectionFactory(apiSearchTeam.section) : undefined, apiSearchTeam.id, apiSearchTeam.club_name, apiSearchTeam.name, apiSearchTeam.section_name);
1805
-
1806
- const bookingCalendarFactory = (apiBookingCalendar) => new BookingCalendar(apiBookingCalendar.id, apiBookingCalendar.club_id, apiBookingCalendar.section_id, apiBookingCalendar.team_id, apiBookingCalendar.club_name, apiBookingCalendar.name, apiBookingCalendar.section_name, apiBookingCalendar.team_name, apiBookingCalendar.status, apiBookingCalendar.max_application_number, apiBookingCalendar.allow_team_export, apiBookingCalendar.allow_repeated_bookings, apiBookingCalendar.is_default, apiBookingCalendar.available_for_teams && apiBookingCalendar.available_for_teams.length ? apiBookingCalendar.available_for_teams.map((apiSearchTeam) => searchTeamFactory(apiSearchTeam)) : [], apiBookingCalendar.bookable_groups && apiBookingCalendar.bookable_groups.length ? apiBookingCalendar.bookable_groups.map((apiBookableGroup) => bookableGroupFactory(apiBookableGroup)) : []);
1807
-
1808
- const bookingCalendarApplicationTimeFactory = (apiBookingApplicationTime) => new BookingCalendarApplicationTime(apiBookingApplicationTime.id, apiBookingApplicationTime.section_id, apiBookingApplicationTime.slot_id, apiBookingApplicationTime.team_id, apiBookingApplicationTime.title, apiBookingApplicationTime.end_time, apiBookingApplicationTime.section_name, apiBookingApplicationTime.start_time, apiBookingApplicationTime.team_name, apiBookingApplicationTime.applicant_comment, apiBookingApplicationTime.reviewer_comment, apiBookingApplicationTime.status, apiBookingApplicationTime.repeat, apiBookingApplicationTime.activity_type_id, apiBookingApplicationTime.color, apiBookingApplicationTime.slot_start_time, apiBookingApplicationTime.slot_end_time, apiBookingApplicationTime.slot_day, apiBookingApplicationTime.slot_number_of_available_sessions, apiBookingApplicationTime.slot_last_repeating_date, apiBookingApplicationTime.created, apiBookingApplicationTime.bookable_zones_taken, apiBookingApplicationTime.bookable_part_id, apiBookingApplicationTime.bookable_part_name, apiBookingApplicationTime.bookable_id, apiBookingApplicationTime.bookable_name);
1809
-
1810
- const bookingCalendarSlotSessionFactory = (apiBookingSlotSession) => new BookingCalendarSlotSession(apiBookingSlotSession.id, apiBookingSlotSession.section_id, apiBookingSlotSession.slot_id, apiBookingSlotSession.team_id, apiBookingSlotSession.title, apiBookingSlotSession.end_time, apiBookingSlotSession.section_name, apiBookingSlotSession.start_time, apiBookingSlotSession.team_name, apiBookingSlotSession.is_overbooked, apiBookingSlotSession.last_repeating_date, apiBookingSlotSession.type, apiBookingSlotSession.slot_index, apiBookingSlotSession.comment, apiBookingSlotSession.day, apiBookingSlotSession.repeat, apiBookingSlotSession.activity_type_id, apiBookingSlotSession.color, apiBookingSlotSession.update_repeating, apiBookingSlotSession.update_until_date, apiBookingSlotSession.bookable_zones_taken, apiBookingSlotSession.bookable_part_id, apiBookingSlotSession.bookable_part_name, apiBookingSlotSession.bookable_name, apiBookingSlotSession.bookable_id);
1811
-
1812
- const bookingCalendarSlotFactory = (apiBookingSlot) => new BookingCalendarSlot(apiBookingSlot.id, apiBookingSlot.calendar_id, apiBookingSlot.calendar_status, apiBookingSlot.color, apiBookingSlot.day, apiBookingSlot.end_time, apiBookingSlot.group_id, apiBookingSlot.number_of_available_sessions, apiBookingSlot.sessions && apiBookingSlot.sessions.length ? apiBookingSlot.sessions.map((apiBookingSlotSession) => bookingCalendarSlotSessionFactory(apiBookingSlotSession)) : [], apiBookingSlot.open_sessions && apiBookingSlot.open_sessions.length ? apiBookingSlot.open_sessions.map((apiBookingSlotSession) => bookingCalendarSlotSessionFactory(apiBookingSlotSession)) : [], apiBookingSlot.start_time, apiBookingSlot.type, 'none', apiBookingSlot.update_repeating, apiBookingSlot.update_until_date, false, 6, format(new Date(), 'yyyy-MM-dd'), 'repeat_until', apiBookingSlot.reserved_time, apiBookingSlot.reserved_time_position, apiBookingSlot.application_times && apiBookingSlot.application_times.length ? apiBookingSlot.application_times.map((apiBookingApplicationTime) => bookingCalendarApplicationTimeFactory(apiBookingApplicationTime)) : [], apiBookingSlot.last_repeating_date, apiBookingSlot.bookable_name, apiBookingSlot.bookable_id);
1813
-
1814
- const bookingSettingsFactory = (apiBookingSettings) => new BookingSettings(apiBookingSettings.id, apiBookingSettings.calendar_step, apiBookingSettings.calendar_min_time, apiBookingSettings.calendar_max_time, apiBookingSettings.calendar_session_duration, apiBookingSettings.should_split_booking_into_zones);
1815
-
1816
- const imageUrlsFactory = (apiImageUrls) => new ImageUrls(apiImageUrls.lg, apiImageUrls.md, apiImageUrls.raw, apiImageUrls.sm, apiImageUrls.xs);
1817
-
1818
- const generalImageFactory = (image) => image ? new GeneralImage(image.id, image.name, imageUrlsFactory(image.urls)) : null;
1819
-
1820
- const partnerFactory = (apiPartner) => new Partner(apiPartner.id, apiPartner.image ? generalImageFactory(apiPartner.image) : null, apiPartner.name, apiPartner.url);
1821
-
1822
- const cardDealFactory = (apiCardDeal) => new CardDeal(apiCardDeal.id, partnerFactory(apiCardDeal.partner), apiCardDeal.text, apiCardDeal.title, apiCardDeal.url);
1823
-
1824
- const cardLogoUrlsFactory = (apiCardLogoUrls) => new CardLogoUrls(apiCardLogoUrls.lg, apiCardLogoUrls.md, apiCardLogoUrls.sm, apiCardLogoUrls.w16, apiCardLogoUrls.w32, apiCardLogoUrls.w64, apiCardLogoUrls.w180, apiCardLogoUrls.w192);
1825
-
1826
- const cardLogoFactory = (apiCardLogo) => new CardLogo(apiCardLogo.id, apiCardLogo.name, cardLogoUrlsFactory(apiCardLogo.urls));
1827
-
1828
- const cardThemeFactory = (apiCardTheme) => new CardTheme(apiCardTheme.id, apiCardTheme.background_color, imageUrlsFactory(apiCardTheme.background_image_urls), apiCardTheme.name, apiCardTheme.text_color);
1829
-
1830
- const cardFactory = (apiCard) => new Card(apiCard.id, apiCard.deals_count, apiCard.header_1, apiCard.name, cardLogoFactory(apiCard.logo), cardThemeFactory(apiCard.theme), apiCard.ticket_count, apiCard.use_pdf_version);
1831
-
1832
- const cardMemberTicketFactory = (apiCardMemberTicket) => new CardMemberTicket(apiCardMemberTicket.id, apiCardMemberTicket.member_id, apiCardMemberTicket.ticket_id, apiCardMemberTicket.member_name, apiCardMemberTicket.ticket_image_url, apiCardMemberTicket.ticket_number);
1833
-
1834
- const homeTeamFactory = (apiHomeTeam) => new HomeTeam(apiHomeTeam.id, apiHomeTeam.logo ? generalImageFactory(apiHomeTeam.logo) : null, apiHomeTeam.name);
1835
-
1836
- const cardTicketLocationFactory = (apiCardTicketLocation) => new CardTicketLocation(apiCardTicketLocation.id, apiCardTicketLocation.club_id, apiCardTicketLocation.section_id, apiCardTicketLocation.location);
1837
-
1838
- const cardTicketFactory = (apiCardTicket) => new CardTicket(apiCardTicket.id, apiCardTicket.activation_end_hours, apiCardTicket.activation_end_time, apiCardTicket.activation_start_hours, apiCardTicket.activation_start_time, apiCardTicket.away_team, apiCardTicket.card_member_ticket ? cardMemberTicketFactory(apiCardTicket.card_member_ticket) : null, apiCardTicket.description, apiCardTicket.event_time, apiCardTicket.home_team ? homeTeamFactory(apiCardTicket.home_team) : null, apiCardTicket.image ? generalImageFactory(apiCardTicket.image) : null, cardTicketLocationFactory(apiCardTicket.location), apiCardTicket.name, apiCardTicket.ticket_type, apiCardTicket.ticket_type_nice, apiCardTicket.uses_pin);
1839
-
1840
- const clubImageFactory = (apiClubImage) => new ClubImage(apiClubImage.club_id, apiClubImage.section_id, apiClubImage.comment, apiClubImage.created, apiClubImage.image, apiClubImage.image_sm_path, apiClubImage.image_lg_path, apiClubImage.in_use, apiClubImage.is_logo, apiClubImage.original_height, apiClubImage.original_width, apiClubImage.title, apiClubImage.updated);
1841
-
1842
- const clubSectionFactory = (apiSection) => new ClubSection(apiSection.id, apiSection.name);
1843
-
1844
- const creditCardFactory = (apiCreditCard) => new CreditCard(apiCreditCard.club_id, apiCreditCard.section_id, apiCreditCard.default_activated, apiCreditCard.merchant_id, apiCreditCard.name, apiCreditCard.payment_terms_name, apiCreditCard.payment_terms_organisation_id, apiCreditCard.payment_terms_url, apiCreditCard.rsa_key, apiCreditCard.status, apiCreditCard.test_account);
1845
-
1846
- const fileFactory = (file) => new FileObject(file.id, file.created, null, typeof file.member === 'undefined' ? null : file.member, file.name, typeof file.section === 'undefined' ? null : file.section, typeof file.team === 'undefined' ? null : file.team, file.updated, file.url);
1847
-
1848
- const directoryFactory = (directory) => new Directory(directory.id, directory.club_id, directory.section_id, directory.team_id, directory.created, directory.files.map((file) => fileFactory(file)), directory.name, directory.location_name, directory.updated);
1849
-
1850
- const eventFactory = (apiEvent) => new Event(apiEvent.id, apiEvent.activity_id, apiEvent.activity_type, apiEvent.base_background_color, apiEvent.base_color, apiEvent.base_name, apiEvent.calendar_name, apiEvent.description, apiEvent.end, apiEvent.invitation_id, apiEvent.invitation_response, (apiEvent.invited_members && apiEvent.invited_members.length) ? apiEvent.invited_members.map((invitedMember) => memberActivityInviteFactory(invitedMember)) : [], apiEvent.location, apiEvent.meet_up_place, apiEvent.meet_up_time, apiEvent.member_id, apiEvent.open_activity, (apiEvent.participants && apiEvent.participants.length) ? apiEvent.participants.map((participant) => activityParticipantFactory(participant)) : [], apiEvent.start, apiEvent.title, apiEvent.type);
1851
-
1852
- const externalLinkFactory = (apiExternalLink) => new ExternalLink(apiExternalLink.text, apiExternalLink.value);
1853
-
1854
- const giroFactory = (apiGiro) => new Giro(apiGiro.club_id, apiGiro.section_id, apiGiro.giro_type, apiGiro.name, apiGiro.number, apiGiro.ocr);
1855
-
1856
- const groupRoleFactory = (apiGroupRole) => new GroupRole(apiGroupRole.id, apiGroupRole.club_id, apiGroupRole.section_id, apiGroupRole.created, apiGroupRole.name, apiGroupRole.updated);
1857
-
1858
- const memberCardFactory = (apiMemberCard) => new MemberCard(apiMemberCard.id, cardFactory(apiMemberCard.card), apiMemberCard.header_2, apiMemberCard.member_name, apiMemberCard.membership_text, apiMemberCard.name, apiMemberCard.pdf_url, apiMemberCard.qr_code, apiMemberCard.qr_code_enabled);
1859
-
1860
- const memberFeeFactory = (apiMemberFee) => new MemberFee(apiMemberFee.id, apiMemberFee.club_id, apiMemberFee.section_id, apiMemberFee.name);
1861
-
1862
- const swishFactory = (apiSwish) => new Swish(apiSwish.club_id, apiSwish.section_id, apiSwish.certificate_valid_until, apiSwish.default_activated, apiSwish.name, apiSwish.payment_terms_name, apiSwish.payment_terms_organisation_id, apiSwish.payment_terms_url, apiSwish.status, apiSwish.swish_payee_alias, apiSwish.test_account, apiSwish.use_payment_terms, apiSwish.uses_myclub_certificate);
1863
-
1864
- const zimplerFactory = (apiZimpler) => new Zimpler(apiZimpler.club_id, apiZimpler.section_id, apiZimpler.default_activated, apiZimpler.merchant_id, apiZimpler.name, apiZimpler.status, apiZimpler.test_account);
1865
-
1866
- const memberInvoiceRowFactory = (apiMemberInvoiceRow) => new MemberInvoiceRow(apiMemberInvoiceRow.id, apiMemberInvoiceRow.amount, apiMemberInvoiceRow.amount_paid, apiMemberInvoiceRow.balance, apiMemberInvoiceRow.created, apiMemberInvoiceRow.date_paid, memberFeeFactory(apiMemberInvoiceRow.fee), apiMemberInvoiceRow.has_credit_type, apiMemberInvoiceRow.invoice, apiMemberInvoiceRow.is_credit, apiMemberInvoiceRow.is_paid, apiMemberInvoiceRow.text, apiMemberInvoiceRow.updated);
1867
-
1868
- const memberInvoiceFactory = (apiMemberInvoice) => new MemberInvoice(apiMemberInvoice.id, apiMemberInvoice.amount, apiMemberInvoice.amount_paid, apiMemberInvoice.balance, apiMemberInvoice.club_bill_id, apiMemberInvoice.club_name, apiMemberInvoice.credit_card ? creditCardFactory(apiMemberInvoice.credit_card) : null, apiMemberInvoice.date_paid, apiMemberInvoice.due_date, apiMemberInvoice.giro ? giroFactory(apiMemberInvoice.giro) : null, apiMemberInvoice.invoice_rows.map((row) => memberInvoiceRowFactory(row)), apiMemberInvoice.invoice_text, apiMemberInvoice.is_paid, apiMemberInvoice.member_id, apiMemberInvoice.organisation_name, apiMemberInvoice.payee, apiMemberInvoice.payment_url, apiMemberInvoice.reference, apiMemberInvoice.swish ? swishFactory(apiMemberInvoice.swish) : null, apiMemberInvoice.zimpler ? zimplerFactory(apiMemberInvoice.zimpler) : null);
1869
-
1870
- const memberPublicFormFieldOptionFactory = (apiMemberPublicFormFieldOption) => new MemberPublicFormFieldOption(apiMemberPublicFormFieldOption.id, apiMemberPublicFormFieldOption.name, apiMemberPublicFormFieldOption.selected, apiMemberPublicFormFieldOption.default);
1871
-
1872
- const memberPublicFormFieldFactory = (apiMemberPublicFormField) => new MemberPublicFormField(apiMemberPublicFormField.all_choice_options && apiMemberPublicFormField.all_choice_options.length ?
1873
- apiMemberPublicFormField.all_choice_options.map((option) => memberPublicFormFieldOptionFactory(option)) : [], apiMemberPublicFormField.divider, apiMemberPublicFormField.familys, apiMemberPublicFormField.field_id, apiMemberPublicFormField.field_name, apiMemberPublicFormField.field_order, apiMemberPublicFormField.header, apiMemberPublicFormField.help_text, apiMemberPublicFormField.required, apiMemberPublicFormField.type, apiMemberPublicFormField.value);
1874
-
1875
- const memberTypeFactory = (apiMemberType) => new MemberType(apiMemberType.id, apiMemberType.club_id, apiMemberType.name);
1876
-
1877
- const memberPublicFormFactory = (apiMemberPublicForm) => {
1878
- const fields = new Map();
1879
- const member_fields = new Map();
1880
- if (apiMemberPublicForm.member_fields) {
1881
- Object.entries(apiMemberPublicForm.member_fields)
1882
- .forEach(([key, field]) => {
1883
- member_fields.set(key, memberPublicFormFieldFactory(field));
1884
- });
1885
- }
1886
- if (apiMemberPublicForm.fields) {
1887
- Object.entries(apiMemberPublicForm.fields)
1888
- .forEach(([key, field]) => {
1889
- fields.set(key, memberPublicFormFieldFactory(field));
1890
- });
1891
- }
1892
- return new MemberPublicForm(apiMemberPublicForm.id, apiMemberPublicForm.active_from, apiMemberPublicForm.active_to, apiMemberPublicForm.user_token, apiMemberPublicForm.comment, apiMemberPublicForm.dataprotection_policy_choice, apiMemberPublicForm.dataprotection_policy_url, fields, apiMemberPublicForm.full_text, apiMemberPublicForm.has_nationality_field, apiMemberPublicForm.max_members_per_team, apiMemberPublicForm.max_registered_in_form_total, member_fields, apiMemberPublicForm.member_types && apiMemberPublicForm.member_types.length ?
1893
- apiMemberPublicForm.member_types.map((memberType) => memberTypeFactory(memberType)) : [], apiMemberPublicForm.member_type_help_text, apiMemberPublicForm.name, apiMemberPublicForm.num_chars_birth_date, apiMemberPublicForm.num_registered, apiMemberPublicForm.registered, apiMemberPublicForm.register_family, apiMemberPublicForm.role_help_text, apiMemberPublicForm.roles && apiMemberPublicForm.roles.length
1894
- ? apiMemberPublicForm.roles.map((role) => groupRoleFactory(role)) : [], apiMemberPublicForm.team_help_text, apiMemberPublicForm.teams && apiMemberPublicForm.teams.length
1895
- ? apiMemberPublicForm.teams.map((team) => searchTeamFactory(team)) : [], apiMemberPublicForm.url);
1896
- };
1897
-
1898
- const memberTeamFactory = (apiMemberTeam) => new MemberTeam(clubFactory(apiMemberTeam.club), apiMemberTeam.section ? sectionFactory(apiMemberTeam.section) : null, apiMemberTeam.id, apiMemberTeam.email, apiMemberTeam.has_extra_members, apiMemberTeam.name, apiMemberTeam.phone, apiMemberTeam.section_name);
1899
-
1900
- const memberTeamThroughFactory = (apiMemberTeamThrough) => new MemberTeamThrough(apiMemberTeamThrough.id, apiMemberTeamThrough.created, apiMemberTeamThrough.date_hidden, apiMemberTeamThrough.image, apiMemberTeamThrough.leader, memberFactory(apiMemberTeamThrough.member), apiMemberTeamThrough.role_id, apiMemberTeamThrough.show_on_web, apiMemberTeamThrough.updated);
1901
-
1902
- const newsFactory = (apiNews) => new News(apiNews.id, apiNews.club_id, apiNews.created, apiNews.created_by_id, apiNews.section_id, apiNews.team_id, apiNews.active_to, apiNews.author, apiNews.ingress, apiNews.news_image, apiNews.news_image_text, apiNews.published_date, apiNews.read, apiNews.show_on_my_pages, apiNews.show_on_webpage, apiNews.text, apiNews.title, apiNews.updated, apiNews.urls ? imageUrlsFactory(apiNews.urls) : null);
1903
-
1904
- const optionalFeeFactory = (apiOptionalFee) => new OptionalFee(apiOptionalFee.id, apiOptionalFee.activity_id, apiOptionalFee.fee_id, apiOptionalFee.amount, apiOptionalFee.text);
1905
-
1906
- const openActivityFactory = (apiOpenActivity) => new OpenActivity(apiOpenActivity.id, apiOpenActivity.activity_group_id, apiOpenActivity.activity_type_id, apiOpenActivity.club_id, apiOpenActivity.location_id, apiOpenActivity.member_id, apiOpenActivity.team_id, apiOpenActivity.activity_location, apiOpenActivity.activity_type_name, apiOpenActivity.allow_maybe, apiOpenActivity.calendar_name, apiOpenActivity.created, apiOpenActivity.current_num_attendants, apiOpenActivity.day, apiOpenActivity.default_fee, apiOpenActivity.description, apiOpenActivity.end, apiOpenActivity.end_time, apiOpenActivity.file, apiOpenActivity.invitation_text, apiOpenActivity.invite_first_days, [], apiOpenActivity.invite_hide_before_sent, apiOpenActivity.invite_last_response_date, apiOpenActivity.invite_remind, apiOpenActivity.invite_remind_receivers, apiOpenActivity.invite_second_days, 'same_as_last', (apiOpenActivity.invited_members && apiOpenActivity.invited_members.length) ? apiOpenActivity.invited_members.map((invitedMember) => memberActivityInviteFactory(invitedMember)) : [], apiOpenActivity.last_response_date, apiOpenActivity.location_name, apiOpenActivity.max_num_attendants, apiOpenActivity.max_num_attendants_type, apiOpenActivity.meet_up_place, apiOpenActivity.meet_up_time, apiOpenActivity.meet_up_time_display, apiOpenActivity.meet_up_time_show, apiOpenActivity.member_invoice, apiOpenActivity.member_name, apiOpenActivity.open_activity, (apiOpenActivity.optional_fees && apiOpenActivity.optional_fees.length) ? apiOpenActivity.optional_fees.map((fee) => optionalFeeFactory(fee)) : [], apiOpenActivity.optional_fee_required, apiOpenActivity.optional_fee_type, 'none', 6, format(new Date(), 'yyyy-MM-dd'), 'repeat_until', apiOpenActivity.show_other_invited, apiOpenActivity.start, apiOpenActivity.start_time, apiOpenActivity.status, apiOpenActivity.title, apiOpenActivity.updated, apiOpenActivity.use_invite, false);
1907
-
1908
- const overbookedBookableItemFactory = (apiOverbookedBookableItem) => new OverbookedBookableItem(apiOverbookedBookableItem.start_time, apiOverbookedBookableItem.end_time, apiOverbookedBookableItem.day, apiOverbookedBookableItem.bookable_name, apiOverbookedBookableItem.session_names);
1909
-
1910
- const overbookedLocationFactory = (apiOverbookedLocation) => new OverbookedLocation(apiOverbookedLocation.start_time, apiOverbookedLocation.end_time, apiOverbookedLocation.day, apiOverbookedLocation.location_name, apiOverbookedLocation.session_names);
1911
-
1912
- const otherMemberFieldFactory = (apiOtherMemberFieldFactory) => new OtherMemberField(apiOtherMemberFieldFactory.display_name, apiOtherMemberFieldFactory.field_name, apiOtherMemberFieldFactory.value);
1913
-
1914
- const otherMemberFactory = (apiOtherMember) => new OtherMember(apiOtherMember.id, apiOtherMember.country, apiOtherMember.created, apiOtherMember.first_name, apiOtherMember.image, apiOtherMember.last_name, apiOtherMember.name, apiOtherMember.fields ? apiOtherMember.fields.map((memberField) => otherMemberFieldFactory(memberField)) : []);
1915
-
1916
- const paymentAttemptFactory = (apiPaymentAttempt) => {
1917
- let paymentAttemptData = null;
1918
- if (apiPaymentAttempt.type === 'mondido') {
1919
- const data = apiPaymentAttempt.payment_data;
1920
- paymentAttemptData = {
1921
- hash: data.hash,
1922
- paymentAttemptId: data.payment_attempt_id
1923
- };
1924
- }
1925
- else if (apiPaymentAttempt.type === 'swish') {
1926
- paymentAttemptData = {
1927
- paymentRequestToken: apiPaymentAttempt.payment_data?.payment_request_token
1928
- };
1929
- }
1930
- else {
1931
- paymentAttemptData = {
1932
- userFormUrl: apiPaymentAttempt.payment_data.user_form_url
1933
- };
1934
- }
1935
- return new PaymentAttempt(apiPaymentAttempt.id, apiPaymentAttempt.amount, apiPaymentAttempt.error, apiPaymentAttempt.invoice_id, apiPaymentAttempt.paid_date, paymentAttemptData, apiPaymentAttempt.status, apiPaymentAttempt.type);
1936
- };
1937
-
1938
- const publicAuthenticationFactory = (publicToken) => new PublicAuthentication(publicToken.token, publicToken.token_expires);
1939
-
1940
- const registrationQRCodeFactory = (apiRegistrationQRCode) => new RegistrationQRCode(apiRegistrationQRCode.id, apiRegistrationQRCode.club_id, apiRegistrationQRCode.section_id, apiRegistrationQRCode.display_text, apiRegistrationQRCode.is_active, apiRegistrationQRCode.name, apiRegistrationQRCode.successful_text);
1941
-
1942
- const searchClubFactory = (apiSearchClub) => new SearchClub(apiSearchClub.id, apiSearchClub.leader_member_search, apiSearchClub.member_search, apiSearchClub.member_view, apiSearchClub.name, apiSearchClub.open_activities, apiSearchClub.open_activities_name, apiSearchClub.open_activities_search_type, apiSearchClub.qr_codes_enabled);
1943
-
1944
- const searchMemberCardFactory = (apiSearchMemberCard) => new SearchMemberCard(apiSearchMemberCard.id, apiSearchMemberCard.name, apiSearchMemberCard.notification_count, apiSearchMemberCard.pdf_url);
1945
-
1946
- const searchMemberInvoiceFactory = (apiSearchMemberInvoice) => new SearchMemberInvoice(apiSearchMemberInvoice.id, apiSearchMemberInvoice.amount, apiSearchMemberInvoice.amount_paid, apiSearchMemberInvoice.balance, apiSearchMemberInvoice.club_bill_id, apiSearchMemberInvoice.date_paid, apiSearchMemberInvoice.due_date, apiSearchMemberInvoice.is_paid, apiSearchMemberInvoice.member_id);
1947
-
1948
- const searchMemberTeamThroughFactory = (apiMemberTeamThrough) => new MemberTeamThrough(apiMemberTeamThrough.id, apiMemberTeamThrough.created, apiMemberTeamThrough.date_hidden, apiMemberTeamThrough.image, apiMemberTeamThrough.leader, searchMemberFactory(apiMemberTeamThrough.member), apiMemberTeamThrough.role_id, apiMemberTeamThrough.show_on_web, apiMemberTeamThrough.updated);
1949
-
1950
- const tokenFactory = (apiToken) => new Token(apiToken.access_token, apiToken.refresh_token);
1951
-
1952
- const userFactory = (apiUser) => new User(apiUser.device_token, apiUser.email, apiUser.first_name, apiUser.is_staff, apiUser.language, apiUser.last_name, apiUser.new_email);
1953
-
1954
- const userNotificationFactory = (apiUserNotification) => new UserNotification(apiUserNotification.id, apiUserNotification.club_id, apiUserNotification.member_id, apiUserNotification.object_id, apiUserNotification.created, apiUserNotification.message, apiUserNotification.title, apiUserNotification.type);
1955
-
1956
- const DOMAIN = new InjectionToken('domain');
1957
- const API_PATH = 'api/v3/';
1958
- const ROLE_PATH = {
1959
- [Role.ClubAdmin]: 'club-admin/',
1960
- [Role.SectionAdmin]: 'section-admin/',
1961
- [Role.TeamAdmin]: 'team-admin/',
1962
- [Role.MemberAdmin]: 'member-admin/',
1963
- [Role.Public]: 'public/',
1964
- [Role.None]: ''
1965
- };
1966
- class ApiService {
1967
- constructor(http, domain) {
1968
- this.http = http;
1969
- this.domain = domain;
1970
- }
1971
- deleteResource(role, path, pathParams = {}, options = {}) {
1972
- return this.delete(role, path, pathParams, options)
1973
- .pipe(map((response) => response.status === 204));
1974
- }
1975
- deleteResourceWithBody(role, path, pathParams = {}, options = {}) {
1976
- return this.http.delete(this.url(this.path(role, path, pathParams)), { ...options, observe: 'response' }).pipe(map((response) => response.status === 204));
1977
- }
1978
- getCollection(factory, role, path, pathParams = {}, options = {}) {
1979
- return this.get(role, path, pathParams, options).pipe(map((apiCollection) => {
1980
- const resources = apiCollection.results.map((resource) => factory(resource));
1981
- return new Collection(apiCollection.count, apiCollection.next, apiCollection.previous, resources);
1982
- }));
1983
- }
1984
- getResource(factory, role, path, pathParams = {}, options = {}) {
1985
- return this.get(role, path, pathParams, options).pipe(map((apiResource) => factory(apiResource)));
1986
- }
1987
- postFormData(factory, role, path, pathParams = {}, data) {
1988
- return this.http.post(this.url(this.path(role, path, pathParams)), this.getFormData(data))
1989
- .pipe(map((apiResource) => factory(apiResource)));
1990
- }
1991
- postResource(factory, role, path, pathParams = {}, data, options = {}) {
1992
- return this.post(role, path, pathParams, data, options).pipe(map((apiResource) => factory(apiResource)));
1993
- }
1994
- postResourceNoResponse(role, path, pathParams = {}, data, options = {}) {
1995
- return this.postEmptyResponse(role, path, pathParams, data, options).pipe(map((response) => response.status === 200 || response.status === 201 || response.status === 204));
1996
- }
1997
- updateResource(responseFactory, role, path, pathParams = {}, data, options = {}) {
1998
- return this.patch(role, path, pathParams, data, options).pipe(map((apiResource) => responseFactory(apiResource)));
1999
- }
2000
- updateResourceNoResponse(role, path, pathParams = {}, data, options = {}) {
2001
- return this.patchEmptyResponse(role, path, pathParams, data, options).pipe(map((response) => response.status === 200 || response.status === 204));
2002
- }
2003
- delete(role, path, pathParams, options) {
2004
- if (options.body) {
2005
- return this.http.request('delete', this.url(this.path(role, path, pathParams)), options);
2006
- }
2007
- return this.http.delete(this.url(this.path(role, path, pathParams)), { ...options, observe: 'response' });
2008
- }
2009
- get(role, path, pathParams, options) {
2010
- return this.http.get(this.url(this.path(role, path, pathParams)), options);
2011
- }
2012
- getFormData(data) {
2013
- if (data instanceof FormData) {
2014
- return data;
2015
- }
2016
- const formData = new FormData();
2017
- for (const [key, value] of Object.entries(data)) {
2018
- formData.append(key, value);
2019
- }
2020
- return formData;
2021
- }
2022
- patch(role, path, pathParams, data, options) {
2023
- return this.http.patch(this.url(this.path(role, path, pathParams)), data, options);
2024
- }
2025
- patchEmptyResponse(role, path, pathParams, data, options) {
2026
- return this.http.patch(this.url(this.path(role, path, pathParams)), data, { ...options, observe: 'response' });
2027
- }
2028
- path(role, path, params) {
2029
- for (const [key, value] of Object.entries(params)) {
2030
- const regexp = new RegExp(':' + key, 'g');
2031
- path = path.replace(regexp, value);
2032
- }
2033
- return ROLE_PATH[role] + path;
2034
- }
2035
- post(role, path, pathParams, data, options) {
2036
- return this.http.post(this.url(this.path(role, path, pathParams)), data, options);
2037
- }
2038
- postEmptyResponse(role, path, pathParams, data, options) {
2039
- return this.http.post(this.url(this.path(role, path, pathParams)), data, { ...options, observe: 'response' });
2040
- }
2041
- url(path) {
2042
- return this.domain + API_PATH + path;
2043
- }
2044
- }
2045
- ApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ApiService, deps: [{ token: i1.HttpClient }, { token: DOMAIN }], target: i0.ɵɵFactoryTarget.Injectable });
2046
- ApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ApiService, providedIn: 'root' });
2047
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ApiService, decorators: [{
2048
- type: Injectable,
2049
- args: [{
2050
- providedIn: 'root'
2051
- }]
2052
- }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
2053
- type: Inject,
2054
- args: [DOMAIN]
2055
- }] }]; } });
2056
-
2057
- const AUTHS_PATH = 'every-admin/auths/';
2058
- const REMOVE_AUTH_PATH = 'accounts/remove-auth/:authId/:authType/:id/';
2059
- const UPDATE_MEMBERS_PATH = 'every-admin/auths/update-members/';
2060
- class AuthService {
2061
- constructor(apiService) {
2062
- this.apiService = apiService;
2063
- }
2064
- getAuth(id) {
2065
- return this.apiService
2066
- .getCollection(authFactory, Role.None, AUTHS_PATH, {}, { params: { club_id: id } })
2067
- .pipe(map((collection) => {
2068
- if (collection.count === 0) {
2069
- return null;
2070
- }
2071
- return collection.toArray()[0];
2072
- }));
2073
- }
2074
- getAuths(role = null) {
2075
- return this.apiService.getCollection(authFactory, Role.None, AUTHS_PATH, {}, role ? { params: { role } } : {});
2076
- }
2077
- removeClubAuth(authId, clubId) {
2078
- return this.removeAuth(authId, clubId, 'club');
2079
- }
2080
- removeMemberAuth(authId, memberId) {
2081
- return this.removeAuth(authId, memberId, 'member');
2082
- }
2083
- removeSectionAuth(authId, sectionId) {
2084
- return this.removeAuth(authId, sectionId, 'section');
2085
- }
2086
- removeTeamAuth(authId, teamId) {
2087
- return this.removeAuth(authId, teamId, 'team');
2088
- }
2089
- updateMembers() {
2090
- return this.apiService.updateResourceNoResponse(Role.None, UPDATE_MEMBERS_PATH, {}, {})
2091
- .pipe(map(() => true), catchError(() => of(false)));
2092
- }
2093
- removeAuth(authId, authTypeId, authType) {
2094
- return this.apiService.postResource(() => { }, Role.None, REMOVE_AUTH_PATH, {
2095
- authId,
2096
- authType,
2097
- id: authTypeId
2098
- }, {})
2099
- .pipe(map(() => true), catchError(() => of(false)));
2100
- }
2101
- }
2102
- AuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: AuthService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
2103
- AuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: AuthService, providedIn: 'root' });
2104
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: AuthService, decorators: [{
2105
- type: Injectable,
2106
- args: [{
2107
- providedIn: 'root'
2108
- }]
2109
- }], ctorParameters: function () { return [{ type: ApiService }]; } });
2110
-
2111
- const MEMBER_ACTIVITY_ATTENDANCE_PATH = ':memberId/activities/activity/:activityId/attendance/';
2112
- const MEMBER_ACTIVITY_INVITE_PATH = ':memberId/activities/:activityInviteId/';
2113
- const MEMBER_ACTIVITY_PATH = ':memberId/activities/activity/:activityId/';
2114
- const MEMBER_ACTIVITY_INVITES_PATH = ':memberId/activities/';
2115
- const MEMBER_CALENDAR_PATH = ':memberId/activities/calendar/';
2116
- const MEMBER_OPEN_ACTIVITIES_PATH = ':memberId/open-activities/';
2117
- const MEMBER_OPEN_ACTIVITIES_ACTIVITY_TYPES_PATH = ':memberId/open-activities/types/';
2118
- const MEMBER_OPEN_ACTIVITIES_ACTIVITY_LOCATIONS_PATH = ':memberId/open-activities/locations/';
2119
- const MEMBER_OPEN_ACTIVITY_PATH = ':memberId/open-activities/:activityId/';
2120
- const MEMBER_OPEN_ACTIVITY_RESPOND_PATH = ':memberId/open-activities/:activityId/respond/';
2121
- const PUBLIC_ACTIVITY_INVITE_PATH = 'activities/:id/:token/';
2122
- const PUBLIC_OPEN_ACTIVITIES_PATH = 'open-activities/';
2123
- const PUBLIC_OPEN_ACTIVITIES_ACTIVITY_TYPES_PATH = 'open-activities/types/';
2124
- const PUBLIC_OPEN_ACTIVITIES_ACTIVITY_LOCATIONS_PATH = 'open-activities/locations/';
2125
- const PUBLIC_OPEN_ACTIVITY_PATH = 'open-activities/:activityId/';
2126
- const PUBLIC_OPEN_ACTIVITY_RESPOND_PATH = 'open-activities/:activityId/respond/';
2127
- const PUBLIC_OPEN_ACTIVITY_INVITE_PATH = 'open-activities/invites/:activityId/';
2128
- const TEAM_ACTIVITIES_PATH = ':teamId/activities/';
2129
- const TEAM_ACTIVITY_INVITES_PATH = ':teamId/activities/:activityId/invites/';
2130
- const TEAM_ACTIVITY_INVITE_PATH = ':teamId/activities/:activityId/invites/:activityInviteId/';
2131
- const TEAM_ACTIVITY_INVITE_RESEND_PATH = ':teamId/activities/:activityId/invites/:activityInviteId/resend-invite/';
2132
- const TEAM_ACTIVITY_NEW_PATH = ':teamId/activities/new/';
2133
- const TEAM_ACTIVITY_PARTICIPANTS_PATH = ':teamId/activities/:activityId/participants/';
2134
- const TEAM_ACTIVITY_PATH = ':teamId/activities/:id/';
2135
- const TEAM_ACTIVITY_QR_CODE_PATH = ':teamId/activities/:id/qr-code/';
2136
- const TEAM_ACTIVITY_SETTINGS_PATH = ':teamId/activities/settings/';
2137
- const SECTION_ACTIVITY_SETTINGS_PATH = ':sectionId/activities/settings/';
2138
- const CLUB_ACTIVITY_SETTINGS_PATH = ':clubId/activities/settings/';
2139
- const TEAM_ACTIVITY_TYPES_PATH = ':teamId/activities/types/';
2140
- const TEAM_CALENDAR_PATH = ':teamId/activities/calendar/';
2141
- const CLUB_ACTIVITY_LOCATIONS_PATH = ':clubId/activities/locations/';
2142
- const CLUB_ACTIVITY_LOCATION_PATH = ':clubId/activities/locations/:locationId/';
2143
- const CLUB_ACTIVITY_TYPES_PATH = ':clubId/activities/types/';
2144
- const CLUB_ACTIVITY_TYPE_PATH = ':clubId/activities/types/:typeId/';
2145
- const TEAM_ACTIVITY_LOCATIONS_PATH = ':teamId/activities/locations/';
2146
- const SECTION_ACTIVITY_LOCATIONS_PATH = ':sectionId/activities/locations/';
2147
- const SECTION_ACTIVITY_LOCATION_PATH = ':sectionId/activities/locations/:locationId/';
2148
- const SECTION_ACTIVITY_TYPES_PATH = ':sectionId/activities/types/';
2149
- const SECTION_ACTIVITY_TYPE_PATH = ':sectionId/activities/types/:typeId/';
2150
- class ActivityService {
2151
- constructor(apiService) {
2152
- this.apiService = apiService;
2153
- }
2154
- addTeamActivityInvites(teamId, activityId, memberIds) {
2155
- return this.apiService
2156
- .postResource(() => true, Role.TeamAdmin, TEAM_ACTIVITY_INVITES_PATH, {
2157
- teamId,
2158
- activityId
2159
- }, {
2160
- members: memberIds
2161
- });
2162
- }
2163
- createTeamActivity(teamId, data) {
2164
- return this.apiService
2165
- .postResource(activityFactory, Role.TeamAdmin, TEAM_ACTIVITIES_PATH, {
2166
- teamId
2167
- }, this.removeUnusedActivityFields(data));
2168
- }
2169
- deleteTeamActivity(teamId, id) {
2170
- return this.apiService
2171
- .deleteResource(Role.TeamAdmin, TEAM_ACTIVITY_PATH, {
2172
- teamId,
2173
- id
2174
- });
2175
- }
2176
- deleteTeamActivityInvite(teamId, activityId, activityInviteId) {
2177
- return this.apiService
2178
- .deleteResource(Role.TeamAdmin, TEAM_ACTIVITY_INVITE_PATH, {
2179
- teamId,
2180
- activityId,
2181
- activityInviteId
2182
- });
2183
- }
2184
- getMemberActivity(memberId, activityId) {
2185
- return this.apiService
2186
- .getResource(activityFactory, Role.MemberAdmin, MEMBER_ACTIVITY_PATH, {
2187
- memberId,
2188
- activityId
2189
- });
2190
- }
2191
- getMemberActivityInvite(memberId, activityInviteId) {
2192
- return this.apiService
2193
- .getResource(activityInviteFactory, Role.MemberAdmin, MEMBER_ACTIVITY_INVITE_PATH, {
2194
- memberId,
2195
- activityInviteId
2196
- });
2197
- }
2198
- getMemberActivityInvites(memberId) {
2199
- const params = { limit: 'null' };
2200
- return this.apiService
2201
- .getCollection(activityInviteFactory, Role.MemberAdmin, MEMBER_ACTIVITY_INVITES_PATH, { memberId }, {
2202
- params
2203
- });
2204
- }
2205
- getMemberCalendarEvents(memberId, startDate = null, endDate = null) {
2206
- const params = { limit: 'null' };
2207
- if (startDate) {
2208
- params['search_start_day'] = startDate;
2209
- }
2210
- if (endDate) {
2211
- params['search_end_day'] = endDate;
2212
- }
2213
- return this.apiService
2214
- .getCollection(eventFactory, Role.MemberAdmin, MEMBER_CALENDAR_PATH, { memberId }, {
2215
- params
2216
- });
2217
- }
2218
- getMemberOpenActivities(memberId, openActivitySearchParams) {
2219
- return this.apiService
2220
- .getCollection(openActivityFactory, Role.MemberAdmin, MEMBER_OPEN_ACTIVITIES_PATH, { memberId }, {
2221
- params: this.getOpenActivitySearchParams(openActivitySearchParams)
2222
- });
2223
- }
2224
- getMemberOpenActivity(memberId, activityId) {
2225
- return this.apiService
2226
- .getResource(openActivityFactory, Role.MemberAdmin, MEMBER_OPEN_ACTIVITY_PATH, {
2227
- memberId,
2228
- activityId
2229
- });
2230
- }
2231
- getMemberOpenActivityActivityTypes(memberId, startDate = null, endDate = null, all = false) {
2232
- return this.apiService
2233
- .getCollection(activityTypeFactory, Role.MemberAdmin, MEMBER_OPEN_ACTIVITIES_ACTIVITY_TYPES_PATH, {
2234
- memberId
2235
- }, {
2236
- params: this.getOpenActivityDateParams(startDate, endDate, all)
2237
- });
2238
- }
2239
- getMemberOpenActivityLocations(memberId, startDate = null, endDate = null, all = false) {
2240
- return this.apiService
2241
- .getCollection(activityLocationFactory, Role.MemberAdmin, MEMBER_OPEN_ACTIVITIES_ACTIVITY_LOCATIONS_PATH, {
2242
- memberId
2243
- }, {
2244
- params: this.getOpenActivityDateParams(startDate, endDate, all)
2245
- });
2246
- }
2247
- getPublicActivityInvite(id, token) {
2248
- return this.apiService
2249
- .getResource(activityInviteFactory, Role.Public, PUBLIC_ACTIVITY_INVITE_PATH, {
2250
- id,
2251
- token
2252
- });
2253
- }
2254
- getPublicOpenActivities(openActivitySearchParams) {
2255
- return this.apiService
2256
- .getCollection(openActivityFactory, Role.Public, PUBLIC_OPEN_ACTIVITIES_PATH, {}, { params: this.getOpenActivitySearchParams(openActivitySearchParams) });
2257
- }
2258
- getPublicOpenActivity(activityId) {
2259
- return this.apiService
2260
- .getResource(openActivityFactory, Role.Public, PUBLIC_OPEN_ACTIVITY_PATH, { activityId });
2261
- }
2262
- getPublicOpenActivityActivityTypes(startDate = null, endDate = null, all = false) {
2263
- return this.apiService
2264
- .getCollection(activityTypeFactory, Role.Public, PUBLIC_OPEN_ACTIVITIES_ACTIVITY_TYPES_PATH, {}, {
2265
- params: this.getOpenActivityDateParams(startDate, endDate, all)
2266
- });
2267
- }
2268
- getPublicOpenActivityLocations(startDate = null, endDate = null, all = false) {
2269
- return this.apiService
2270
- .getCollection(activityLocationFactory, Role.Public, PUBLIC_OPEN_ACTIVITIES_ACTIVITY_LOCATIONS_PATH, {}, {
2271
- params: this.getOpenActivityDateParams(startDate, endDate, all)
2272
- });
2273
- }
2274
- getTeamActivity(teamId, id) {
2275
- return this.apiService
2276
- .getResource(activityFactory, Role.TeamAdmin, TEAM_ACTIVITY_PATH, { teamId, id });
2277
- }
2278
- getTeamActivityQRCode(teamId, id) {
2279
- return this.apiService
2280
- .getResource(activityFactory, Role.TeamAdmin, TEAM_ACTIVITY_QR_CODE_PATH, { teamId, id });
2281
- }
2282
- getActivityLocations(role, clubOrSectionOrTeamId, force = false) {
2283
- if (role == Role.ClubAdmin) {
2284
- return this.getClubActivityLocations(clubOrSectionOrTeamId, force);
2285
- }
2286
- else if (role == Role.SectionAdmin) {
2287
- return this.getSectionActivityLocations(clubOrSectionOrTeamId, force);
2288
- }
2289
- return this.getTeamActivityLocations(clubOrSectionOrTeamId, force);
2290
- }
2291
- getTeamActivityLocations(teamId, force = false) {
2292
- if (this.activityLocationResponseDate && this.activityLocationResponseDate > sub(new Date(), { hours: 1 }) && !force) {
2293
- return of(this.activityLocationCollection);
2294
- }
2295
- return this.apiService
2296
- .getCollection(activityLocationFactory, Role.TeamAdmin, TEAM_ACTIVITY_LOCATIONS_PATH, { teamId }, { params: { limit: 'null' } }).pipe(tap((activityLocationCollection) => {
2297
- this.activityLocationResponseDate = new Date();
2298
- this.activityLocationCollection = activityLocationCollection;
2299
- }));
2300
- }
2301
- getClubActivityLocations(clubId, force = false) {
2302
- if (this.activityLocationResponseDate && this.activityLocationResponseDate > sub(new Date(), { hours: 1 }) && !force) {
2303
- return of(this.activityLocationCollection);
2304
- }
2305
- return this.apiService
2306
- .getCollection(activityLocationFactory, Role.ClubAdmin, CLUB_ACTIVITY_LOCATIONS_PATH, { clubId }, { params: { limit: 'null' } }).pipe(tap((activityLocationCollection) => {
2307
- this.activityLocationResponseDate = new Date();
2308
- this.activityLocationCollection = activityLocationCollection;
2309
- }));
2310
- }
2311
- getSectionActivityLocations(sectionId, force = false) {
2312
- if (this.activityLocationResponseDate && this.activityLocationResponseDate > sub(new Date(), { hours: 1 }) && !force) {
2313
- return of(this.activityLocationCollection);
2314
- }
2315
- return this.apiService
2316
- .getCollection(activityLocationFactory, Role.SectionAdmin, SECTION_ACTIVITY_LOCATIONS_PATH, { sectionId }, { params: { limit: 'null' } }).pipe(tap((activityLocationCollection) => {
2317
- this.activityLocationResponseDate = new Date();
2318
- this.activityLocationCollection = activityLocationCollection;
2319
- }));
2320
- }
2321
- updateActivityLocation(role, clubOrSectionOrTeamId, location) {
2322
- if (role === Role.ClubAdmin) {
2323
- return this.updateClubActivityLocation(clubOrSectionOrTeamId, location);
2324
- }
2325
- return this.updateSectionActivityLocation(clubOrSectionOrTeamId, location);
2326
- }
2327
- updateClubActivityLocation(clubId, location) {
2328
- return this.apiService
2329
- .updateResource(activityLocationFactory, Role.ClubAdmin, CLUB_ACTIVITY_LOCATION_PATH, {
2330
- clubId,
2331
- locationId: location.id
2332
- }, location);
2333
- }
2334
- updateMemberActivityAttendance(memberId, activityId) {
2335
- return this.apiService
2336
- .postResourceNoResponse(Role.MemberAdmin, MEMBER_ACTIVITY_ATTENDANCE_PATH, {
2337
- memberId,
2338
- activityId
2339
- }, {});
2340
- }
2341
- updateSectionActivityLocation(sectionId, location) {
2342
- return this.apiService
2343
- .updateResource(activityLocationFactory, Role.SectionAdmin, SECTION_ACTIVITY_LOCATION_PATH, {
2344
- sectionId,
2345
- locationId: location.id
2346
- }, location);
2347
- }
2348
- getTeamActivityNew(teamId) {
2349
- return this.apiService
2350
- .getResource(activityFactory, Role.TeamAdmin, TEAM_ACTIVITY_NEW_PATH, { teamId });
2351
- }
2352
- getTeamActivityParticipants(teamId, activityId) {
2353
- return this.apiService
2354
- .getCollection(searchMemberFactory, Role.TeamAdmin, TEAM_ACTIVITY_PARTICIPANTS_PATH, {
2355
- teamId,
2356
- activityId
2357
- }, { params: { limit: 'null' } });
2358
- }
2359
- getActivitySettings(role, clubOrSectionOrTeamId) {
2360
- if (role === Role.ClubAdmin) {
2361
- return this.getClubActivitySettings(clubOrSectionOrTeamId);
2362
- }
2363
- else if (role == Role.SectionAdmin) {
2364
- return this.getSectionActivitySettings(clubOrSectionOrTeamId);
2365
- }
2366
- return this.getTeamActivitySettings(clubOrSectionOrTeamId);
2367
- }
2368
- getTeamActivitySettings(teamId) {
2369
- return this.apiService
2370
- .getResource(activitySettingsFactory, Role.TeamAdmin, TEAM_ACTIVITY_SETTINGS_PATH, {
2371
- teamId
2372
- });
2373
- }
2374
- getSectionActivitySettings(sectionId) {
2375
- return this.apiService
2376
- .getResource(activitySettingsFactory, Role.SectionAdmin, SECTION_ACTIVITY_SETTINGS_PATH, {
2377
- sectionId
2378
- });
2379
- }
2380
- getClubActivitySettings(clubId) {
2381
- return this.apiService
2382
- .getResource(activitySettingsFactory, Role.ClubAdmin, CLUB_ACTIVITY_SETTINGS_PATH, {
2383
- clubId,
2384
- });
2385
- }
2386
- getActivityTypes(role, clubOrSectionOrTeamId) {
2387
- if (role === Role.ClubAdmin) {
2388
- return this.getClubActivityTypes(clubOrSectionOrTeamId);
2389
- }
2390
- else if (role === Role.SectionAdmin) {
2391
- return this.getSectionActivityTypes(clubOrSectionOrTeamId);
2392
- }
2393
- return this.getTeamActivityTypes(clubOrSectionOrTeamId);
2394
- }
2395
- getTeamActivityTypes(teamId) {
2396
- return this.apiService
2397
- .getCollection(activityTypeFactory, Role.TeamAdmin, TEAM_ACTIVITY_TYPES_PATH, { teamId }, { params: { limit: 'null' } });
2398
- }
2399
- getClubActivityTypes(clubId) {
2400
- return this.apiService
2401
- .getCollection(activityTypeFactory, Role.ClubAdmin, CLUB_ACTIVITY_TYPES_PATH, { clubId }, { params: { limit: 'null' } });
2402
- }
2403
- getSectionActivityTypes(sectionId) {
2404
- return this.apiService
2405
- .getCollection(activityTypeFactory, Role.SectionAdmin, SECTION_ACTIVITY_TYPES_PATH, { sectionId }, { params: { limit: 'null' } });
2406
- }
2407
- updateActivityType(role, clubOrSectionOrTeamId, activityType) {
2408
- if (role === Role.ClubAdmin) {
2409
- return this.updateClubActivityType(clubOrSectionOrTeamId, activityType);
2410
- }
2411
- return this.updateSectionActivityType(clubOrSectionOrTeamId, activityType);
2412
- }
2413
- updateClubActivityType(clubId, activityType) {
2414
- return this.apiService
2415
- .updateResource(activityTypeFactory, Role.ClubAdmin, CLUB_ACTIVITY_TYPE_PATH, {
2416
- clubId,
2417
- typeId: activityType.id,
2418
- }, activityType);
2419
- }
2420
- updateSectionActivityType(sectionId, activityType) {
2421
- return this.apiService
2422
- .updateResource(activityTypeFactory, Role.SectionAdmin, SECTION_ACTIVITY_TYPE_PATH, {
2423
- sectionId,
2424
- typeId: activityType.id,
2425
- }, activityType);
2426
- }
2427
- getTeamCalendarEvents(teamId, startDate = null, endDate = null) {
2428
- const params = { limit: 'null' };
2429
- if (startDate) {
2430
- params['search_start_day'] = startDate;
2431
- }
2432
- if (endDate) {
2433
- params['search_end_day'] = endDate;
2434
- }
2435
- return this.apiService
2436
- .getCollection(eventFactory, Role.TeamAdmin, TEAM_CALENDAR_PATH, { teamId }, {
2437
- params
2438
- });
2439
- }
2440
- resendInvite(teamId, activityId, activityInviteId) {
2441
- return this.apiService
2442
- .postResource(activityInviteFactory, Role.TeamAdmin, TEAM_ACTIVITY_INVITE_RESEND_PATH, {
2443
- teamId,
2444
- activityId,
2445
- activityInviteId
2446
- }, {});
2447
- }
2448
- removeMemberOpenActivity(memberId, activityId) {
2449
- return this.apiService
2450
- .deleteResource(Role.MemberAdmin, MEMBER_OPEN_ACTIVITY_RESPOND_PATH, {
2451
- memberId,
2452
- activityId
2453
- });
2454
- }
2455
- removePublicOpenActivity(activityId) {
2456
- return this.apiService
2457
- .deleteResource(Role.Public, PUBLIC_OPEN_ACTIVITY_RESPOND_PATH, {
2458
- activityId
2459
- });
2460
- }
2461
- signUpMemberOpenActivity(memberId, activityId, comment, optionalFees) {
2462
- return this.apiService
2463
- .updateResourceNoResponse(Role.MemberAdmin, MEMBER_OPEN_ACTIVITY_RESPOND_PATH, {
2464
- memberId,
2465
- activityId
2466
- }, {
2467
- comment,
2468
- optional_fees: optionalFees
2469
- });
2470
- }
2471
- signUpPublicOpenActivity(activityId, comment, optionalFees) {
2472
- return this.apiService
2473
- .updateResourceNoResponse(Role.MemberAdmin, PUBLIC_OPEN_ACTIVITY_RESPOND_PATH, {
2474
- activityId
2475
- }, {
2476
- comment,
2477
- optional_fees: optionalFees
2478
- });
2479
- }
2480
- updateMemberActivity(memberId, activityInviteId, activityInvite) {
2481
- return this.apiService
2482
- .updateResource(activityInviteFactory, Role.MemberAdmin, MEMBER_ACTIVITY_INVITE_PATH, {
2483
- memberId,
2484
- activityInviteId
2485
- }, activityInvite);
2486
- }
2487
- updatePublicActivityInvite(id, token, activityInvite) {
2488
- return this.apiService
2489
- .updateResource(activityInviteFactory, Role.Public, PUBLIC_ACTIVITY_INVITE_PATH, {
2490
- id,
2491
- token
2492
- }, activityInvite);
2493
- }
2494
- updatePublicOpenActivityInvite(id, activityInvite) {
2495
- return this.apiService
2496
- .updateResource(activityInviteFactory, Role.Public, PUBLIC_OPEN_ACTIVITY_INVITE_PATH, {
2497
- id
2498
- }, activityInvite);
2499
- }
2500
- updateTeamActivity(teamId, activity) {
2501
- return this.apiService
2502
- .updateResource(activityFactory, Role.TeamAdmin, TEAM_ACTIVITY_PATH, {
2503
- teamId,
2504
- id: activity.id
2505
- }, this.removeUnusedActivityFields(activity));
2506
- }
2507
- updateTeamActivityInvite(teamId, activityId, activityInviteId, activityInvite) {
2508
- return this.apiService
2509
- .updateResource(memberActivityInviteFactory, Role.TeamAdmin, TEAM_ACTIVITY_INVITE_PATH, {
2510
- teamId,
2511
- activityId,
2512
- activityInviteId
2513
- }, activityInvite);
2514
- }
2515
- updateTeamActivityParticipants(teamId, activityId, members) {
2516
- return this.apiService
2517
- .postResource(() => {
2518
- }, Role.TeamAdmin, TEAM_ACTIVITY_PARTICIPANTS_PATH, {
2519
- teamId,
2520
- activityId
2521
- }, {
2522
- members
2523
- });
2524
- }
2525
- getOpenActivityDateParams(startDate, endDate, all = false) {
2526
- let params = {
2527
- 'all': all ? 'true' : 'false'
2528
- };
2529
- if (startDate) {
2530
- params['start_date'] = startDate;
2531
- }
2532
- if (endDate) {
2533
- params['end_date'] = endDate;
2534
- }
2535
- return params;
2536
- }
2537
- getOpenActivitySearchParams(openActivitySearchParams) {
2538
- const params = {
2539
- end_date: openActivitySearchParams.endDate,
2540
- limit: 'null',
2541
- start_date: openActivitySearchParams.startDate
2542
- };
2543
- if (openActivitySearchParams.activityTypeId) {
2544
- params['activity_type_id'] = openActivitySearchParams.activityTypeId;
2545
- }
2546
- if (openActivitySearchParams.locationId) {
2547
- params['location_id'] = openActivitySearchParams.locationId;
2548
- }
2549
- return params;
2550
- }
2551
- removeUnusedActivityFields(activity) {
2552
- if (typeof activity.id !== 'undefined') {
2553
- delete activity.id;
2554
- }
2555
- if (typeof activity.file !== 'undefined' && !activity.file) {
2556
- delete activity.file;
2557
- }
2558
- if (typeof activity.invite_last_response_date !== 'undefined' && !activity.invite_last_response_date) {
2559
- delete activity.invite_last_response_date;
2560
- }
2561
- return activity;
2562
- }
2563
- }
2564
- ActivityService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ActivityService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
2565
- ActivityService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ActivityService, providedIn: 'root' });
2566
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ActivityService, decorators: [{
2567
- type: Injectable,
2568
- args: [{
2569
- providedIn: 'root'
2570
- }]
2571
- }], ctorParameters: function () { return [{ type: ApiService }]; } });
2572
-
2573
- const CLUB_BOOKABLES_PATH = ':clubId/activities/bookables/';
2574
- const CLUB_BOOKABLE_PATH = ':clubId/activities/bookables/:bookableId/';
2575
- const CLUB_BOOKABLE_GROUPS_PATH = ':clubId/activities/bookables/groups/';
2576
- const CLUB_BOOKABLE_GROUP_PATH = ':clubId/activities/bookables/groups/:groupId/';
2577
- const CLUB_BOOKABLE_TAGS_PATH = ':clubId/activities/bookables/tags/';
2578
- const CLUB_BOOKABLE_TAG_PATH = ':clubId/activities/bookables/tags/:tagId/';
2579
- const CLUB_BOOKABLE_PARTS_PATH = ':clubId/activities/bookables/:bookableId/parts/';
2580
- const TEAM_BOOKABLES_PATH = ':teamId/activities/bookables/';
2581
- const TEAM_BOOKABLE_GROUPS_PATH = ':teamId/activities/bookables/groups/';
2582
- const TEAM_BOOKABLE_TAGS_PATH = ':teamId/activities/bookables/tags/';
2583
- const TEAM_BOOKABLE_PARTS_PATH = ':teamId/activities/bookables/:bookableId/parts/';
2584
- const SECTION_BOOKABLES_PATH = ':sectionId/activities/bookables/';
2585
- const SECTION_BOOKABLE_PATH = ':sectionId/activities/bookables/:bookableId/';
2586
- const SECTION_BOOKABLE_GROUPS_PATH = ':sectionId/activities/bookables/groups/';
2587
- const SECTION_BOOKABLE_GROUP_PATH = ':sectionId/activities/bookables/groups/:groupId/';
2588
- const SECTION_BOOKABLE_TAGS_PATH = ':sectionId/activities/bookables/tags/';
2589
- const SECTION_BOOKABLE_TAG_PATH = ':sectionId/activities/bookables/tags/:tagId/';
2590
- const SECTION_BOOKABLE_PARTS_PATH = ':sectionId/activities/bookables/:bookableId/parts/';
2591
- class BookableService {
2592
- constructor(apiService) {
2593
- this.apiService = apiService;
2594
- }
2595
- // region Bookable Items
2596
- getBookableItems(role, clubOrSectionOrTeamId) {
2597
- if (role == Role.ClubAdmin) {
2598
- return this.getClubBookableItems(clubOrSectionOrTeamId);
2599
- }
2600
- else if (role == Role.SectionAdmin) {
2601
- return this.getSectionBookableItems(clubOrSectionOrTeamId);
2602
- }
2603
- return this.getTeamBookableItems(clubOrSectionOrTeamId);
2604
- }
2605
- getTeamBookableItems(teamId) {
2606
- return this.apiService
2607
- .getCollection(bookableItemFactory, Role.TeamAdmin, TEAM_BOOKABLES_PATH, { teamId }, { params: { limit: 'null' } });
2608
- }
2609
- getClubBookableItems(clubId) {
2610
- return this.apiService
2611
- .getCollection(bookableItemFactory, Role.ClubAdmin, CLUB_BOOKABLES_PATH, { clubId }, { params: { limit: 'null' } });
2612
- }
2613
- getSectionBookableItems(sectionId) {
2614
- return this.apiService
2615
- .getCollection(bookableItemFactory, Role.SectionAdmin, SECTION_BOOKABLES_PATH, { sectionId }, { params: { limit: 'null' } });
2616
- }
2617
- updateBookableItem(role, clubOrSectionOrTeamId, bookableItem) {
2618
- if (role === Role.ClubAdmin) {
2619
- return this.updateClubBookableItem(clubOrSectionOrTeamId, bookableItem);
2620
- }
2621
- return this.updateSectionBookableItem(clubOrSectionOrTeamId, bookableItem);
2622
- }
2623
- updateClubBookableItem(clubId, bookableItem) {
2624
- return this.apiService
2625
- .updateResource(bookableItemFactory, Role.ClubAdmin, CLUB_BOOKABLE_PATH, {
2626
- clubId,
2627
- bookableId: bookableItem.id
2628
- }, bookableItem);
2629
- }
2630
- updateSectionBookableItem(sectionId, bookableItem) {
2631
- return this.apiService
2632
- .updateResource(bookableItemFactory, Role.SectionAdmin, SECTION_BOOKABLE_PATH, {
2633
- sectionId,
2634
- bookableId: bookableItem.id
2635
- }, bookableItem);
2636
- }
2637
- createBookableItem(role, clubOrSectionOrTeamId, bookableItem) {
2638
- if (role === Role.ClubAdmin) {
2639
- return this.createClubBookableItem(clubOrSectionOrTeamId, bookableItem);
2640
- }
2641
- return this.createSectionBookableItem(clubOrSectionOrTeamId, bookableItem);
2642
- }
2643
- createClubBookableItem(clubId, bookableItem) {
2644
- delete bookableItem.id;
2645
- return this.apiService
2646
- .postResource(bookableItemFactory, Role.ClubAdmin, CLUB_BOOKABLES_PATH, {
2647
- clubId,
2648
- }, bookableItem);
2649
- }
2650
- createSectionBookableItem(sectionId, bookableItem) {
2651
- delete bookableItem.id;
2652
- return this.apiService
2653
- .postResource(bookableItemFactory, Role.SectionAdmin, SECTION_BOOKABLES_PATH, {
2654
- sectionId,
2655
- }, bookableItem);
2656
- }
2657
- // endregion
2658
- // region Bookable Groups
2659
- getBookableGroups(role, clubOrSectionOrTeamId) {
2660
- if (role == Role.ClubAdmin) {
2661
- return this.getClubBookableGroups(clubOrSectionOrTeamId);
2662
- }
2663
- else if (role == Role.SectionAdmin) {
2664
- return this.getSectionBookableGroups(clubOrSectionOrTeamId);
2665
- }
2666
- return this.getTeamBookableGroups(clubOrSectionOrTeamId);
2667
- }
2668
- getClubBookableGroups(clubId) {
2669
- return this.apiService
2670
- .getCollection(bookableGroupFactory, Role.ClubAdmin, CLUB_BOOKABLE_GROUPS_PATH, { clubId }, { params: { limit: 'null' } });
2671
- }
2672
- getSectionBookableGroups(sectionId) {
2673
- return this.apiService
2674
- .getCollection(bookableGroupFactory, Role.SectionAdmin, SECTION_BOOKABLE_GROUPS_PATH, { sectionId }, { params: { limit: 'null' } });
2675
- }
2676
- getTeamBookableGroups(teamId) {
2677
- return this.apiService
2678
- .getCollection(bookableGroupFactory, Role.TeamAdmin, TEAM_BOOKABLE_GROUPS_PATH, { teamId }, { params: { limit: 'null' } });
2679
- }
2680
- updateBookableGroup(role, clubOrSectionOrTeamId, bookableGroup) {
2681
- if (role === Role.ClubAdmin) {
2682
- return this.updateClubBookableGroup(clubOrSectionOrTeamId, bookableGroup);
2683
- }
2684
- return this.updateSectionBookableGroup(clubOrSectionOrTeamId, bookableGroup);
2685
- }
2686
- updateClubBookableGroup(clubId, bookableGroup) {
2687
- return this.apiService
2688
- .updateResource(bookableGroupFactory, Role.ClubAdmin, CLUB_BOOKABLE_GROUP_PATH, {
2689
- clubId,
2690
- groupId: bookableGroup.id
2691
- }, bookableGroup);
2692
- }
2693
- updateSectionBookableGroup(sectionId, bookableGroup) {
2694
- return this.apiService
2695
- .updateResource(bookableGroupFactory, Role.SectionAdmin, SECTION_BOOKABLE_GROUP_PATH, {
2696
- sectionId,
2697
- groupId: bookableGroup.id
2698
- }, bookableGroup);
2699
- }
2700
- createBookableGroup(role, clubOrSectionOrTeamId, bookableGroup) {
2701
- if (role === Role.ClubAdmin) {
2702
- return this.createClubBookableGroup(clubOrSectionOrTeamId, bookableGroup);
2703
- }
2704
- return this.createSectionBookableGroup(clubOrSectionOrTeamId, bookableGroup);
2705
- }
2706
- createClubBookableGroup(clubId, bookableGroup) {
2707
- delete bookableGroup.id;
2708
- return this.apiService
2709
- .postResource(bookableGroupFactory, Role.ClubAdmin, CLUB_BOOKABLE_GROUPS_PATH, {
2710
- clubId,
2711
- }, bookableGroup);
2712
- }
2713
- createSectionBookableGroup(sectionId, bookableGroup) {
2714
- delete bookableGroup.id;
2715
- return this.apiService
2716
- .postResource(bookableGroupFactory, Role.SectionAdmin, SECTION_BOOKABLE_GROUPS_PATH, {
2717
- sectionId,
2718
- }, bookableGroup);
2719
- }
2720
- // endregion
2721
- // region Bookable Tags
2722
- getBookableTags(role, clubOrSectionOrTeamId) {
2723
- if (role == Role.ClubAdmin) {
2724
- return this.getClubBookableTags(clubOrSectionOrTeamId);
2725
- }
2726
- else if (role == Role.SectionAdmin) {
2727
- return this.getSectionBookableTags(clubOrSectionOrTeamId);
2728
- }
2729
- return this.getTeamBookableTags(clubOrSectionOrTeamId);
2730
- }
2731
- getClubBookableTags(clubId) {
2732
- return this.apiService
2733
- .getCollection(bookableTagFactory, Role.ClubAdmin, CLUB_BOOKABLE_TAGS_PATH, { clubId }, { params: { limit: 'null' } });
2734
- }
2735
- getSectionBookableTags(sectionId) {
2736
- return this.apiService
2737
- .getCollection(bookableTagFactory, Role.SectionAdmin, SECTION_BOOKABLE_TAGS_PATH, { sectionId }, { params: { limit: 'null' } });
2738
- }
2739
- getTeamBookableTags(teamId) {
2740
- return this.apiService
2741
- .getCollection(bookableTagFactory, Role.TeamAdmin, TEAM_BOOKABLE_TAGS_PATH, { teamId }, { params: { limit: 'null' } });
2742
- }
2743
- createBookableTag(role, clubOrSectionOrTeamId, tag) {
2744
- if (role == Role.ClubAdmin) {
2745
- return this.createClubBookableTag(clubOrSectionOrTeamId, tag);
2746
- }
2747
- else if (role == Role.SectionAdmin) {
2748
- return this.createSectionBookableTag(clubOrSectionOrTeamId, tag);
2749
- }
2750
- return this.createTeamBookableTag(clubOrSectionOrTeamId, tag);
2751
- }
2752
- createClubBookableTag(clubId, tag) {
2753
- delete tag.id;
2754
- return this.apiService
2755
- .postResource(bookableTagFactory, Role.ClubAdmin, CLUB_BOOKABLE_TAGS_PATH, {
2756
- clubId,
2757
- }, tag);
2758
- }
2759
- createSectionBookableTag(sectionId, tag) {
2760
- delete tag.id;
2761
- return this.apiService
2762
- .postResource(bookableTagFactory, Role.SectionAdmin, SECTION_BOOKABLE_TAGS_PATH, {
2763
- sectionId,
2764
- }, tag);
2765
- }
2766
- createTeamBookableTag(teamId, tag) {
2767
- delete tag.id;
2768
- return this.apiService
2769
- .postResource(bookableTagFactory, Role.TeamAdmin, TEAM_BOOKABLE_TAGS_PATH, {
2770
- teamId,
2771
- }, tag);
2772
- }
2773
- updateBookableTag(role, clubOrSectionOrTeamId, tag) {
2774
- if (role == Role.ClubAdmin) {
2775
- return this.updateClubBookableTag(clubOrSectionOrTeamId, tag);
2776
- }
2777
- return this.updateSectionBookableTag(clubOrSectionOrTeamId, tag);
2778
- }
2779
- updateClubBookableTag(clubId, tag) {
2780
- return this.apiService
2781
- .updateResource(bookableTagFactory, Role.ClubAdmin, CLUB_BOOKABLE_TAG_PATH, {
2782
- clubId,
2783
- tagId: tag.id,
2784
- }, tag);
2785
- }
2786
- updateSectionBookableTag(sectionId, tag) {
2787
- return this.apiService
2788
- .updateResource(bookableTagFactory, Role.SectionAdmin, SECTION_BOOKABLE_TAG_PATH, {
2789
- sectionId,
2790
- tagId: tag.id,
2791
- }, tag);
2792
- }
2793
- deleteBookableTag(role, clubOrSectionOrTeamId, tag) {
2794
- if (role == Role.ClubAdmin) {
2795
- return this.deleteClubBookableTag(clubOrSectionOrTeamId, tag);
2796
- }
2797
- return this.deleteSectionBookableTag(clubOrSectionOrTeamId, tag);
2798
- }
2799
- deleteClubBookableTag(clubId, tag) {
2800
- return this.apiService
2801
- .deleteResource(Role.ClubAdmin, CLUB_BOOKABLE_TAG_PATH, {
2802
- clubId,
2803
- tagId: tag.id,
2804
- });
2805
- }
2806
- deleteSectionBookableTag(sectionId, tag) {
2807
- return this.apiService
2808
- .deleteResource(Role.SectionAdmin, SECTION_BOOKABLE_TAG_PATH, {
2809
- sectionId,
2810
- tagId: tag.id,
2811
- });
2812
- }
2813
- // endregion
2814
- // region Bookable Parts
2815
- getBookableParts(role, clubOrSectionOrTeamId, bookableId) {
2816
- if (role == Role.ClubAdmin) {
2817
- return this.getClubBookableParts(clubOrSectionOrTeamId, bookableId);
2818
- }
2819
- else if (role == Role.SectionAdmin) {
2820
- return this.getSectionBookableParts(clubOrSectionOrTeamId, bookableId);
2821
- }
2822
- return this.getTeamBookableParts(clubOrSectionOrTeamId, bookableId);
2823
- }
2824
- getClubBookableParts(clubId, bookableId) {
2825
- return this.apiService
2826
- .getCollection(bookablePartFactory, Role.ClubAdmin, CLUB_BOOKABLE_PARTS_PATH, { clubId, bookableId }, { params: { limit: 'null' } });
2827
- }
2828
- getSectionBookableParts(sectionId, bookableId) {
2829
- return this.apiService
2830
- .getCollection(bookablePartFactory, Role.SectionAdmin, SECTION_BOOKABLE_PARTS_PATH, { sectionId, bookableId }, { params: { limit: 'null' } });
2831
- }
2832
- getTeamBookableParts(teamId, bookableId) {
2833
- return this.apiService
2834
- .getCollection(bookablePartFactory, Role.TeamAdmin, TEAM_BOOKABLE_PARTS_PATH, { teamId, bookableId }, { params: { limit: 'null' } });
2835
- }
2836
- }
2837
- BookableService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: BookableService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
2838
- BookableService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: BookableService, providedIn: 'root' });
2839
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: BookableService, decorators: [{
2840
- type: Injectable,
2841
- args: [{
2842
- providedIn: 'root'
2843
- }]
2844
- }], ctorParameters: function () { return [{ type: ApiService }]; } });
2845
-
2846
- const CLUB_BOOKING_CALENDARS_PATH = ':clubId/activities/calendars/';
2847
- const CLUB_BOOKING_CALENDAR_PATH = ':clubId/activities/calendars/:id/';
2848
- const CLUB_BOOKING_CALENDAR_SLOTS_PATH = ':clubId/activities/slots/';
2849
- const CLUB_BOOKING_CALENDAR_SLOTS_APPLICATION_TIMES_PATH = ':clubId/activities/slots/application-times/';
2850
- const CLUB_BOOKING_CALENDAR_SLOTS_COPY_PATH = ':clubId/activities/slots/copy/';
2851
- const CLUB_BOOKING_CALENDAR_SLOTS_CLEAR_PATH = ':clubId/activities/slots/clear/';
2852
- const CLUB_BOOKING_CALENDAR_SLOTS_SYNC_PATH = ':clubId/activities/slots/sync/';
2853
- const CLUB_BOOKING_CALENDAR_SLOT_PATH = ':clubId/activities/slots/:id/';
2854
- const CLUB_BOOKING_CALENDAR_REPEATABLE_SLOT_PATH = ':clubId/activities/slots/:id/all/';
2855
- const CLUB_BOOKING_CALENDAR_SLOT_SESSIONS_PATH = ':clubId/activities/sessions/';
2856
- const CLUB_BOOKING_CALENDAR_SLOT_SESSION_PATH = ':clubId/activities/sessions/:id/';
2857
- const CLUB_BOOKING_CALENDAR_REPEATABLE_SESSION_PATH = ':clubId/activities/sessions/:id/all/';
2858
- const CLUB_BOOKING_SETTINGS_PATH = ':clubId/activities/booking-settings/';
2859
- const CLUB_BOOKING_CALENDAR_APPLICATION_TIME_PATH = ':clubId/activities/application-times/:id/';
2860
- const CLUB_BOOKING_CALENDAR_APPLICATION_TIMES_PATH = ':clubId/activities/application-times/';
2861
- const CLUB_BOOKING_OVERBOOKED_SESSIONS_PATH = ':clubId/activities/overbooked/sessions/';
2862
- const CLUB_BOOKING_OVERBOOKED_BOOKABLES_PATH = ':clubId/activities/overbooked/bookables/';
2863
- const SECTION_BOOKING_CALENDARS_PATH = ':sectionId/activities/calendars/';
2864
- const SECTION_BOOKING_CALENDAR_PATH = ':sectionId/activities/calendars/:id/';
2865
- const SECTION_BOOKING_CALENDAR_SLOTS_PATH = ':sectionId/activities/slots/';
2866
- const SECTION_BOOKING_CALENDAR_SLOTS_APPLICATION_TIMES_PATH = ':sectionId/activities/slots/application-times/';
2867
- const SECTION_BOOKING_CALENDAR_SLOTS_COPY_PATH = ':sectionId/activities/slots/copy/';
2868
- const SECTION_BOOKING_CALENDAR_SLOTS_CLEAR_PATH = ':sectionId/activities/slots/clear/';
2869
- const SECTION_BOOKING_CALENDAR_SLOTS_SYNC_PATH = ':sectionId/activities/slots/sync/';
2870
- const SECTION_BOOKING_CALENDAR_SLOT_PATH = ':sectionId/activities/slots/:id/';
2871
- const SECTION_BOOKING_CALENDAR_REPEATABLE_SLOT_PATH = ':sectionId/activities/slots/:id/all/';
2872
- const SECTION_BOOKING_CALENDAR_SLOT_SESSIONS_PATH = ':sectionId/activities/sessions/';
2873
- const SECTION_BOOKING_CALENDAR_SLOT_SESSION_PATH = ':sectionId/activities/sessions/:id/';
2874
- const SECTION_BOOKING_CALENDAR_REPEATABLE_SESSION_PATH = ':sectionId/activities/sessions/:id/all/';
2875
- const SECTION_BOOKING_SETTINGS_PATH = ':sectionId/activities/booking-settings/';
2876
- const SECTION_BOOKING_CALENDAR_APPLICATION_TIME_PATH = ':sectionId/activities/application-times/:id/';
2877
- const SECTION_BOOKING_CALENDAR_APPLICATION_TIMES_PATH = ':sectionId/activities/application-times/';
2878
- const SECTION_BOOKING_OVERBOOKED_SESSIONS_PATH = ':sectionId/activities/overbooked/sessions/';
2879
- const SECTION_BOOKING_OVERBOOKED_BOOKABLES_PATH = ':sectionId/activities/overbooked/bookables/';
2880
- const TEAM_BOOKING_CALENDARS_PATH = ':teamId/activities/calendars/';
2881
- const TEAM_BOOKING_CALENDAR_SLOTS_PATH = ':teamId/activities/slots/';
2882
- const TEAM_BOOKING_CALENDAR_SLOTS_SYNC_PATH = ':teamId/activities/slots/sync/';
2883
- const TEAM_BOOKING_CALENDAR_SLOTS_APPLICATION_TIMES_PATH = ':teamId/activities/slots/application-times/';
2884
- const TEAM_BOOKING_SETTINGS_PATH = ':teamId/activities/booking-settings/';
2885
- const TEAM_BOOKING_CALENDAR_SLOT_SESSIONS_PATH = ':teamId/activities/sessions/';
2886
- const TEAM_BOOKING_CALENDAR_SLOT_SESSION_PATH = ':teamId/activities/sessions/:id/';
2887
- const TEAM_BOOKING_CALENDAR_SLOT_PATH = ':teamId/activities/slots/:id/';
2888
- const TEAM_BOOKING_CALENDAR_APPLICATION_TIMES_PATH = ':teamId/activities/application-times/';
2889
- const TEAM_BOOKING_CALENDAR_APPLICATION_TIME_PATH = ':teamId/activities/application-times/:id/';
2890
- class BookingSlotFilter {
2891
- constructor(startDate = null, endDate = null, calendarIds = [], locationIds = [], bookableItemIds = [], tagIds = [], teamIds = [], bookableGroupIds = [], activityTypeIds = [], hasOpenSessions = null, showApplicationTimes = null, sortBy = null) {
2892
- this.startDate = startDate;
2893
- this.endDate = endDate;
2894
- this.calendarIds = calendarIds;
2895
- this.locationIds = locationIds;
2896
- this.bookableItemIds = bookableItemIds;
2897
- this.tagIds = tagIds;
2898
- this.teamIds = teamIds;
2899
- this.bookableGroupIds = bookableGroupIds;
2900
- this.activityTypeIds = activityTypeIds;
2901
- this.hasOpenSessions = hasOpenSessions;
2902
- this.showApplicationTimes = showApplicationTimes;
2903
- this.sortBy = sortBy;
2904
- }
2905
- static fromFilter(filter) {
2906
- return new this(filter.startDate, filter.endDate, filter.calendarIds, filter.locationIds, filter.bookableItemIds, filter.tagIds, filter.teamIds, filter.bookableGroupIds, filter.activityTypeIds, filter.hasOpenSessions, filter.showApplicationTimes, filter.sortBy);
2907
- }
2908
- toParams() {
2909
- const params = { limit: 'null' };
2910
- if (this.startDate) {
2911
- params['day__gte'] = this.startDate;
2912
- }
2913
- if (this.endDate) {
2914
- params['day__lte'] = this.endDate;
2915
- }
2916
- if (this.calendarIds && this.calendarIds.length) {
2917
- params['calendar_id'] = this.calendarIds.join(',');
2918
- }
2919
- if (this.locationIds && this.locationIds.length) {
2920
- params['location_id'] = this.locationIds.join(',');
2921
- }
2922
- if (this.bookableItemIds && this.bookableItemIds.length) {
2923
- params['bookable_id'] = this.bookableItemIds.join(',');
2924
- }
2925
- if (this.bookableGroupIds && this.bookableGroupIds.length) {
2926
- params['bookable_group_id'] = this.bookableGroupIds.join(',');
2927
- }
2928
- if (this.tagIds && this.tagIds.length) {
2929
- params['bookable_tag_id'] = this.tagIds.join(',');
2930
- }
2931
- if (this.teamIds && this.teamIds.length) {
2932
- params['team_id'] = this.teamIds.join(',');
2933
- }
2934
- if (this.activityTypeIds && this.activityTypeIds.length) {
2935
- params["activity_type_id"] = this.activityTypeIds.join(",");
2936
- }
2937
- if (typeof this.hasOpenSessions === 'boolean') {
2938
- params['has_open_sessions'] = String(this.hasOpenSessions);
2939
- }
2940
- if (typeof this.showApplicationTimes === 'boolean') {
2941
- params['show_application_times'] = String(this.showApplicationTimes);
2942
- }
2943
- if (this.sortBy) {
2944
- params['order'] = this.sortBy;
2945
- }
2946
- return params;
2947
- }
2948
- }
2949
- class BookingCalendarService {
2950
- constructor(apiService) {
2951
- this.apiService = apiService;
2952
- }
2953
- // region Booking calendar
2954
- createBookingCalendar(role, clubOrSectionOrTeamId, calendar) {
2955
- if (role === Role.ClubAdmin) {
2956
- return this.createClubBookingCalendar(clubOrSectionOrTeamId, calendar);
2957
- }
2958
- return this.createSectionBookingCalendar(clubOrSectionOrTeamId, calendar);
2959
- }
2960
- createClubBookingCalendar(clubId, calendar) {
2961
- delete calendar.id;
2962
- return this.apiService
2963
- .postResource(bookingCalendarFactory, Role.ClubAdmin, CLUB_BOOKING_CALENDARS_PATH, {
2964
- clubId,
2965
- }, calendar);
2966
- }
2967
- createSectionBookingCalendar(sectionId, calendar) {
2968
- delete calendar.id;
2969
- return this.apiService
2970
- .postResource(bookingCalendarFactory, Role.SectionAdmin, SECTION_BOOKING_CALENDARS_PATH, {
2971
- sectionId,
2972
- }, calendar);
2973
- }
2974
- getBookingCalendars(role, clubOrSectionOrTeamId, name = null) {
2975
- if (role == Role.ClubAdmin) {
2976
- return this.getClubBookingCalendars(clubOrSectionOrTeamId, name);
2977
- }
2978
- else if (role == Role.SectionAdmin) {
2979
- return this.getSectionBookingCalendars(clubOrSectionOrTeamId, name);
2980
- }
2981
- return this.getTeamBookingCalendars(clubOrSectionOrTeamId, name);
2982
- }
2983
- getClubBookingCalendars(clubId, name = null) {
2984
- const params = { limit: 'null' };
2985
- if (name) {
2986
- params['name'] = name;
2987
- }
2988
- return this.apiService
2989
- .getCollection(bookingCalendarFactory, Role.ClubAdmin, CLUB_BOOKING_CALENDARS_PATH, { clubId }, {
2990
- params
2991
- });
2992
- }
2993
- getSectionBookingCalendars(sectionId, name = null) {
2994
- const params = { limit: 'null' };
2995
- if (name) {
2996
- params['name'] = name;
2997
- }
2998
- return this.apiService
2999
- .getCollection(bookingCalendarFactory, Role.SectionAdmin, SECTION_BOOKING_CALENDARS_PATH, { sectionId }, {
3000
- params
3001
- });
3002
- }
3003
- getTeamBookingCalendars(teamId, name = null) {
3004
- const params = { limit: 'null' };
3005
- if (name) {
3006
- params['name'] = name;
3007
- }
3008
- return this.apiService
3009
- .getCollection(bookingCalendarFactory, Role.TeamAdmin, TEAM_BOOKING_CALENDARS_PATH, { teamId }, {
3010
- params
3011
- });
3012
- }
3013
- updateBookingCalendar(role, clubOrSectionOrTeamId, calendar) {
3014
- if (role === Role.ClubAdmin) {
3015
- return this.updateClubBookingCalendar(clubOrSectionOrTeamId, calendar);
3016
- }
3017
- return this.updateSectionBookingCalendar(clubOrSectionOrTeamId, calendar);
3018
- }
3019
- updateClubBookingCalendar(clubId, calendar) {
3020
- return this.apiService
3021
- .updateResource(bookingCalendarFactory, Role.ClubAdmin, CLUB_BOOKING_CALENDAR_PATH, {
3022
- clubId,
3023
- id: calendar.id
3024
- }, calendar);
3025
- }
3026
- updateSectionBookingCalendar(sectionId, calendar) {
3027
- return this.apiService
3028
- .updateResource(bookingCalendarFactory, Role.SectionAdmin, SECTION_BOOKING_CALENDAR_PATH, {
3029
- sectionId,
3030
- id: calendar.id
3031
- }, calendar);
3032
- }
3033
- deleteBookingCalendar(role, clubOrSectionOrTeamId, id) {
3034
- if (role === Role.ClubAdmin) {
3035
- return this.deleteClubBookingCalendar(clubOrSectionOrTeamId, id);
3036
- }
3037
- return this.deleteSectionBookingCalendar(clubOrSectionOrTeamId, id);
3038
- }
3039
- deleteClubBookingCalendar(clubId, id) {
3040
- return this.apiService
3041
- .deleteResource(Role.ClubAdmin, CLUB_BOOKING_CALENDAR_PATH, {
3042
- clubId,
3043
- id
3044
- });
3045
- }
3046
- deleteSectionBookingCalendar(sectionId, id) {
3047
- return this.apiService
3048
- .deleteResource(Role.SectionAdmin, SECTION_BOOKING_CALENDAR_PATH, {
3049
- sectionId,
3050
- id
3051
- });
3052
- }
3053
- // endregion
3054
- // region Booking calendar slot
3055
- createBookingCalendarSlot(role, clubOrSectionOrTeamId, slot) {
3056
- if (role === Role.ClubAdmin) {
3057
- return this.createClubBookingCalendarSlot(clubOrSectionOrTeamId, slot);
3058
- }
3059
- return this.createSectionBookingCalendarSlot(clubOrSectionOrTeamId, slot);
3060
- }
3061
- createClubBookingCalendarSlot(clubId, slot) {
3062
- delete slot.id;
3063
- return this.apiService
3064
- .postResource(bookingCalendarSlotFactory, Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOTS_PATH, {
3065
- clubId,
3066
- }, slot);
3067
- }
3068
- createSectionBookingCalendarSlot(sectionId, slot) {
3069
- delete slot.id;
3070
- return this.apiService
3071
- .postResource(bookingCalendarSlotFactory, Role.SectionAdmin, SECTION_BOOKING_CALENDAR_SLOTS_PATH, {
3072
- sectionId,
3073
- }, slot);
3074
- }
3075
- getBookingCalendarSlots(role, clubOrSectionOrTeamId, bookingSlotFilter) {
3076
- if (role == Role.ClubAdmin) {
3077
- return this.getClubBookingCalendarSlots(clubOrSectionOrTeamId, bookingSlotFilter);
3078
- }
3079
- else if (role == Role.SectionAdmin) {
3080
- return this.getSectionBookingCalendarSlots(clubOrSectionOrTeamId, bookingSlotFilter);
3081
- }
3082
- return this.getTeamBookingCalendarSlots(clubOrSectionOrTeamId, bookingSlotFilter);
3083
- }
3084
- getClubBookingCalendarSlots(clubId, bookingSlotFilter) {
3085
- const params = bookingSlotFilter.toParams();
3086
- return this.apiService
3087
- .getCollection(bookingCalendarSlotFactory, Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOTS_PATH, { clubId }, {
3088
- params
3089
- });
3090
- }
3091
- getSectionBookingCalendarSlots(sectionId, bookingSlotFilter) {
3092
- const params = bookingSlotFilter.toParams();
3093
- return this.apiService
3094
- .getCollection(bookingCalendarSlotFactory, Role.SectionAdmin, SECTION_BOOKING_CALENDAR_SLOTS_PATH, { sectionId }, {
3095
- params
3096
- });
3097
- }
3098
- getTeamBookingCalendarSlots(teamId, bookingSlotFilter) {
3099
- const params = bookingSlotFilter.toParams();
3100
- return this.apiService
3101
- .getCollection(bookingCalendarSlotFactory, Role.TeamAdmin, TEAM_BOOKING_CALENDAR_SLOTS_PATH, { teamId }, {
3102
- params
3103
- });
3104
- }
3105
- getBookingCalendarSlot(role, clubOrSectionOrTeamId, slotId) {
3106
- if (role == Role.ClubAdmin) {
3107
- return this.getClubBookingCalendarSlot(clubOrSectionOrTeamId, slotId);
3108
- }
3109
- else if (role == Role.SectionAdmin) {
3110
- return this.getSectionBookingCalendarSlot(clubOrSectionOrTeamId, slotId);
3111
- }
3112
- return this.getTeamBookingCalendarSlot(clubOrSectionOrTeamId, slotId);
3113
- }
3114
- getClubBookingCalendarSlot(clubId, slotId) {
3115
- return this.apiService
3116
- .getResource(bookingCalendarSlotFactory, Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOT_PATH, {
3117
- clubId,
3118
- id: slotId
3119
- });
3120
- }
3121
- getSectionBookingCalendarSlot(sectionId, slotId) {
3122
- return this.apiService
3123
- .getResource(bookingCalendarSlotFactory, Role.SectionAdmin, SECTION_BOOKING_CALENDAR_SLOT_PATH, {
3124
- sectionId,
3125
- id: slotId
3126
- });
3127
- }
3128
- getTeamBookingCalendarSlot(teamId, slotId) {
3129
- return this.apiService
3130
- .getResource(bookingCalendarSlotFactory, Role.TeamAdmin, TEAM_BOOKING_CALENDAR_SLOT_PATH, {
3131
- teamId,
3132
- id: slotId
3133
- });
3134
- }
3135
- getBookingCalendarApplicationTimeSlots(role, clubOrSectionOrTeamId, bookingSlotFilter) {
3136
- if (role == Role.ClubAdmin) {
3137
- return this.getClubBookingCalendarApplicationTimeSlots(clubOrSectionOrTeamId, bookingSlotFilter);
3138
- }
3139
- else if (role == Role.SectionAdmin) {
3140
- return this.getSectionBookingCalendarApplicationTimeSlots(clubOrSectionOrTeamId, bookingSlotFilter);
3141
- }
3142
- return this.getTeamBookingCalendarApplicationTimeSlots(clubOrSectionOrTeamId, bookingSlotFilter);
3143
- }
3144
- getClubBookingCalendarApplicationTimeSlots(clubId, bookingSlotFilter) {
3145
- const params = bookingSlotFilter.toParams();
3146
- return this.apiService
3147
- .getCollection(bookingCalendarSlotFactory, Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOTS_APPLICATION_TIMES_PATH, { clubId }, {
3148
- params
3149
- });
3150
- }
3151
- getSectionBookingCalendarApplicationTimeSlots(sectionId, bookingSlotFilter) {
3152
- const params = bookingSlotFilter.toParams();
3153
- return this.apiService
3154
- .getCollection(bookingCalendarSlotFactory, Role.SectionAdmin, SECTION_BOOKING_CALENDAR_SLOTS_APPLICATION_TIMES_PATH, { sectionId }, {
3155
- params
3156
- });
3157
- }
3158
- getTeamBookingCalendarApplicationTimeSlots(teamId, bookingSlotFilter) {
3159
- const params = bookingSlotFilter.toParams();
3160
- return this.apiService
3161
- .getCollection(bookingCalendarSlotFactory, Role.TeamAdmin, TEAM_BOOKING_CALENDAR_SLOTS_APPLICATION_TIMES_PATH, { teamId }, {
3162
- params
3163
- });
3164
- }
3165
- getBookingCalendarApplicationTimes(role, clubOrSectionOrTeamId, bookingSlotFilter) {
3166
- if (role == Role.ClubAdmin) {
3167
- return this.getClubBookingCalendarApplicationTimes(clubOrSectionOrTeamId, bookingSlotFilter);
3168
- }
3169
- else if (role == Role.SectionAdmin) {
3170
- return this.getSectionBookingCalendarApplicationTimes(clubOrSectionOrTeamId, bookingSlotFilter);
3171
- }
3172
- return this.getTeamBookingCalendarApplicationTimes(clubOrSectionOrTeamId, bookingSlotFilter);
3173
- }
3174
- getClubBookingCalendarApplicationTimes(clubId, bookingSlotFilter) {
3175
- const params = bookingSlotFilter.toParams();
3176
- return this.apiService
3177
- .getCollection(bookingCalendarApplicationTimeFactory, Role.ClubAdmin, CLUB_BOOKING_CALENDAR_APPLICATION_TIMES_PATH, { clubId }, {
3178
- params
3179
- });
3180
- }
3181
- getSectionBookingCalendarApplicationTimes(sectionId, bookingSlotFilter) {
3182
- const params = bookingSlotFilter.toParams();
3183
- return this.apiService
3184
- .getCollection(bookingCalendarApplicationTimeFactory, Role.SectionAdmin, SECTION_BOOKING_CALENDAR_APPLICATION_TIMES_PATH, { sectionId }, {
3185
- params
3186
- });
3187
- }
3188
- getTeamBookingCalendarApplicationTimes(teamId, bookingSlotFilter) {
3189
- const params = bookingSlotFilter.toParams();
3190
- return this.apiService
3191
- .getCollection(bookingCalendarApplicationTimeFactory, Role.TeamAdmin, TEAM_BOOKING_CALENDAR_APPLICATION_TIMES_PATH, { teamId }, {
3192
- params
3193
- });
3194
- }
3195
- copyBookingCalendarSlots(role, clubOrSectionOrTeamId, weekRelativeIndexes, onlyCopySlots = false, weekdays = [], bookingSlotFilter) {
3196
- if (role === Role.ClubAdmin) {
3197
- return this.copyClubBookingCalendarSlots(clubOrSectionOrTeamId, weekRelativeIndexes, onlyCopySlots, weekdays, bookingSlotFilter);
3198
- }
3199
- return this.copySectionBookingCalendarSlots(clubOrSectionOrTeamId, weekRelativeIndexes, onlyCopySlots, weekdays, bookingSlotFilter);
3200
- }
3201
- copyClubBookingCalendarSlots(clubId, weekRelativeIndexes, onlyCopySlots = false, weekdays = [], bookingSlotFilter) {
3202
- const params = bookingSlotFilter.toParams();
3203
- return this.apiService
3204
- .postResourceNoResponse(Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOTS_COPY_PATH, { clubId }, {
3205
- week_relative_indexes: weekRelativeIndexes,
3206
- only_copy_slots: onlyCopySlots,
3207
- weekdays: weekdays,
3208
- }, {
3209
- params
3210
- });
3211
- }
3212
- copySectionBookingCalendarSlots(sectionId, weekRelativeIndexes, onlyCopySlots = false, weekdays = [], bookingSlotFilter) {
3213
- const params = bookingSlotFilter.toParams();
3214
- return this.apiService
3215
- .postResourceNoResponse(Role.SectionAdmin, SECTION_BOOKING_CALENDAR_SLOTS_COPY_PATH, { sectionId }, {
3216
- week_relative_indexes: weekRelativeIndexes,
3217
- only_copy_slots: onlyCopySlots,
3218
- weekdays: weekdays,
3219
- }, {
3220
- params
3221
- });
3222
- }
3223
- clearBookingCalendarSlots(role, clubOrSectionOrTeamId, currentWeekStartDate, weekRelativeIndexes, onlyDeleteSessions = false, shouldDeleteRepeatingSlots = false, weekdays = [], bookingSlotFilter) {
3224
- if (role === Role.ClubAdmin) {
3225
- return this.clearClubBookingCalendarSlots(clubOrSectionOrTeamId, currentWeekStartDate, weekRelativeIndexes, onlyDeleteSessions, shouldDeleteRepeatingSlots, weekdays, bookingSlotFilter);
3226
- }
3227
- return this.clearSectionBookingCalendarSlots(clubOrSectionOrTeamId, currentWeekStartDate, weekRelativeIndexes, onlyDeleteSessions, shouldDeleteRepeatingSlots, weekdays, bookingSlotFilter);
3228
- }
3229
- clearClubBookingCalendarSlots(clubId, currentWeekStartDate, weekRelativeIndexes, onlyDeleteSessions = false, shouldDeleteRepeatingSlots = false, weekdays = [], bookingSlotFilter) {
3230
- const params = bookingSlotFilter.toParams();
3231
- return this.apiService
3232
- .deleteResourceWithBody(Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOTS_CLEAR_PATH, { clubId }, {
3233
- body: {
3234
- current_week_start_date: currentWeekStartDate,
3235
- week_relative_indexes: weekRelativeIndexes,
3236
- only_delete_sessions: onlyDeleteSessions,
3237
- should_delete_repeating_slots: shouldDeleteRepeatingSlots,
3238
- weekdays: weekdays,
3239
- },
3240
- params,
3241
- });
3242
- }
3243
- clearSectionBookingCalendarSlots(sectionId, currentWeekStartDate, weekRelativeIndexes, onlyDeleteSessions = false, shouldDeleteRepeatingSlots = false, weekdays = [], bookingSlotFilter) {
3244
- const params = bookingSlotFilter.toParams();
3245
- return this.apiService
3246
- .deleteResourceWithBody(Role.SectionAdmin, SECTION_BOOKING_CALENDAR_SLOTS_CLEAR_PATH, { sectionId }, {
3247
- body: {
3248
- current_week_start_date: currentWeekStartDate,
3249
- week_relative_indexes: weekRelativeIndexes,
3250
- only_delete_sessions: onlyDeleteSessions,
3251
- should_delete_repeating_slots: shouldDeleteRepeatingSlots,
3252
- weekdays: weekdays,
3253
- },
3254
- params,
3255
- });
3256
- }
3257
- syncBookingCalendarSlots(role, clubOrSectionOrTeamId, currentWeekStartDate, weekRelativeIndexes, bookingSlotFilter) {
3258
- if (role == Role.ClubAdmin) {
3259
- return this.syncClubBookingCalendarSlots(clubOrSectionOrTeamId, currentWeekStartDate, weekRelativeIndexes, bookingSlotFilter);
3260
- }
3261
- else if (role == Role.SectionAdmin) {
3262
- return this.syncSectionBookingCalendarSlots(clubOrSectionOrTeamId, currentWeekStartDate, weekRelativeIndexes, bookingSlotFilter);
3263
- }
3264
- return this.syncTeamBookingCalendarSlots(clubOrSectionOrTeamId, currentWeekStartDate, weekRelativeIndexes, bookingSlotFilter);
3265
- }
3266
- syncClubBookingCalendarSlots(clubId, currentWeekStartDate, weekRelativeIndexes, bookingSlotFilter) {
3267
- const params = bookingSlotFilter.toParams();
3268
- return this.apiService
3269
- .postResourceNoResponse(Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOTS_SYNC_PATH, { clubId }, {
3270
- current_week_start_date: currentWeekStartDate,
3271
- week_relative_indexes: weekRelativeIndexes,
3272
- }, { params });
3273
- }
3274
- syncSectionBookingCalendarSlots(sectionId, currentWeekStartDate, weekRelativeIndexes, bookingSlotFilter) {
3275
- const params = bookingSlotFilter.toParams();
3276
- return this.apiService
3277
- .postResourceNoResponse(Role.SectionAdmin, SECTION_BOOKING_CALENDAR_SLOTS_SYNC_PATH, { sectionId }, {
3278
- current_week_start_date: currentWeekStartDate,
3279
- week_relative_indexes: weekRelativeIndexes,
3280
- }, { params });
3281
- }
3282
- syncTeamBookingCalendarSlots(teamId, currentWeekStartDate, weekRelativeIndexes, bookingSlotFilter) {
3283
- const params = bookingSlotFilter.toParams();
3284
- return this.apiService
3285
- .postResourceNoResponse(Role.TeamAdmin, TEAM_BOOKING_CALENDAR_SLOTS_SYNC_PATH, { teamId }, {
3286
- current_week_start_date: currentWeekStartDate,
3287
- week_relative_indexes: weekRelativeIndexes,
3288
- }, { params });
3289
- }
3290
- updateBookingCalendarSlot(role, clubOrSectionOrTeamId, slot) {
3291
- if (role === Role.ClubAdmin) {
3292
- return this.updateClubBookingCalendarSlot(clubOrSectionOrTeamId, slot);
3293
- }
3294
- return this.updateSectionBookingCalendarSlot(clubOrSectionOrTeamId, slot);
3295
- }
3296
- updateClubBookingCalendarSlot(clubId, slot) {
3297
- return this.apiService
3298
- .updateResource(bookingCalendarSlotFactory, Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOT_PATH, {
3299
- clubId,
3300
- id: slot.id
3301
- }, slot);
3302
- }
3303
- updateSectionBookingCalendarSlot(sectionId, slot) {
3304
- return this.apiService
3305
- .updateResource(bookingCalendarSlotFactory, Role.SectionAdmin, SECTION_BOOKING_CALENDAR_SLOT_PATH, {
3306
- sectionId,
3307
- id: slot.id
3308
- }, slot);
3309
- }
3310
- deleteBookingCalendarSlot(role, clubOrSectionOrTeamId, id) {
3311
- if (role === Role.ClubAdmin) {
3312
- return this.deleteClubBookingCalendarSlot(clubOrSectionOrTeamId, id);
3313
- }
3314
- return this.deleteSectionBookingCalendarSlot(clubOrSectionOrTeamId, id);
3315
- }
3316
- deleteClubBookingCalendarSlot(clubId, id) {
3317
- return this.apiService
3318
- .deleteResource(Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOT_PATH, {
3319
- clubId,
3320
- id
3321
- });
3322
- }
3323
- deleteSectionBookingCalendarSlot(sectionId, id) {
3324
- return this.apiService
3325
- .deleteResource(Role.SectionAdmin, SECTION_BOOKING_CALENDAR_SLOT_PATH, {
3326
- sectionId,
3327
- id
3328
- });
3329
- }
3330
- deleteBookingCalendarSlotRepeatable(role, clubOrSectionOrTeamId, id, deleteUntilDate) {
3331
- if (role === Role.ClubAdmin) {
3332
- return this.deleteClubBookingCalendarSlotRepeatable(clubOrSectionOrTeamId, id, deleteUntilDate);
3333
- }
3334
- return this.deleteSectionBookingCalendarSlotRepeatable(clubOrSectionOrTeamId, id, deleteUntilDate);
3335
- }
3336
- deleteClubBookingCalendarSlotRepeatable(clubId, id, deleteUntilDate) {
3337
- return this.apiService
3338
- .deleteResourceWithBody(Role.ClubAdmin, CLUB_BOOKING_CALENDAR_REPEATABLE_SLOT_PATH, {
3339
- clubId,
3340
- id
3341
- }, { body: { delete_until_date: deleteUntilDate } });
3342
- }
3343
- deleteSectionBookingCalendarSlotRepeatable(sectionId, id, deleteUntilDate) {
3344
- return this.apiService
3345
- .deleteResourceWithBody(Role.SectionAdmin, SECTION_BOOKING_CALENDAR_REPEATABLE_SLOT_PATH, {
3346
- sectionId,
3347
- id
3348
- }, { body: { delete_until_date: deleteUntilDate } });
3349
- }
3350
- // endregion
3351
- // region Booking calendar slot session
3352
- createBookingCalendarSlotSession(role, clubOrSectionOrTeamId, session) {
3353
- if (role === Role.ClubAdmin) {
3354
- return this.createClubBookingCalendarSlotSession(clubOrSectionOrTeamId, session);
3355
- }
3356
- else if (role === Role.SectionAdmin) {
3357
- return this.createSectionBookingCalendarSlotSession(clubOrSectionOrTeamId, session);
3358
- }
3359
- return this.createTeamBookingCalendarSlotSession(clubOrSectionOrTeamId, session);
3360
- }
3361
- createClubBookingCalendarSlotSession(clubId, session) {
3362
- delete session.id;
3363
- return this.apiService
3364
- .postResource(bookingCalendarSlotSessionFactory, Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOT_SESSIONS_PATH, {
3365
- clubId,
3366
- }, session);
3367
- }
3368
- createSectionBookingCalendarSlotSession(sectionId, session) {
3369
- delete session.id;
3370
- return this.apiService
3371
- .postResource(bookingCalendarSlotSessionFactory, Role.SectionAdmin, SECTION_BOOKING_CALENDAR_SLOT_SESSIONS_PATH, {
3372
- sectionId,
3373
- }, session);
3374
- }
3375
- createTeamBookingCalendarSlotSession(teamId, session) {
3376
- delete session.id;
3377
- return this.apiService
3378
- .postResource(bookingCalendarSlotSessionFactory, Role.TeamAdmin, TEAM_BOOKING_CALENDAR_SLOT_SESSIONS_PATH, {
3379
- teamId,
3380
- }, session);
3381
- }
3382
- updateBookingCalendarSlotSession(role, clubOrSectionOrTeamId, session) {
3383
- if (role === Role.ClubAdmin) {
3384
- return this.updateClubBookingCalendarSlotSession(clubOrSectionOrTeamId, session);
3385
- }
3386
- else if (role === Role.SectionAdmin) {
3387
- return this.updateSectionBookingCalendarSlotSession(clubOrSectionOrTeamId, session);
3388
- }
3389
- return this.updateTeamBookingCalendarSlotSession(clubOrSectionOrTeamId, session);
3390
- }
3391
- updateClubBookingCalendarSlotSession(clubId, session) {
3392
- return this.apiService
3393
- .updateResource(bookingCalendarSlotSessionFactory, Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOT_SESSION_PATH, {
3394
- clubId,
3395
- id: session.id
3396
- }, session);
3397
- }
3398
- updateSectionBookingCalendarSlotSession(sectionId, session) {
3399
- return this.apiService
3400
- .updateResource(bookingCalendarSlotSessionFactory, Role.SectionAdmin, SECTION_BOOKING_CALENDAR_SLOT_SESSION_PATH, {
3401
- sectionId,
3402
- id: session.id
3403
- }, session);
3404
- }
3405
- updateTeamBookingCalendarSlotSession(teamId, session) {
3406
- return this.apiService
3407
- .updateResource(bookingCalendarSlotSessionFactory, Role.TeamAdmin, TEAM_BOOKING_CALENDAR_SLOT_SESSION_PATH, {
3408
- teamId,
3409
- id: session.id
3410
- }, session);
3411
- }
3412
- deleteBookingCalendarSlotSession(role, clubOrSectionOrTeamId, id) {
3413
- if (role == Role.ClubAdmin) {
3414
- return this.deleteClubBookingCalendarSlotSession(clubOrSectionOrTeamId, id);
3415
- }
3416
- else if (role == Role.SectionAdmin) {
3417
- return this.deleteSectionBookingCalendarSlotSession(clubOrSectionOrTeamId, id);
3418
- }
3419
- return this.deleteTeamBookingCalendarSlotSession(clubOrSectionOrTeamId, id);
3420
- }
3421
- deleteClubBookingCalendarSlotSession(clubId, id) {
3422
- return this.apiService
3423
- .deleteResource(Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOT_SESSION_PATH, {
3424
- clubId,
3425
- id
3426
- });
3427
- }
3428
- deleteSectionBookingCalendarSlotSession(sectionId, id) {
3429
- return this.apiService
3430
- .deleteResource(Role.SectionAdmin, SECTION_BOOKING_CALENDAR_SLOT_SESSION_PATH, {
3431
- sectionId,
3432
- id
3433
- });
3434
- }
3435
- deleteTeamBookingCalendarSlotSession(teamId, id) {
3436
- return this.apiService
3437
- .deleteResource(Role.TeamAdmin, TEAM_BOOKING_CALENDAR_SLOT_SESSION_PATH, {
3438
- teamId,
3439
- id
3440
- });
3441
- }
3442
- deleteBookingCalendarSlotSessionRepeatable(role, clubOrSectionOrTeamId, id, deleteUntilDate) {
3443
- if (role === Role.ClubAdmin) {
3444
- return this.deleteClubBookingCalendarSlotSessionRepeatable(clubOrSectionOrTeamId, id, deleteUntilDate);
3445
- }
3446
- return this.deleteSectionBookingCalendarSlotSessionRepeatable(clubOrSectionOrTeamId, id, deleteUntilDate);
3447
- }
3448
- deleteClubBookingCalendarSlotSessionRepeatable(clubId, id, deleteUntilDate) {
3449
- return this.apiService
3450
- .deleteResourceWithBody(Role.ClubAdmin, CLUB_BOOKING_CALENDAR_REPEATABLE_SESSION_PATH, {
3451
- clubId,
3452
- id
3453
- }, { body: { delete_until_date: deleteUntilDate } });
3454
- }
3455
- deleteSectionBookingCalendarSlotSessionRepeatable(sectionId, id, deleteUntilDate) {
3456
- return this.apiService
3457
- .deleteResourceWithBody(Role.SectionAdmin, SECTION_BOOKING_CALENDAR_REPEATABLE_SESSION_PATH, {
3458
- sectionId,
3459
- id
3460
- }, { body: { delete_until_date: deleteUntilDate } });
3461
- }
3462
- // endregion
3463
- // region Booking Setting
3464
- getBookingSettings(role, clubOrSectionOrTeamId) {
3465
- if (role == Role.ClubAdmin) {
3466
- return this.getClubBookingSettings(clubOrSectionOrTeamId);
3467
- }
3468
- else if (role == Role.SectionAdmin) {
3469
- return this.getSectionBookingSettings(clubOrSectionOrTeamId);
3470
- }
3471
- return this.getTeamBookingSettings(clubOrSectionOrTeamId);
3472
- }
3473
- getClubBookingSettings(clubId) {
3474
- return this.apiService
3475
- .getResource(bookingSettingsFactory, Role.ClubAdmin, CLUB_BOOKING_SETTINGS_PATH, { clubId });
3476
- }
3477
- getSectionBookingSettings(sectionId) {
3478
- return this.apiService
3479
- .getResource(bookingSettingsFactory, Role.SectionAdmin, SECTION_BOOKING_SETTINGS_PATH, { sectionId });
3480
- }
3481
- getTeamBookingSettings(teamId) {
3482
- return this.apiService
3483
- .getResource(bookingSettingsFactory, Role.TeamAdmin, TEAM_BOOKING_SETTINGS_PATH, { teamId });
3484
- }
3485
- updateBookingSettings(role, clubOrSectionOrTeamId, bookingSettings) {
3486
- if (role == Role.ClubAdmin) {
3487
- return this.updateClubBookingSettings(clubOrSectionOrTeamId, bookingSettings);
3488
- }
3489
- else if (role == Role.SectionAdmin) {
3490
- return this.updateSectionBookingSettings(clubOrSectionOrTeamId, bookingSettings);
3491
- }
3492
- return this.updateTeamBookingSettings(clubOrSectionOrTeamId, bookingSettings);
3493
- }
3494
- updateClubBookingSettings(clubId, bookingSettings) {
3495
- return this.apiService
3496
- .updateResource(bookingSettingsFactory, Role.ClubAdmin, CLUB_BOOKING_SETTINGS_PATH, {
3497
- clubId,
3498
- }, bookingSettings);
3499
- }
3500
- updateSectionBookingSettings(sectionId, bookingSettings) {
3501
- return this.apiService
3502
- .updateResource(bookingSettingsFactory, Role.SectionAdmin, SECTION_BOOKING_SETTINGS_PATH, {
3503
- sectionId,
3504
- }, bookingSettings);
3505
- }
3506
- updateTeamBookingSettings(teamId, bookingSettings) {
3507
- return this.apiService
3508
- .updateResource(bookingSettingsFactory, Role.TeamAdmin, TEAM_BOOKING_SETTINGS_PATH, {
3509
- teamId,
3510
- }, bookingSettings);
3511
- }
3512
- // endregion
3513
- // region Booking Calendar Application Times
3514
- updateBookingCalendarApplicationTime(role, clubOrSectionOrTeamId, availableTime) {
3515
- if (role == Role.ClubAdmin) {
3516
- return this.updateClubBookingCalendarApplicationTime(clubOrSectionOrTeamId, availableTime);
3517
- }
3518
- else if (role == Role.SectionAdmin) {
3519
- return this.updateSectionBookingCalendarApplicationTime(clubOrSectionOrTeamId, availableTime);
3520
- }
3521
- return this.updateTeamBookingCalendarApplicationTime(clubOrSectionOrTeamId, availableTime);
3522
- }
3523
- updateClubBookingCalendarApplicationTime(clubId, availableTime) {
3524
- return this.apiService
3525
- .updateResource(bookingCalendarApplicationTimeFactory, Role.ClubAdmin, CLUB_BOOKING_CALENDAR_APPLICATION_TIME_PATH, {
3526
- clubId,
3527
- id: availableTime.id
3528
- }, availableTime);
3529
- }
3530
- updateSectionBookingCalendarApplicationTime(sectionId, availableTime) {
3531
- return this.apiService
3532
- .updateResource(bookingCalendarApplicationTimeFactory, Role.SectionAdmin, SECTION_BOOKING_CALENDAR_APPLICATION_TIME_PATH, {
3533
- sectionId,
3534
- id: availableTime.id
3535
- }, availableTime);
3536
- }
3537
- updateTeamBookingCalendarApplicationTime(teamId, availableTime) {
3538
- return this.apiService
3539
- .updateResource(bookingCalendarApplicationTimeFactory, Role.TeamAdmin, TEAM_BOOKING_CALENDAR_APPLICATION_TIME_PATH, {
3540
- teamId,
3541
- id: availableTime.id
3542
- }, availableTime);
3543
- }
3544
- createTeamBookingCalendarApplicationTime(teamId, availableTime) {
3545
- delete availableTime.id;
3546
- return this.apiService
3547
- .postResource(bookingCalendarApplicationTimeFactory, Role.TeamAdmin, TEAM_BOOKING_CALENDAR_APPLICATION_TIMES_PATH, {
3548
- teamId,
3549
- }, availableTime);
3550
- }
3551
- deleteBookingCalendarApplicationTime(role, clubOrSectionOrTeamId, availableTimeId) {
3552
- if (role == Role.ClubAdmin) {
3553
- return this.deleteClubBookingCalendarApplicationTime(clubOrSectionOrTeamId, availableTimeId);
3554
- }
3555
- else if (role == Role.SectionAdmin) {
3556
- return this.deleteSectionBookingCalendarApplicationTime(clubOrSectionOrTeamId, availableTimeId);
3557
- }
3558
- return this.deleteTeamBookingCalendarApplicationTime(clubOrSectionOrTeamId, availableTimeId);
3559
- }
3560
- deleteClubBookingCalendarApplicationTime(clubId, id) {
3561
- return this.apiService
3562
- .deleteResource(Role.ClubAdmin, CLUB_BOOKING_CALENDAR_APPLICATION_TIME_PATH, {
3563
- clubId,
3564
- id
3565
- });
3566
- }
3567
- deleteSectionBookingCalendarApplicationTime(sectionId, id) {
3568
- return this.apiService
3569
- .deleteResource(Role.SectionAdmin, SECTION_BOOKING_CALENDAR_APPLICATION_TIME_PATH, {
3570
- sectionId,
3571
- id
3572
- });
3573
- }
3574
- deleteTeamBookingCalendarApplicationTime(teamId, id) {
3575
- return this.apiService
3576
- .deleteResource(Role.TeamAdmin, TEAM_BOOKING_CALENDAR_APPLICATION_TIME_PATH, {
3577
- teamId,
3578
- id
3579
- });
3580
- }
3581
- // endregion
3582
- // region Overbooked sessions
3583
- getOverbookedSessions(role, clubOrSectionOrTeamId, bookingSlotFilter) {
3584
- if (role == Role.ClubAdmin) {
3585
- return this.getClubOverbookedSessions(clubOrSectionOrTeamId, bookingSlotFilter);
3586
- }
3587
- return this.getSectionOverbookedSessions(clubOrSectionOrTeamId, bookingSlotFilter);
3588
- }
3589
- getClubOverbookedSessions(clubId, bookingSlotFilter) {
3590
- const params = bookingSlotFilter.toParams();
3591
- return this.apiService
3592
- .getCollection(bookingCalendarSlotSessionFactory, Role.ClubAdmin, CLUB_BOOKING_OVERBOOKED_SESSIONS_PATH, { clubId }, {
3593
- params
3594
- });
3595
- }
3596
- getSectionOverbookedSessions(sectionId, bookingSlotFilter) {
3597
- const params = bookingSlotFilter.toParams();
3598
- return this.apiService
3599
- .getCollection(bookingCalendarSlotSessionFactory, Role.SectionAdmin, SECTION_BOOKING_OVERBOOKED_SESSIONS_PATH, { sectionId }, {
3600
- params
3601
- });
3602
- }
3603
- // endregion
3604
- // region Overbooked bookables
3605
- getOverbookedBookables(role, clubOrSectionOrTeamId, bookingSlotFilter) {
3606
- if (role == Role.ClubAdmin) {
3607
- return this.getClubOverbookedBookables(clubOrSectionOrTeamId, bookingSlotFilter);
3608
- }
3609
- return this.getSectionOverbookedBookables(clubOrSectionOrTeamId, bookingSlotFilter);
3610
- }
3611
- getClubOverbookedBookables(clubId, bookingSlotFilter) {
3612
- const params = bookingSlotFilter.toParams();
3613
- return this.apiService
3614
- .getCollection(overbookedBookableItemFactory, Role.ClubAdmin, CLUB_BOOKING_OVERBOOKED_BOOKABLES_PATH, { clubId }, {
3615
- params
3616
- });
3617
- }
3618
- getSectionOverbookedBookables(sectionId, bookingSlotFilter) {
3619
- const params = bookingSlotFilter.toParams();
3620
- return this.apiService
3621
- .getCollection(overbookedBookableItemFactory, Role.SectionAdmin, SECTION_BOOKING_OVERBOOKED_BOOKABLES_PATH, { sectionId }, {
3622
- params
3623
- });
3624
- }
3625
- }
3626
- BookingCalendarService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: BookingCalendarService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
3627
- BookingCalendarService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: BookingCalendarService, providedIn: 'root' });
3628
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: BookingCalendarService, decorators: [{
3629
- type: Injectable,
3630
- args: [{
3631
- providedIn: 'root'
3632
- }]
3633
- }], ctorParameters: function () { return [{ type: ApiService }]; } });
3634
-
3635
- const MEMBER_CLUB_INFO = ':memberId/club-info/';
3636
- const PUBLIC_CLUB_INFO = 'club-info/';
3637
- const TEAM_CLUB_INFO = ':teamId/club-info/';
3638
- class ClubService {
3639
- constructor(apiService) {
3640
- this.apiService = apiService;
3641
- }
3642
- getMemberClubInfo(memberId) {
3643
- return this.apiService
3644
- .getResource(searchClubFactory, Role.MemberAdmin, MEMBER_CLUB_INFO, { memberId });
3645
- }
3646
- getPublicClubInfo() {
3647
- return this.apiService
3648
- .getResource(searchClubFactory, Role.Public, PUBLIC_CLUB_INFO);
3649
- }
3650
- getTeamClubInfo(teamId) {
3651
- return this.apiService
3652
- .getResource(searchClubFactory, Role.TeamAdmin, TEAM_CLUB_INFO, { teamId });
3653
- }
3654
- }
3655
- ClubService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ClubService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
3656
- ClubService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ClubService, providedIn: 'root' });
3657
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ClubService, decorators: [{
3658
- type: Injectable,
3659
- args: [{
3660
- providedIn: 'root'
3661
- }]
3662
- }], ctorParameters: function () { return [{ type: ApiService }]; } });
3663
-
3664
- const ACTIVITY_INVITE_SETTINGS_PATH = 'every-admin/constants/activity-invite-settings/';
3665
- const ACTIVITY_MAX_ATTENDANT_TYPES_PATH = 'every-admin/constants/activity-max-attendant-types/';
3666
- const ACTIVITY_MEET_UP_TIMES_PATH = 'every-admin/constants/activity-meet-up-times/';
3667
- const ACTIVITY_REMINDER_DAYS_PATH = 'every-admin/constants/activity-invite-days/';
3668
- const ACTIVITY_REMINDER_RECEIVERS_PATH = 'every-admin/constants/activity-remind-receivers/';
3669
- const ACTIVITY_REMINDER_TIMES_PATH = 'every-admin/constants/activity-remind-hours/';
3670
- const ACTIVITY_REPEAT_OPTIONS_PATH = 'every-admin/constants/activity-repeat-options/';
3671
- const ACTIVITY_REPEAT_TYPE_OPTIONS_PATH = 'every-admin/constants/activity-repeat-type-options/';
3672
- const COUNTRIES_PATH = 'every-admin/constants/countries/';
3673
- const LANGUAGES_PATH = 'every-admin/constants/languages/';
3674
- const MEMBER_CONTACT_TYPES_PATH = 'every-admin/constants/member-contact-types/';
3675
- class ConstantService {
3676
- constructor(apiService) {
3677
- this.apiService = apiService;
3678
- this.activityInviteSettings = [];
3679
- this.activityMaxAttendantTypes = [];
3680
- this.activityMeetUpTimes = [];
3681
- this.activityReminderDays = [];
3682
- this.activityReminderReceivers = [];
3683
- this.activityReminderTimes = [];
3684
- this.activityRepeatOptions = [];
3685
- this.activityRepeatTypeOptions = [];
3686
- this.countries = [];
3687
- this.languages = [];
3688
- this.memberContactTypes = [];
3689
- }
3690
- getActivityInviteSettings() {
3691
- if (this.activityInviteSettings.length) {
3692
- return of(this.activityInviteSettings);
3693
- }
3694
- return this.getConstants(ACTIVITY_INVITE_SETTINGS_PATH)
3695
- .pipe(tap((activityInviteSettings) => this.activityInviteSettings = activityInviteSettings));
3696
- }
3697
- getActivityMaxAttendantsTypes() {
3698
- if (this.activityMaxAttendantTypes.length) {
3699
- return of(this.activityMaxAttendantTypes);
3700
- }
3701
- return this.getConstants(ACTIVITY_MAX_ATTENDANT_TYPES_PATH)
3702
- .pipe(tap((activityMaxAttendantTypes) => this.activityMaxAttendantTypes = activityMaxAttendantTypes));
3703
- }
3704
- getActivityMeetUpTimes() {
3705
- if (this.activityMeetUpTimes.length) {
3706
- return of(this.activityMeetUpTimes);
3707
- }
3708
- return this.getConstants(ACTIVITY_MEET_UP_TIMES_PATH)
3709
- .pipe(tap((activityMeetUpTimes) => this.activityMeetUpTimes = activityMeetUpTimes));
3710
- }
3711
- getActivityReminderDays() {
3712
- if (this.activityReminderDays.length) {
3713
- return of(this.activityReminderDays);
3714
- }
3715
- return this.getConstants(ACTIVITY_REMINDER_DAYS_PATH)
3716
- .pipe(tap((activityReminderDays) => this.activityReminderDays = activityReminderDays));
3717
- }
3718
- getActivityReminderReceivers() {
3719
- if (this.activityReminderReceivers.length) {
3720
- return of(this.activityReminderReceivers);
3721
- }
3722
- return this.getConstants(ACTIVITY_REMINDER_RECEIVERS_PATH)
3723
- .pipe(tap((activityReminderReceivers) => this.activityReminderReceivers = activityReminderReceivers));
3724
- }
3725
- getActivityReminderTimes() {
3726
- if (this.activityReminderTimes.length) {
3727
- return of(this.activityReminderTimes);
3728
- }
3729
- return this.getConstants(ACTIVITY_REMINDER_TIMES_PATH)
3730
- .pipe(tap((activityReminderTimes) => this.activityReminderTimes = activityReminderTimes));
3731
- }
3732
- getActivityRepeatOptions() {
3733
- if (this.activityRepeatOptions.length) {
3734
- return of(this.activityRepeatOptions);
3735
- }
3736
- return this.getConstants(ACTIVITY_REPEAT_OPTIONS_PATH)
3737
- .pipe(tap((activityRepeatOptions) => this.activityRepeatOptions = activityRepeatOptions));
3738
- }
3739
- getActivityRepeatTypeOptions() {
3740
- if (this.activityRepeatTypeOptions.length) {
3741
- return of(this.activityRepeatTypeOptions);
3742
- }
3743
- return this.getConstants(ACTIVITY_REPEAT_TYPE_OPTIONS_PATH)
3744
- .pipe(tap((activityRepeatTypeOptions) => this.activityRepeatTypeOptions = activityRepeatTypeOptions));
3745
- }
3746
- getCountries() {
3747
- if (this.countries.length) {
3748
- return of(this.countries);
3749
- }
3750
- return this.getConstants(COUNTRIES_PATH)
3751
- .pipe(tap((countries) => this.countries = countries));
3752
- }
3753
- getLanguages() {
3754
- if (this.languages.length) {
3755
- return of(this.languages);
3756
- }
3757
- return this.getConstants(LANGUAGES_PATH)
3758
- .pipe(map((languages) => {
3759
- // FIXME: For now - remove the french language.
3760
- const index = languages.findIndex((language) => language.value === 'fr');
3761
- if (index !== -1) {
3762
- languages.splice(index, 1);
3763
- }
3764
- return languages;
3765
- }), tap((languages) => this.languages = languages));
3766
- }
3767
- getMemberContactTypes() {
3768
- if (this.memberContactTypes.length) {
3769
- return of(this.memberContactTypes);
3770
- }
3771
- return this.getConstants(MEMBER_CONTACT_TYPES_PATH)
3772
- .pipe(tap((memberContactTypes) => this.memberContactTypes = memberContactTypes));
3773
- }
3774
- getConstants(path) {
3775
- return this.apiService
3776
- .getCollection((option) => option, Role.None, path)
3777
- .pipe(map((response) => response.toArray()));
3778
- }
3779
- }
3780
- ConstantService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ConstantService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
3781
- ConstantService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ConstantService, providedIn: 'root' });
3782
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ConstantService, decorators: [{
3783
- type: Injectable,
3784
- args: [{
3785
- providedIn: 'root'
3786
- }]
3787
- }], ctorParameters: function () { return [{ type: ApiService }]; } });
3788
-
3789
- const TEAM_LEADER_CREATE_EMAIL_PATH = ':teamId/distribution/email/';
3790
- class EmailService {
3791
- constructor(apiService) {
3792
- this.apiService = apiService;
3793
- this.backHref = '';
3794
- this.recipients = [];
3795
- }
3796
- clear() {
3797
- this.backHref = '';
3798
- this.recipients = [];
3799
- }
3800
- getBackHref() {
3801
- return this.backHref;
3802
- }
3803
- getRecipients() {
3804
- return this.recipients;
3805
- }
3806
- removeRecipient(id) {
3807
- const index = this.recipients.findIndex((item) => item.id === id);
3808
- if (index !== -1) {
3809
- this.recipients.splice(index, 1);
3810
- return true;
3811
- }
3812
- return false;
3813
- }
3814
- sendTeamLeaderEmail(teamId, email) {
3815
- return this.apiService
3816
- .postResource((email_count) => email_count.queued_emails, Role.TeamAdmin, TEAM_LEADER_CREATE_EMAIL_PATH, { teamId }, {
3817
- body: email.body,
3818
- subject: email.subject,
3819
- recipients: email.recipients.map((value) => value.id)
3820
- });
3821
- }
3822
- setBackHref(href) {
3823
- this.backHref = href;
3824
- }
3825
- setRecipients(emailRecipients) {
3826
- this.recipients = [...emailRecipients].sort((a, b) => (a.name < b.name ? -1 : 1));
3827
- }
3828
- }
3829
- EmailService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: EmailService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
3830
- EmailService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: EmailService, providedIn: 'root' });
3831
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: EmailService, decorators: [{
3832
- type: Injectable,
3833
- args: [{
3834
- providedIn: 'root'
3835
- }]
3836
- }], ctorParameters: function () { return [{ type: ApiService }]; } });
3837
-
3838
- const MEMBER_EXTERNAL_LINK_PATH = ':memberId/others/externallinks/';
3839
- class ExternalLinkService {
3840
- constructor(apiService) {
3841
- this.apiService = apiService;
3842
- }
3843
- getMemberExternalLinks(memberId) {
3844
- return this.apiService
3845
- .getCollection(externalLinkFactory, Role.MemberAdmin, MEMBER_EXTERNAL_LINK_PATH, { memberId });
3846
- }
3847
- }
3848
- ExternalLinkService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ExternalLinkService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
3849
- ExternalLinkService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ExternalLinkService, providedIn: 'root' });
3850
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ExternalLinkService, decorators: [{
3851
- type: Injectable,
3852
- args: [{
3853
- providedIn: 'root'
3854
- }]
3855
- }], ctorParameters: function () { return [{ type: ApiService }]; } });
3856
-
3857
- const MEMBER_DIRECTORIES_PATH = ':memberId/files/';
3858
- const TEAM_DIRECTORIES_PATH = ':teamId/directories/';
3859
- const TEAM_DIRECTORY_PATH = ':teamId/directories/:directoryId/';
3860
- const TEAM_FILES_PATH = ':teamId/directories/:directoryId/files/';
3861
- const TEAM_FILE_PATH = ':teamId/directories/:directoryId/files/:fileId/';
3862
- class FileService {
3863
- constructor(apiService) {
3864
- this.apiService = apiService;
3865
- }
3866
- createTeamDirectory(teamId, directory) {
3867
- return this.apiService
3868
- .postResource(directoryFactory, Role.TeamAdmin, TEAM_DIRECTORIES_PATH, {
3869
- teamId
3870
- }, directory);
3871
- }
3872
- createTeamFile(teamId, directoryId, file) {
3873
- const formData = new FormData();
3874
- const fileObj = file.file;
3875
- formData.append('name', file.name);
3876
- formData.append('file', fileObj, fileObj.name);
3877
- return this.apiService
3878
- .postFormData(fileFactory, Role.TeamAdmin, TEAM_FILES_PATH, {
3879
- teamId,
3880
- directoryId
3881
- }, formData);
3882
- }
3883
- deleteTeamDirectory(teamId, directoryId) {
3884
- return this.apiService
3885
- .deleteResource(Role.TeamAdmin, TEAM_DIRECTORY_PATH, {
3886
- teamId,
3887
- directoryId
3888
- });
3889
- }
3890
- deleteTeamFile(teamId, directoryId, fileId) {
3891
- return this.apiService
3892
- .deleteResource(Role.TeamAdmin, TEAM_FILE_PATH, {
3893
- teamId,
3894
- directoryId,
3895
- fileId
3896
- });
3897
- }
3898
- getMemberDirectories(memberId) {
3899
- return this.apiService
3900
- .getCollection(directoryFactory, Role.MemberAdmin, MEMBER_DIRECTORIES_PATH, { memberId }, { params: { limit: 'null' } });
3901
- }
3902
- getTeamDirectories(teamId) {
3903
- return this.apiService
3904
- .getCollection(directoryFactory, Role.TeamAdmin, TEAM_DIRECTORIES_PATH, { teamId }, { params: { limit: 'null' } });
3905
- }
3906
- }
3907
- FileService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: FileService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
3908
- FileService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: FileService, providedIn: 'root' });
3909
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: FileService, decorators: [{
3910
- type: Injectable,
3911
- args: [{
3912
- providedIn: 'root'
3913
- }]
3914
- }], ctorParameters: function () { return [{ type: ApiService }]; } });
3915
-
3916
- const MEMBER_INVOICE_PATH = ':memberId/invoices/:invoiceId/';
3917
- const MEMBER_INVOICES_PATH = ':memberId/invoices/';
3918
- const PUBLIC_INVOICE_PATH = 'invoices/:invoiceId/:token/';
3919
- const PUBLIC_INVOICE_LOGO_PATH = 'invoices/:invoiceId/:token/logo/';
3920
- class InvoiceService {
3921
- constructor(apiService) {
3922
- this.apiService = apiService;
3923
- }
3924
- getMemberInvoice(memberId, invoiceId) {
3925
- return this.getInvoice(Role.MemberAdmin, MEMBER_INVOICE_PATH, { memberId, invoiceId });
3926
- }
3927
- getMemberInvoices(memberId, filterParams = {}) {
3928
- return this.getInvoices(Role.MemberAdmin, MEMBER_INVOICES_PATH, { memberId }, filterParams);
3929
- }
3930
- getPublicInvoice(invoiceId, token) {
3931
- return this.getInvoice(Role.Public, PUBLIC_INVOICE_PATH, { invoiceId, token });
3932
- }
3933
- getPublicInvoiceLogo(invoiceId, token) {
3934
- return this.apiService.getResource(clubImageFactory, Role.Public, PUBLIC_INVOICE_LOGO_PATH, { invoiceId, token });
3935
- }
3936
- getInvoice(role, path, pathParams) {
3937
- return this.apiService.getResource(memberInvoiceFactory, role, path, pathParams);
3938
- }
3939
- getInvoices(role, path, pathParams, filterParams = {}) {
3940
- return this.apiService.getCollection(searchMemberInvoiceFactory, role, path, pathParams, { params: filterParams });
3941
- }
3942
- }
3943
- InvoiceService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: InvoiceService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
3944
- InvoiceService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: InvoiceService, providedIn: 'root' });
3945
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: InvoiceService, decorators: [{
3946
- type: Injectable,
3947
- args: [{
3948
- providedIn: 'root'
3949
- }]
3950
- }], ctorParameters: function () { return [{ type: ApiService }]; } });
3951
-
3952
- class ApiPaymentAttemptCreate {
3953
- constructor(invoice_id, type, telephone_number) {
3954
- this.invoice_id = invoice_id;
3955
- this.type = type;
3956
- this.telephone_number = telephone_number;
3957
- }
3958
- }
3959
-
3960
- const MEMBER_PAYMENT_PATH = ':memberId/invoices/:invoiceId/payment-attempts/:id/';
3961
- const MEMBER_PAYMENTS_PATH = ':memberId/invoices/:invoiceId/payment-attempts/';
3962
- const PUBLIC_PAYMENT_PATH = 'invoices/:invoiceId/:token/payment-attempts/:id/';
3963
- const PUBLIC_PAYMENTS_PATH = 'invoices/:invoiceId/:token/payment-attempts/';
3964
- class PaymentAttemptService {
3965
- constructor(apiService) {
3966
- this.apiService = apiService;
3967
- }
3968
- createMemberPaymentAttempt(memberId, invoiceId, type, phoneNumber = '') {
3969
- return this.createPaymentAttempt(Role.MemberAdmin, MEMBER_PAYMENTS_PATH, { memberId, invoiceId }, new ApiPaymentAttemptCreate(invoiceId, type, phoneNumber));
3970
- }
3971
- createPublicPaymentAttempt(invoiceId, token, type, phoneNumber = '') {
3972
- return this.createPaymentAttempt(Role.Public, PUBLIC_PAYMENTS_PATH, { invoiceId, token }, new ApiPaymentAttemptCreate(invoiceId, type, phoneNumber));
3973
- }
3974
- getMemberPaymentAttempt(memberId, invoiceId, id) {
3975
- return this.getPaymentAttempt(Role.MemberAdmin, MEMBER_PAYMENT_PATH, { memberId, invoiceId, id: id.toString() });
3976
- }
3977
- getMemberSwishQRCode(memberId, invoiceId, id) {
3978
- return this.getSwishQRCode(Role.MemberAdmin, `${MEMBER_PAYMENT_PATH}swish-qr/`, { memberId, invoiceId, id: id.toString() });
3979
- }
3980
- getPublicPaymentAttempt(invoiceId, token, id) {
3981
- return this.getPaymentAttempt(Role.Public, PUBLIC_PAYMENT_PATH, { invoiceId, token, id: id.toString() });
3982
- }
3983
- getPublicSwishQRCode(invoiceId, token, id) {
3984
- return this.getSwishQRCode(Role.Public, `${PUBLIC_PAYMENT_PATH}swish-qr/`, { invoiceId, token, id: id.toString() });
3985
- }
3986
- createPaymentAttempt(role, path, pathParams, data) {
3987
- return this.apiService.postResource(paymentAttemptFactory, role, path, pathParams, data);
3988
- }
3989
- getPaymentAttempt(role, path, pathParams) {
3990
- return this.apiService.getResource(paymentAttemptFactory, role, path, pathParams);
3991
- }
3992
- getSwishQRCode(role, path, pathParams) {
3993
- return this.apiService.getResource((apiSwishQrCode) => new SwishQrCode(apiSwishQrCode.qr_code), role, path, pathParams);
3994
- }
3995
- }
3996
- PaymentAttemptService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: PaymentAttemptService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
3997
- PaymentAttemptService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: PaymentAttemptService, providedIn: 'root' });
3998
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: PaymentAttemptService, decorators: [{
3999
- type: Injectable,
4000
- args: [{
4001
- providedIn: 'root'
4002
- }]
4003
- }], ctorParameters: function () { return [{ type: ApiService }]; } });
4004
-
4005
- class MaintenanceModeService {
4006
- constructor() {
4007
- this.maintenanceMode = new BehaviorSubject(false);
4008
- this.maintenanceMode$ = this.maintenanceMode.asObservable();
4009
- }
4010
- setMaintenanceMode(value) {
4011
- this.maintenanceMode.next(value);
4012
- }
4013
- }
4014
- MaintenanceModeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: MaintenanceModeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4015
- MaintenanceModeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: MaintenanceModeService, providedIn: 'root' });
4016
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: MaintenanceModeService, decorators: [{
4017
- type: Injectable,
4018
- args: [{
4019
- providedIn: 'root'
4020
- }]
4021
- }], ctorParameters: function () { return []; } });
4022
-
4023
- const PUBLIC_LIST_MEMBER_PATH = 'public/members/';
4024
- const MEMBER_OTHER_MEMBER_PATH = ':memberId/others/clubmembersv2/:id/';
4025
- const MEMBER_OTHER_MEMBER_SEARCH_PATH = ':memberId/others/clubmembersv2/';
4026
- const MEMBER_PROFILE_CONTACT_PATH = ':memberId/member-detail/contacts/:contactId/';
4027
- const MEMBER_PROFILE_PATH = ':memberId/member-detail/';
4028
- const TEAM_MEMBER_CONTACT_PATH = ':teamId/team-members/:memberId/contacts/:contactId/';
4029
- const TEAM_OTHER_MEMBER_PATH = ':teamId/team-members/othersv2/:id/';
4030
- const TEAM_OTHER_MEMBER_SEARCH_PATH = ':teamId/team-members/othersv2/';
4031
- class MemberService {
4032
- constructor(apiService) {
4033
- this.apiService = apiService;
4034
- }
4035
- getMemberProfile(memberId) {
4036
- return this.apiService
4037
- .getResource(memberFactory, Role.MemberAdmin, MEMBER_PROFILE_PATH, { memberId });
4038
- }
4039
- getMemberOtherMember(memberId, id) {
4040
- return this.apiService
4041
- .getResource(otherMemberFactory, Role.MemberAdmin, MEMBER_OTHER_MEMBER_PATH, { memberId, id });
4042
- }
4043
- getTeamOtherMember(teamId, id) {
4044
- return this.apiService
4045
- .getResource(otherMemberFactory, Role.TeamAdmin, TEAM_OTHER_MEMBER_PATH, { teamId, id });
4046
- }
4047
- listPublicMembers() {
4048
- return this.apiService
4049
- .getCollection(searchMemberFactory, Role.None, PUBLIC_LIST_MEMBER_PATH, {});
4050
- }
4051
- removeMemberProfileContact(memberId, contactId) {
4052
- return this.apiService
4053
- .deleteResource(Role.MemberAdmin, MEMBER_PROFILE_CONTACT_PATH, { memberId, contactId });
4054
- }
4055
- removeTeamMemberContact(teamId, memberId, contactId) {
4056
- return this.apiService
4057
- .deleteResource(Role.TeamAdmin, TEAM_MEMBER_CONTACT_PATH, { teamId, memberId, contactId });
4058
- }
4059
- searchMemberOtherMembers(memberId, searchTerm) {
4060
- return this.apiService
4061
- .getCollection(otherMemberFactory, Role.MemberAdmin, MEMBER_OTHER_MEMBER_SEARCH_PATH, { memberId }, { params: { q: searchTerm } });
4062
- }
4063
- searchTeamOtherMembers(teamId, searchTerm) {
4064
- return this.apiService
4065
- .getCollection(otherMemberFactory, Role.TeamAdmin, TEAM_OTHER_MEMBER_SEARCH_PATH, { teamId }, { params: { q: searchTerm } });
4066
- }
4067
- updateMemberProfile(memberId, memberProfile) {
4068
- return this.apiService
4069
- .updateResource(memberFactory, Role.MemberAdmin, MEMBER_PROFILE_PATH, { memberId }, memberProfile);
4070
- }
4071
- }
4072
- MemberService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: MemberService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
4073
- MemberService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: MemberService, providedIn: 'root' });
4074
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: MemberService, decorators: [{
4075
- type: Injectable,
4076
- args: [{
4077
- providedIn: 'root'
4078
- }]
4079
- }], ctorParameters: function () { return [{ type: ApiService }]; } });
4080
-
4081
- const MEMBER_MEMBER_CARD_PATH = ':memberId/member-cards/:id/';
4082
- const MEMBER_MEMBER_CARD_DEALS_PATH = ':memberId/member-cards/:id/deals/';
4083
- const MEMBER_MEMBER_CARD_ACTIVATE_TICKET_PATH = ':memberId/member-cards/:cardId/tickets/:id/activate/';
4084
- const MEMBER_MEMBER_CARD_QR_CODE = ':memberId/member-cards/:id/qr-code/';
4085
- const MEMBER_MEMBER_CARD_TICKETS_PATH = ':memberId/member-cards/:id/tickets/';
4086
- const MEMBER_MEMBER_CARDS_PATH = ':memberId/member-cards/';
4087
- const PUBLIC_MEMBER_CARD_PATH = 'member-cards/:id/:token/';
4088
- const PUBLIC_MEMBER_CARD_DEALS_PATH = 'member-cards/:id/:token/deals/';
4089
- const PUBLIC_MEMBER_CARD_QR_CODE = 'member-cards/:id/:token/qr-code/';
4090
- const PUBLIC_MEMBER_CARD_REGISTER = 'member-cards/:id/:token/register/';
4091
- const PUBLIC_MEMBER_CARD_ACTIVATE_TICKET_PATH = 'member-cards/:cardId/:token/tickets/:id/activate/';
4092
- const PUBLIC_MEMBER_CARD_TICKETS_PATH = 'member-cards/:id/:token/tickets/';
4093
- const pinCodeFactory = (apiCardMemberTicket) => {
4094
- return !!apiCardMemberTicket;
4095
- };
4096
- class MemberCardService {
4097
- constructor(apiService) {
4098
- this.apiService = apiService;
4099
- }
4100
- activateMemberCardTicket(memberId, cardId, id, pin_code) {
4101
- return this.apiService
4102
- .postResource(pinCodeFactory, Role.MemberAdmin, MEMBER_MEMBER_CARD_ACTIVATE_TICKET_PATH, { memberId, cardId, id }, { pin_code });
4103
- }
4104
- activatePublicCardTicket(cardId, token, id, pin_code) {
4105
- return this.apiService
4106
- .postResource(pinCodeFactory, Role.Public, PUBLIC_MEMBER_CARD_ACTIVATE_TICKET_PATH, {
4107
- cardId,
4108
- token,
4109
- id
4110
- }, {
4111
- pin_code
4112
- });
4113
- }
4114
- getMemberCard(memberId, id) {
4115
- return this.apiService
4116
- .getResource(memberCardFactory, Role.MemberAdmin, MEMBER_MEMBER_CARD_PATH, { memberId, id });
4117
- }
4118
- getMemberCardDeals(memberId, id, filterParams = {}) {
4119
- return this.apiService
4120
- .getCollection(cardDealFactory, Role.MemberAdmin, MEMBER_MEMBER_CARD_DEALS_PATH, { memberId, id }, { params: filterParams });
4121
- }
4122
- getMemberCardQRCode(memberId, id) {
4123
- return this.apiService
4124
- .getResource(memberCardFactory, Role.MemberAdmin, MEMBER_MEMBER_CARD_QR_CODE, { memberId, id });
4125
- }
4126
- getMemberCardTickets(memberId, id, filterParams = {}) {
4127
- return this.apiService
4128
- .getCollection(cardTicketFactory, Role.MemberAdmin, MEMBER_MEMBER_CARD_TICKETS_PATH, { memberId, id }, { params: filterParams });
4129
- }
4130
- getMemberCards(memberId, filterParams = {}) {
4131
- return this.apiService
4132
- .getCollection(searchMemberCardFactory, Role.MemberAdmin, MEMBER_MEMBER_CARDS_PATH, { memberId }, { params: filterParams });
4133
- }
4134
- getPublicMemberCard(id, token) {
4135
- return this.apiService
4136
- .getResource(memberCardFactory, Role.Public, PUBLIC_MEMBER_CARD_PATH, {
4137
- id,
4138
- token
4139
- });
4140
- }
4141
- getPublicMemberCardQRCode(id, token) {
4142
- return this.apiService
4143
- .getResource(memberCardFactory, Role.Public, PUBLIC_MEMBER_CARD_QR_CODE, {
4144
- id,
4145
- token
4146
- });
4147
- }
4148
- getPublicMemberCardRegistration(id, token) {
4149
- return this.apiService
4150
- .getResource(memberCardFactory, Role.Public, PUBLIC_MEMBER_CARD_REGISTER, {
4151
- id,
4152
- token
4153
- });
4154
- }
4155
- getPublicMemberCardDeals(id, token, filterParams = {}) {
4156
- return this.apiService
4157
- .getCollection(cardDealFactory, Role.Public, PUBLIC_MEMBER_CARD_DEALS_PATH, {
4158
- id,
4159
- token
4160
- }, { params: filterParams });
4161
- }
4162
- getPublicMemberCardTickets(id, token, filterParams = {}) {
4163
- return this.apiService
4164
- .getCollection(cardTicketFactory, Role.Public, PUBLIC_MEMBER_CARD_TICKETS_PATH, {
4165
- id,
4166
- token
4167
- }, { params: filterParams });
4168
- }
4169
- }
4170
- MemberCardService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: MemberCardService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
4171
- MemberCardService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: MemberCardService, providedIn: 'root' });
4172
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: MemberCardService, decorators: [{
4173
- type: Injectable,
4174
- args: [{
4175
- providedIn: 'root'
4176
- }]
4177
- }], ctorParameters: function () { return [{ type: ApiService }]; } });
4178
-
4179
- const MEMBER_MEMBER_PUBLIC_FORM_PATH = ':memberId/myclub-forms/:id/';
4180
- const MEMBER_MEMBER_PUBLIC_FORMS_PATH = ':memberId/myclub-forms/';
4181
- class MemberPublicFormService {
4182
- constructor(apiService) {
4183
- this.apiService = apiService;
4184
- }
4185
- getMemberMemberPublicForms(memberId) {
4186
- return this.apiService
4187
- .getCollection(memberPublicFormFactory, Role.MemberAdmin, MEMBER_MEMBER_PUBLIC_FORMS_PATH, { memberId });
4188
- }
4189
- getMemberMemberPublicForm(memberId, id) {
4190
- return this.apiService
4191
- .getResource(memberPublicFormFactory, Role.MemberAdmin, MEMBER_MEMBER_PUBLIC_FORM_PATH, {
4192
- memberId,
4193
- id
4194
- });
4195
- }
4196
- }
4197
- MemberPublicFormService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: MemberPublicFormService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
4198
- MemberPublicFormService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: MemberPublicFormService, providedIn: 'root' });
4199
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: MemberPublicFormService, decorators: [{
4200
- type: Injectable,
4201
- args: [{
4202
- providedIn: 'root'
4203
- }]
4204
- }], ctorParameters: function () { return [{ type: ApiService }]; } });
4205
-
4206
- const MEMBER_NEWS_ITEMS_PATH = ':memberId/news/';
4207
- const MEMBER_NEWS_ITEM_PATH = ':memberId/news/:id/';
4208
- const TEAM_NEWS_ITEMS_PATH = ':teamId/news/';
4209
- const TEAM_NEWS_ITEM_PATH = ':teamId/news/:id/';
4210
- class NewsService {
4211
- constructor(apiService) {
4212
- this.apiService = apiService;
4213
- }
4214
- createTeamNews(teamId, news) {
4215
- delete news.id;
4216
- return this.apiService
4217
- .postFormData(newsFactory, Role.TeamAdmin, TEAM_NEWS_ITEMS_PATH, {
4218
- teamId
4219
- }, this.createFormData(news));
4220
- }
4221
- deleteTeamNews(teamId, id) {
4222
- return this.apiService
4223
- .deleteResource(Role.TeamAdmin, TEAM_NEWS_ITEM_PATH, {
4224
- teamId,
4225
- id
4226
- });
4227
- }
4228
- getMemberNews(memberId, id) {
4229
- return this.apiService
4230
- .getResource(newsFactory, Role.MemberAdmin, MEMBER_NEWS_ITEM_PATH, {
4231
- memberId,
4232
- id
4233
- });
4234
- }
4235
- getTeamNews(teamId, id) {
4236
- return this.apiService
4237
- .getResource(newsFactory, Role.TeamAdmin, TEAM_NEWS_ITEM_PATH, {
4238
- teamId,
4239
- id
4240
- });
4241
- }
4242
- listMemberNews(memberId, offset) {
4243
- return this.apiService
4244
- .getCollection(newsFactory, Role.MemberAdmin, MEMBER_NEWS_ITEMS_PATH, {
4245
- memberId
4246
- }, {
4247
- params: {
4248
- offset: offset.toString(10)
4249
- }
4250
- });
4251
- }
4252
- listTeamNews(teamId, offset) {
4253
- return this.apiService
4254
- .getCollection(newsFactory, Role.TeamAdmin, TEAM_NEWS_ITEMS_PATH, {
4255
- teamId
4256
- }, {
4257
- params: {
4258
- offset: offset.toString(10)
4259
- }
4260
- });
4261
- }
4262
- updateTeamNews(teamId, id, news) {
4263
- return this.apiService
4264
- .postFormData(newsFactory, Role.TeamAdmin, TEAM_NEWS_ITEM_PATH, {
4265
- teamId,
4266
- id
4267
- }, this.createFormData(news));
4268
- }
4269
- createFormData(news) {
4270
- const formData = new FormData();
4271
- if (!news.active_to) {
4272
- news.active_to = null;
4273
- }
4274
- if (!news.news_image) {
4275
- news.news_image = new File([], '');
4276
- }
4277
- if (!news.published_date) {
4278
- news.published_date = null;
4279
- }
4280
- formData.append('title', news?.title);
4281
- formData.append('ingress', news?.ingress);
4282
- formData.append('text', news?.text);
4283
- if (typeof news?.news_image !== 'undefined' && news?.news_image instanceof File) {
4284
- formData.append('news_image', news?.news_image);
4285
- }
4286
- formData.append('news_image_text', news?.news_image_text);
4287
- formData.append('published_date', news?.published_date ? news?.published_date : '');
4288
- formData.append('active_to', news?.active_to ? news?.active_to : '');
4289
- formData.append('show_on_my_pages', `${news?.show_on_my_pages || false}`);
4290
- formData.append('show_on_webpage', `${news?.show_on_webpage || false}`);
4291
- return formData;
4292
- }
4293
- }
4294
- NewsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: NewsService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
4295
- NewsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: NewsService, providedIn: 'root' });
4296
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: NewsService, decorators: [{
4297
- type: Injectable,
4298
- args: [{
4299
- providedIn: 'root'
4300
- }]
4301
- }], ctorParameters: function () { return [{ type: ApiService }]; } });
4302
-
4303
- const MEMBER_REGISTER_REGISTRATION_QR_CODE_PATH = 'every-admin/qr-codes/:clubId/registration/:id/register/:memberId/';
4304
- const REGISTRATION_QR_CODE_PATH = 'every-admin/qr-codes/:clubId/registration/:id/';
4305
- class RegistrationQRCodeService {
4306
- constructor(apiService) {
4307
- this.apiService = apiService;
4308
- }
4309
- getRegistrationQRCode(clubId, id) {
4310
- return this.apiService
4311
- .getResource(registrationQRCodeFactory, Role.None, REGISTRATION_QR_CODE_PATH, {
4312
- clubId,
4313
- id
4314
- });
4315
- }
4316
- registerMemberRegistrationQRCode(clubId, id, memberId) {
4317
- return this.apiService
4318
- .postResource(registrationQRCodeFactory, Role.None, MEMBER_REGISTER_REGISTRATION_QR_CODE_PATH, {
4319
- clubId,
4320
- id,
4321
- memberId
4322
- }, {});
4323
- }
4324
- }
4325
- RegistrationQRCodeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: RegistrationQRCodeService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
4326
- RegistrationQRCodeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: RegistrationQRCodeService, providedIn: 'root' });
4327
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: RegistrationQRCodeService, decorators: [{
4328
- type: Injectable,
4329
- args: [{
4330
- providedIn: 'root'
4331
- }]
4332
- }], ctorParameters: function () { return [{ type: ApiService }]; } });
4333
-
4334
- const CLUB_SECTIONS_PATH = ':clubId/sections/';
4335
- class SectionService {
4336
- constructor(apiService) {
4337
- this.apiService = apiService;
4338
- }
4339
- getClubSections(clubId) {
4340
- return this.apiService.getCollection(clubSectionFactory, Role.ClubAdmin, CLUB_SECTIONS_PATH, { clubId });
4341
- }
4342
- }
4343
- SectionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: SectionService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
4344
- SectionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: SectionService, providedIn: 'root' });
4345
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: SectionService, decorators: [{
4346
- type: Injectable,
4347
- args: [{
4348
- providedIn: 'root'
4349
- }]
4350
- }], ctorParameters: function () { return [{ type: ApiService }]; } });
4351
-
4352
- const CLUB_TEAMS_PATH = ':clubId/teams/';
4353
- const MEMBER_TEAM_MEMBER_PATH = ':memberId/teams/:teamId/team-members/:id/';
4354
- const MEMBER_TEAM_MEMBERS_PATH = ':memberId/teams/:teamId/team-members/';
4355
- const MEMBER_TEAM_EXTRA_MEMBER_PATH = ':memberId/teams/:teamId/extra-members/:id/';
4356
- const MEMBER_TEAM_EXTRA_MEMBERS_PATH = ':memberId/teams/:teamId/extra-members/';
4357
- const MEMBER_TEAM_PATH = ':memberId/teams/:teamId/';
4358
- const MEMBER_TEAMS_PATH = ':memberId/teams/';
4359
- const SECTION_TEAMS_PATH = ':sectionId/teams/';
4360
- const TEAM_LEADER_TEAM_MEMBER_PATH = ':teamId/team-members/:id/';
4361
- const TEAM_LEADER_TEAM_MEMBERS_PATH = ':teamId/team-members/';
4362
- const TEAM_LEADER_TEAM_PATH = ':teamId/team-detail/';
4363
- const TEAM_LEADER_TEAM_EXTRA_MEMBER_PATH = ':teamId/team-members/extra-members/:id/';
4364
- const TEAM_LEADER_TEAM_EXTRA_MEMBERS_PATH = ':teamId/team-members/extra-members/';
4365
- class TeamService {
4366
- constructor(apiService) {
4367
- this.apiService = apiService;
4368
- }
4369
- deleteTeamLeaderTeamMember(teamId, id) {
4370
- return this.apiService.deleteResource(Role.TeamAdmin, TEAM_LEADER_TEAM_MEMBER_PATH, { teamId, id });
4371
- }
4372
- getTeams(role, clubOrSectionOrTeamId) {
4373
- if (role === Role.ClubAdmin) {
4374
- return this.getClubTeams(clubOrSectionOrTeamId);
4375
- }
4376
- return this.getSectionTeams(clubOrSectionOrTeamId);
4377
- }
4378
- getClubTeams(clubId) {
4379
- return this.apiService.getCollection(searchTeamFactory, Role.ClubAdmin, CLUB_TEAMS_PATH, { clubId });
4380
- }
4381
- getMemberTeam(memberId, teamId) {
4382
- return this.apiService.getResource(memberTeamFactory, Role.MemberAdmin, MEMBER_TEAM_PATH, { memberId, teamId });
4383
- }
4384
- getMemberTeamExtraMember(memberId, teamId, id) {
4385
- return this.apiService.getResource(activityExtraMemberFactory, Role.MemberAdmin, MEMBER_TEAM_EXTRA_MEMBER_PATH, { memberId, teamId, id });
4386
- }
4387
- getMemberTeamExtraMembers(memberId, teamId, q, offset) {
4388
- return this.apiService.getCollection(activityExtraMemberFactory, Role.MemberAdmin, MEMBER_TEAM_EXTRA_MEMBERS_PATH, { memberId, teamId }, { params: { member_q: q, offset: offset.toString(10) } });
4389
- }
4390
- getMemberTeamMember(memberId, teamId, id) {
4391
- return this.apiService.getResource(memberTeamThroughFactory, Role.MemberAdmin, MEMBER_TEAM_MEMBER_PATH, { memberId, teamId, id });
4392
- }
4393
- getMemberTeamMembers(memberId, teamId, q, offset) {
4394
- return this.apiService.getCollection(searchMemberTeamThroughFactory, Role.MemberAdmin, MEMBER_TEAM_MEMBERS_PATH, { memberId, teamId }, { params: { member_q: q, offset: offset.toString(10) } });
4395
- }
4396
- getMemberTeams(memberId) {
4397
- return this.apiService.getCollection(searchTeamFactory, Role.MemberAdmin, MEMBER_TEAMS_PATH, { memberId });
4398
- }
4399
- getSectionTeams(sectionId) {
4400
- return this.apiService.getCollection(searchTeamFactory, Role.SectionAdmin, SECTION_TEAMS_PATH, { sectionId });
4401
- }
4402
- getTeamLeaderTeam(teamId) {
4403
- return this.apiService.getResource(memberTeamFactory, Role.TeamAdmin, TEAM_LEADER_TEAM_PATH, { teamId });
4404
- }
4405
- getTeamLeaderTeamExtraMember(teamId, id) {
4406
- return this.apiService.getResource(activityExtraMemberFactory, Role.TeamAdmin, TEAM_LEADER_TEAM_EXTRA_MEMBER_PATH, {
4407
- teamId, id
4408
- });
4409
- }
4410
- getTeamLeaderTeamExtraMembers(teamId, q, offset) {
4411
- return this.apiService.getCollection(activityExtraMemberFactory, Role.TeamAdmin, TEAM_LEADER_TEAM_EXTRA_MEMBERS_PATH, {
4412
- teamId
4413
- }, { params: { member_q: q, offset: offset.toString(10) } });
4414
- }
4415
- getTeamLeaderTeamMember(teamId, id) {
4416
- return this.apiService.getResource(memberTeamThroughFactory, Role.TeamAdmin, TEAM_LEADER_TEAM_MEMBER_PATH, { teamId, id });
4417
- }
4418
- getTeamLeaderTeamMembers(teamId, q, offset) {
4419
- return this.apiService.getCollection(searchMemberTeamThroughFactory, Role.TeamAdmin, TEAM_LEADER_TEAM_MEMBERS_PATH, { teamId }, { params: { member_q: q, offset: offset.toString(10) } });
4420
- }
4421
- updateTeamLeaderTeamMember(teamId, id, teamMember) {
4422
- return this.apiService.updateResource(memberTeamThroughFactory, Role.TeamAdmin, TEAM_LEADER_TEAM_MEMBER_PATH, { teamId, id }, teamMember);
4423
- }
4424
- }
4425
- TeamService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: TeamService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
4426
- TeamService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: TeamService, providedIn: 'root' });
4427
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: TeamService, decorators: [{
4428
- type: Injectable,
4429
- args: [{
4430
- providedIn: 'root'
4431
- }]
4432
- }], ctorParameters: function () { return [{ type: ApiService }]; } });
4433
-
4434
- const BASE_PATH$1 = 'accounts/token/';
4435
- const CREDENTIAL_GRANT_TYPE = 'password';
4436
- const CODE_GRANT_TYPE = 'authorization_code';
4437
- const LOGOUT_PATH = 'accounts/logout/';
4438
- const REFRESH_GRANT_TYPE = 'refresh_token';
4439
- const SESSION_TOKEN_PATH = 'accounts/session-token/';
4440
- class TokenService {
4441
- constructor(apiService) {
4442
- this.apiService = apiService;
4443
- }
4444
- getTokenByCredentials(clientId, clientSecret, username, password) {
4445
- return this.getToken(clientId, clientSecret, CREDENTIAL_GRANT_TYPE, { username, password });
4446
- }
4447
- getTokenByCode(clientId, clientSecret, code) {
4448
- return this.getToken(clientId, clientSecret, CODE_GRANT_TYPE, { code, code_verifier: code });
4449
- }
4450
- getTokenByRefreshToken(clientId, clientSecret, refreshToken) {
4451
- return this.getToken(clientId, clientSecret, REFRESH_GRANT_TYPE, {
4452
- refresh_token: refreshToken
4453
- });
4454
- }
4455
- getTokenBySession() {
4456
- return this.apiService.getResource(tokenFactory, Role.None, SESSION_TOKEN_PATH, {}).pipe(catchError((err) => {
4457
- if (err.status === 401) {
4458
- return of(null);
4459
- }
4460
- return throwError(() => err);
4461
- }));
4462
- }
4463
- logout() {
4464
- return this.apiService.postResource(() => { }, Role.None, LOGOUT_PATH, {}, {});
4465
- }
4466
- getToken(clientId, clientSecret, grantType, params) {
4467
- return this.apiService.postFormData(tokenFactory, Role.None, BASE_PATH$1, {}, {
4468
- client_id: clientId,
4469
- client_secret: clientSecret,
4470
- grant_type: grantType,
4471
- ...params
4472
- });
4473
- }
4474
- }
4475
- TokenService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: TokenService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
4476
- TokenService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: TokenService, providedIn: 'root' });
4477
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: TokenService, decorators: [{
4478
- type: Injectable,
4479
- args: [{
4480
- providedIn: 'root'
4481
- }]
4482
- }], ctorParameters: function () { return [{ type: ApiService }]; } });
4483
-
4484
- const ACTIVATE_USER_PATH = 'accounts/activate/';
4485
- const BASE_PATH = 'accounts/user/';
4486
- const CREATE_USER_PATH = 'accounts/create-account/';
4487
- const RESET_PASSWORD_PATH = 'accounts/reset-password/';
4488
- const TERMINATE_USER_PATH = 'accounts/terminate/';
4489
- class UserService {
4490
- constructor(apiService) {
4491
- this.apiService = apiService;
4492
- }
4493
- activateUser(uidb64, token) {
4494
- return this.apiService.postResource(() => { }, Role.None, ACTIVATE_USER_PATH, {}, {
4495
- uidb64,
4496
- token
4497
- }).pipe(map(() => true), catchError(() => of(false)));
4498
- }
4499
- createUser(newAccount) {
4500
- return this.apiService.postResource(() => { }, Role.None, CREATE_USER_PATH, {}, newAccount)
4501
- .pipe(map(() => true), catchError(() => of(false)));
4502
- }
4503
- getCurrentUser() {
4504
- return this.apiService.getResource(userFactory, Role.None, BASE_PATH);
4505
- }
4506
- removeCurrentUser() {
4507
- return this.apiService.postResource(() => { }, Role.None, TERMINATE_USER_PATH, {}, {})
4508
- .pipe(map(() => true), catchError(() => of(false)));
4509
- }
4510
- resetPassword(email) {
4511
- return this.apiService.postResource(() => { }, Role.None, RESET_PASSWORD_PATH, {}, {
4512
- email
4513
- }).pipe(map(() => true), catchError(() => of(false)));
4514
- }
4515
- updateCurrentUser(user) {
4516
- let data = {
4517
- email: user.email,
4518
- first_name: user.firstName,
4519
- last_name: user.lastName,
4520
- device_token: user.deviceToken
4521
- };
4522
- if (user.newPassword) {
4523
- data['new_password'] = user.newPassword;
4524
- data['verify_password'] = user.verifyPassword;
4525
- data['password'] = user.password;
4526
- }
4527
- if (user.newEmail) {
4528
- data['new_email'] = user.newEmail;
4529
- }
4530
- if (user.language) {
4531
- data['language'] = user.language;
4532
- }
4533
- return this.apiService.updateResource(userFactory, Role.None, BASE_PATH, {}, data);
4534
- }
4535
- }
4536
- UserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: UserService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
4537
- UserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: UserService, providedIn: 'root' });
4538
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: UserService, decorators: [{
4539
- type: Injectable,
4540
- args: [{
4541
- providedIn: 'root'
4542
- }]
4543
- }], ctorParameters: function () { return [{ type: ApiService }]; } });
4544
-
4545
- const USER_NOTIFICATIONS_PATH = 'every-admin/user-notifications/clubs/:clubId/';
4546
- class UserNotificationService {
4547
- constructor(apiService) {
4548
- this.apiService = apiService;
4549
- }
4550
- getUserNotifications(clubId, offset = 0) {
4551
- return this.apiService.getCollection(userNotificationFactory, Role.None, USER_NOTIFICATIONS_PATH, { clubId }, { params: { offset: offset.toString(10) } });
4552
- }
4553
- }
4554
- UserNotificationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: UserNotificationService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
4555
- UserNotificationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: UserNotificationService, providedIn: 'root' });
4556
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: UserNotificationService, decorators: [{
4557
- type: Injectable,
4558
- args: [{
4559
- providedIn: 'root'
4560
- }]
4561
- }], ctorParameters: function () { return [{ type: ApiService }]; } });
4562
-
4563
- const APP = new InjectionToken('app');
4564
- const PUBLIC_AUTH_RETRIEVE_CODE_PATH = 'auth/retrieve-code/';
4565
- const PUBLIC_AUTH_TOKEN_PATH = 'auth/token/';
4566
- const PUBLIC_AUTH_CHANGE_TOKEN_PATH = 'auth/change-token/';
4567
- class AuthenticationService {
4568
- constructor(apiService, app, tokenService) {
4569
- this.apiService = apiService;
4570
- this.app = app;
4571
- this.tokenService = tokenService;
4572
- this.currentTokenSubject = new BehaviorSubject(null);
4573
- this.authentication = null;
4574
- this.publicAuthentication = null;
4575
- this.currentToken$ = this.currentTokenSubject.asObservable();
4576
- }
4577
- get isAuthenticated() {
4578
- return !!this.authentication;
4579
- }
4580
- authenticateByCredentials(username, password) {
4581
- return this.tokenService
4582
- .getTokenByCredentials(this.app.clientId, this.app.clientSecret, username, password)
4583
- .pipe(tap((token) => this.setToken(token)));
4584
- }
4585
- authenticateByToken(token) {
4586
- return this.tokenService
4587
- .getTokenByCode(this.app.authorizationCodeClientId || this.app.clientId, this.app.authorizationCodeClientSecret || this.app.clientSecret, token)
4588
- .pipe(tap((token) => this.setToken(token)));
4589
- }
4590
- clearAuthentication() {
4591
- this.authentication = null;
4592
- this.publicAuthentication = null;
4593
- this.currentTokenSubject.next(null);
4594
- }
4595
- clearPublicAuthentication() {
4596
- this.publicAuthentication = null;
4597
- }
4598
- getLoginCode(email, clubId) {
4599
- const params = { email };
4600
- if (clubId) {
4601
- params['club_id'] = clubId;
4602
- }
4603
- return this.apiService.getCollection(searchClubFactory, Role.Public, PUBLIC_AUTH_RETRIEVE_CODE_PATH, {}, { params });
4604
- }
4605
- getPublicToken(email, code, clubId) {
4606
- return this.apiService.postResource(publicAuthenticationFactory, Role.Public, PUBLIC_AUTH_TOKEN_PATH, {}, { email, code, club_id: clubId })
4607
- .pipe(tap((token) => this.setPublicToken(token)));
4608
- }
4609
- changePublicToken(memberId) {
4610
- return this.apiService.postResource(publicAuthenticationFactory, Role.Public, PUBLIC_AUTH_CHANGE_TOKEN_PATH, {}, { member_id: memberId })
4611
- .pipe(tap((token) => this.setPublicToken(token)));
4612
- }
4613
- getSessionToken() {
4614
- return this.tokenService
4615
- .getTokenBySession()
4616
- .pipe(tap((token) => {
4617
- if (token) {
4618
- this.setToken(token);
4619
- }
4620
- }));
4621
- }
4622
- logout() {
4623
- return this.tokenService
4624
- .logout()
4625
- .pipe(tap(() => this.clearAuthentication()));
4626
- }
4627
- reauthenticate(grantType = null) {
4628
- let clientId = this.app.clientId;
4629
- let clientSecret = this.app.clientSecret;
4630
- if (grantType == 'authorization_code') {
4631
- clientId = this.app.authorizationCodeClientId || this.app.clientId;
4632
- clientSecret = this.app.authorizationCodeClientSecret || this.app.clientSecret;
4633
- }
4634
- return this.tokenService
4635
- .getTokenByRefreshToken(clientId, clientSecret, this.authentication?.refreshToken)
4636
- .pipe(tap((token) => this.setToken(token)));
4637
- }
4638
- setAuthentication(accessToken, refreshToken) {
4639
- this.authentication = new Authentication(accessToken, refreshToken);
4640
- }
4641
- setPublicToken(token) {
4642
- this.publicAuthentication = new PublicAuthentication(token.token, token.tokenExpires);
4643
- }
4644
- setToken(token) {
4645
- this.currentTokenSubject.next(token);
4646
- this.setAuthentication(token.accessToken, token.refreshToken);
4647
- }
4648
- }
4649
- AuthenticationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: AuthenticationService, deps: [{ token: ApiService }, { token: APP }, { token: TokenService }], target: i0.ɵɵFactoryTarget.Injectable });
4650
- AuthenticationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: AuthenticationService, providedIn: 'root' });
4651
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: AuthenticationService, decorators: [{
4652
- type: Injectable,
4653
- args: [{
4654
- providedIn: 'root'
4655
- }]
4656
- }], ctorParameters: function () { return [{ type: ApiService }, { type: undefined, decorators: [{
4657
- type: Inject,
4658
- args: [APP]
4659
- }] }, { type: TokenService }]; } });
4660
-
4661
- class AuthenticationInterceptor {
4662
- constructor(authenticationService) {
4663
- this.authenticationService = authenticationService;
4664
- this.isRefreshing = false;
4665
- this.refreshTokenSubject = new BehaviorSubject(null);
4666
- }
4667
- intercept(request, next) {
4668
- const authentication = this.authenticationService.authentication;
4669
- const publicAuthentication = this.authenticationService.publicAuthentication;
4670
- if (authentication && request.url.indexOf('public') === -1) {
4671
- request = this.addAuthorizationHeader(request, authentication.accessToken);
4672
- }
4673
- else if (publicAuthentication && request.url.indexOf('public') !== -1) {
4674
- request = this.addAuthorizationHeader(request, publicAuthentication.token);
4675
- }
4676
- return next.handle(request).pipe(catchError((requestError) => {
4677
- if (request.url.indexOf('accounts/token/') === -1 && request.url.indexOf('public') === -1 && requestError instanceof HttpErrorResponse && requestError.status === 401) {
4678
- return this.handle401Error(request, next);
4679
- }
4680
- return throwError(() => requestError);
4681
- }));
4682
- }
4683
- addAuthorizationHeader(request, token) {
4684
- if (token) {
4685
- return request.clone({
4686
- setHeaders: { Authorization: `Bearer ${token}` }
4687
- });
4688
- }
4689
- return request;
4690
- }
4691
- handle401Error(request, next) {
4692
- if (this.isRefreshing) {
4693
- return this.refreshTokenSubject
4694
- .pipe(filter(token => token !== null), take(1), switchMap((token) => next.handle(this.addAuthorizationHeader(request, token?.accessToken))));
4695
- }
4696
- else {
4697
- this.isRefreshing = true;
4698
- this.refreshTokenSubject.next(null);
4699
- return this.authenticationService.reauthenticate()
4700
- .pipe(catchError((err) => {
4701
- this.isRefreshing = false;
4702
- this.authenticationService.clearAuthentication();
4703
- return throwError(() => err);
4704
- }), switchMap((token) => {
4705
- this.refreshTokenSubject.next(token);
4706
- this.isRefreshing = false;
4707
- return next.handle(this.addAuthorizationHeader(request, token.accessToken));
4708
- }));
4709
- }
4710
- }
4711
- }
4712
- AuthenticationInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: AuthenticationInterceptor, deps: [{ token: AuthenticationService }], target: i0.ɵɵFactoryTarget.Injectable });
4713
- AuthenticationInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: AuthenticationInterceptor, providedIn: 'root' });
4714
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: AuthenticationInterceptor, decorators: [{
4715
- type: Injectable,
4716
- args: [{
4717
- providedIn: 'root'
4718
- }]
4719
- }], ctorParameters: function () { return [{ type: AuthenticationService }]; } });
4720
-
4721
- const REDIRECT_PARAM_NAME = 'next';
4722
-
4723
- const GRANT_TOKEN_PATH = 'api/v3/accounts/user-token/';
4724
- class AuthenticatedGuard {
4725
- constructor(domain, authenticationService) {
4726
- this.domain = domain;
4727
- this.authenticationService = authenticationService;
4728
- }
4729
- canActivate(route, state) {
4730
- if (!this.authenticationService.isAuthenticated) {
4731
- const params = new HttpParams().set(REDIRECT_PARAM_NAME, state.url);
4732
- const request = new HttpRequest('GET', this.domain + GRANT_TOKEN_PATH, {
4733
- params
4734
- });
4735
- window.location.href = request.urlWithParams;
4736
- return false;
4737
- }
4738
- return true;
4739
- }
4740
- }
4741
- AuthenticatedGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: AuthenticatedGuard, deps: [{ token: DOMAIN }, { token: AuthenticationService }], target: i0.ɵɵFactoryTarget.Injectable });
4742
- AuthenticatedGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: AuthenticatedGuard, providedIn: 'root' });
4743
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: AuthenticatedGuard, decorators: [{
4744
- type: Injectable,
4745
- args: [{
4746
- providedIn: 'root'
4747
- }]
4748
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
4749
- type: Inject,
4750
- args: [DOMAIN]
4751
- }] }, { type: AuthenticationService }]; } });
4752
-
4753
- class HandleGrantTokenGuard {
4754
- constructor(authenticationService, router) {
4755
- this.authenticationService = authenticationService;
4756
- this.router = router;
4757
- }
4758
- canActivate(route) {
4759
- return this.authenticationService.authenticateByToken(route.params['code']).pipe(map(() => {
4760
- const redirectUrl = route.queryParamMap.get(REDIRECT_PARAM_NAME);
4761
- return this.authenticationService.isAuthenticated && redirectUrl
4762
- ? this.router.parseUrl(redirectUrl)
4763
- : false;
4764
- }));
4765
- }
4766
- }
4767
- HandleGrantTokenGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: HandleGrantTokenGuard, deps: [{ token: AuthenticationService }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Injectable });
4768
- HandleGrantTokenGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: HandleGrantTokenGuard, providedIn: 'root' });
4769
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: HandleGrantTokenGuard, decorators: [{
4770
- type: Injectable,
4771
- args: [{
4772
- providedIn: 'root'
4773
- }]
4774
- }], ctorParameters: function () { return [{ type: AuthenticationService }, { type: i2.Router }]; } });
4775
-
4776
- class MaintenanceInterceptor {
4777
- constructor(maintenanceModeService) {
4778
- this.maintenanceModeService = maintenanceModeService;
4779
- }
4780
- intercept(request, next) {
4781
- let maintenanceMode = false;
4782
- return next.handle(request).pipe(catchError((requestError) => {
4783
- if (requestError instanceof HttpErrorResponse && requestError.status === 503) {
4784
- maintenanceMode = true;
4785
- }
4786
- return throwError(() => requestError);
4787
- }), finalize(() => this.maintenanceModeService.setMaintenanceMode(maintenanceMode)));
4788
- }
4789
- }
4790
- MaintenanceInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: MaintenanceInterceptor, deps: [{ token: MaintenanceModeService }], target: i0.ɵɵFactoryTarget.Injectable });
4791
- MaintenanceInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: MaintenanceInterceptor, providedIn: 'root' });
4792
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: MaintenanceInterceptor, decorators: [{
4793
- type: Injectable,
4794
- args: [{
4795
- providedIn: 'root'
4796
- }]
4797
- }], ctorParameters: function () { return [{ type: MaintenanceModeService }]; } });
4798
-
4799
- class DataAccessModule {
4800
- static forRoot(config) {
4801
- return {
4802
- ngModule: DataAccessModule,
4803
- providers: [
4804
- { provide: APP, useValue: config.app },
4805
- { provide: DOMAIN, useValue: config.domain },
4806
- { provide: HTTP_INTERCEPTORS, useExisting: AuthenticationInterceptor, multi: true },
4807
- { provide: HTTP_INTERCEPTORS, useExisting: MaintenanceInterceptor, multi: true }
4808
- ]
4809
- };
4810
- }
4811
- }
4812
- DataAccessModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: DataAccessModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4813
- DataAccessModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.11", ngImport: i0, type: DataAccessModule });
4814
- DataAccessModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: DataAccessModule });
4815
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: DataAccessModule, decorators: [{
4816
- type: NgModule,
4817
- args: [{
4818
- imports: [] // TODO: Check if this is required
4819
- }]
4820
- }] });
4821
-
4822
- /*
4823
- * Public API Surface of data-access
4824
- */
4825
-
4826
- /**
4827
- * Generated bundle index. Do not edit.
4828
- */
4829
-
4830
- export { APP, Activity, ActivityExtraMember, ActivityInvite, ActivityLocation, ActivityLocationGroup, ActivityLocationPart, ActivityLocationTag, ActivityParticipant, ActivityService, ActivitySettings, ActivityType, Auth, AuthMember, AuthSection, AuthService, AuthTeam, AuthTeamSection, AuthenticatedGuard, Authentication, AuthenticationInterceptor, AuthenticationService, BookableGroup, BookableItem, BookablePart, BookableService, BookableTag, BookingCalendar, BookingCalendarApplicationTime, BookingCalendarService, BookingCalendarSlot, BookingCalendarSlotSession, BookingSettings, BookingSlotFilter, Calendar, CalendarEvent, Card, CardDeal, CardLogo, CardLogoUrls, CardMemberTicket, CardTheme, CardTicket, CardTicketLocation, Club, ClubImage, ClubSection, ClubService, Collection, ConstantService, Contact, CreditCard, DataAccessModule, Directory, Email, EmailService, Event, ExternalLink, ExternalLinkService, FileObject, FileService, GeneralImage, Giro, GroupRole, HandleGrantTokenGuard, HomeTeam, ImageUrls, InvoiceService, MaintenanceModeService, Member, MemberActivityInvite, MemberAttribute, MemberCard, MemberCardService, MemberContact, MemberFee, MemberFunction, MemberInvoice, MemberInvoiceRow, MemberPublicForm, MemberPublicFormField, MemberPublicFormFieldOption, MemberPublicFormService, MemberService, MemberTeam, MemberTeamThrough, MemberType, MemberValidationSettings, News, NewsService, OpenActivity, OptionalFee, OtherMember, OtherMemberField, OverbookedBookableItem, OverbookedLocation, Partner, PaymentAttempt, PaymentAttemptService, PublicAuthentication, RegistrationQRCode, RegistrationQRCodeService, Role, SearchClub, SearchMember, SearchMemberCard, SearchMemberInvoice, SearchTeam, Section, SectionService, Swish, SwishQrCode, TeamService, Token, TokenService, USER_NOTIFICATIONS_PATH, UnpaidMemberInvoice, User, UserNotification, UserNotificationService, UserService, Zimpler };
4831
- //# sourceMappingURL=myclub_se-data-access.mjs.map