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