@myclub_se/data-access 1.5.3 → 1.7.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 (71) hide show
  1. package/esm2020/lib/api-models/api-booking-calendar-slot-session.mjs +2 -0
  2. package/esm2020/lib/api-models/api-booking-calendar-slot.mjs +2 -0
  3. package/esm2020/lib/api-models/api-booking-calendar.mjs +2 -0
  4. package/esm2020/lib/api-models/api-member-activity-invite.mjs +1 -1
  5. package/esm2020/lib/api-models/api-member-team.mjs +1 -1
  6. package/esm2020/lib/api-models/api-search-team.mjs +2 -0
  7. package/esm2020/lib/api-models/index.mjs +5 -4
  8. package/esm2020/lib/models/booking-calendar-slot-session.mjs +26 -0
  9. package/esm2020/lib/models/booking-calendar-slot.mjs +29 -0
  10. package/esm2020/lib/models/booking-calendar.mjs +28 -0
  11. package/esm2020/lib/models/index.mjs +4 -3
  12. package/esm2020/lib/models/member-activity-invite.mjs +3 -2
  13. package/esm2020/lib/models/member-team.mjs +3 -2
  14. package/esm2020/lib/models/search-team.mjs +5 -2
  15. package/esm2020/lib/services/activity.service.mjs +13 -2
  16. package/esm2020/lib/services/booking-calendar.service.mjs +143 -0
  17. package/esm2020/lib/services/factories/booking-calendar-factory.mjs +3 -0
  18. package/esm2020/lib/services/factories/booking-calendar-slot-factory.mjs +4 -0
  19. package/esm2020/lib/services/factories/booking-calendar-slot-session-factory.mjs +3 -0
  20. package/esm2020/lib/services/factories/index.mjs +1 -4
  21. package/esm2020/lib/services/factories/member-invite-factory.mjs +2 -2
  22. package/esm2020/lib/services/factories/member-team-factory.mjs +2 -2
  23. package/esm2020/lib/services/factories/search-team-factory.mjs +5 -0
  24. package/esm2020/lib/services/index.mjs +2 -1
  25. package/esm2020/lib/services/team.service.mjs +8 -7
  26. package/esm2020/lib/types/booking-calendar-slot-type.mjs +2 -0
  27. package/fesm2015/myclub_se-data-access.mjs +251 -33
  28. package/fesm2015/myclub_se-data-access.mjs.map +1 -1
  29. package/fesm2020/myclub_se-data-access.mjs +251 -33
  30. package/fesm2020/myclub_se-data-access.mjs.map +1 -1
  31. package/lib/api-models/api-booking-calendar-slot-session.d.ts +10 -0
  32. package/lib/api-models/api-booking-calendar-slot.d.ts +16 -0
  33. package/lib/api-models/api-booking-calendar.d.ts +11 -0
  34. package/lib/api-models/api-member-activity-invite.d.ts +1 -0
  35. package/lib/api-models/api-member-team.d.ts +1 -0
  36. package/lib/api-models/api-search-team.d.ts +8 -0
  37. package/lib/api-models/index.d.ts +4 -3
  38. package/lib/models/booking-calendar-slot-session.d.ts +22 -0
  39. package/lib/models/booking-calendar-slot.d.ts +27 -0
  40. package/lib/models/booking-calendar.d.ts +24 -0
  41. package/lib/models/index.d.ts +3 -2
  42. package/lib/models/member-activity-invite.d.ts +2 -1
  43. package/lib/models/member-team.d.ts +2 -1
  44. package/lib/models/search-team.d.ts +6 -1
  45. package/lib/services/activity.service.d.ts +1 -0
  46. package/lib/services/booking-calendar.service.d.ts +27 -0
  47. package/lib/services/factories/booking-calendar-factory.d.ts +3 -0
  48. package/lib/services/factories/booking-calendar-slot-factory.d.ts +3 -0
  49. package/lib/services/factories/booking-calendar-slot-session-factory.d.ts +3 -0
  50. package/lib/services/factories/index.d.ts +0 -3
  51. package/lib/services/factories/search-team-factory.d.ts +3 -0
  52. package/lib/services/index.d.ts +1 -0
  53. package/lib/services/team.service.d.ts +4 -4
  54. package/lib/types/booking-calendar-slot-type.d.ts +1 -0
  55. package/package.json +1 -1
  56. package/esm2020/lib/api-models/api-club-team.mjs +0 -2
  57. package/esm2020/lib/api-models/api-search-member-team.mjs +0 -2
  58. package/esm2020/lib/api-models/api-section-team.mjs +0 -2
  59. package/esm2020/lib/models/club-team.mjs +0 -7
  60. package/esm2020/lib/models/search-member-team.mjs +0 -9
  61. package/esm2020/lib/services/factories/club-team-factory.mjs +0 -3
  62. package/esm2020/lib/services/factories/search-member-team-factory.mjs +0 -5
  63. package/esm2020/lib/services/factories/section-team-factory.mjs +0 -3
  64. package/lib/api-models/api-club-team.d.ts +0 -4
  65. package/lib/api-models/api-search-member-team.d.ts +0 -7
  66. package/lib/api-models/api-section-team.d.ts +0 -4
  67. package/lib/models/club-team.d.ts +0 -5
  68. package/lib/models/search-member-team.d.ts +0 -8
  69. package/lib/services/factories/club-team-factory.d.ts +0 -3
  70. package/lib/services/factories/search-member-team-factory.d.ts +0 -3
  71. package/lib/services/factories/section-team-factory.d.ts +0 -3
@@ -218,6 +218,86 @@ class Authentication {
218
218
  }
219
219
  }
220
220
 
221
+ class BookingCalendar {
222
+ constructor(id, club_id, section_id, team_id, club_name, color, name, section_name, team_name) {
223
+ this.id = id;
224
+ this.club_id = club_id;
225
+ this.section_id = section_id;
226
+ this.team_id = team_id;
227
+ this.club_name = club_name;
228
+ this.color = color;
229
+ this.name = name;
230
+ this.section_name = section_name;
231
+ this.team_name = team_name;
232
+ }
233
+ static asFormGroup(calendar) {
234
+ return new FormGroup({
235
+ id: new FormControl(calendar?.id || ''),
236
+ club_id: new FormControl(calendar?.club_id || ''),
237
+ section_id: new FormControl(calendar?.section_id || ''),
238
+ team_id: new FormControl(calendar?.team_id || ''),
239
+ club_name: new FormControl(calendar?.club_name || ''),
240
+ color: new FormControl(calendar?.color || '', Validators.required),
241
+ name: new FormControl(calendar?.name || '', Validators.required),
242
+ section_name: new FormControl(calendar?.section_name || ''),
243
+ team_name: new FormControl(calendar?.team_name || '')
244
+ });
245
+ }
246
+ }
247
+
248
+ class BookingCalendarSlot {
249
+ constructor(id, calendar_id, location_id, color, day, end_time, location_name, number_of_available_sessions, sessions, start_time, type) {
250
+ this.id = id;
251
+ this.calendar_id = calendar_id;
252
+ this.location_id = location_id;
253
+ this.color = color;
254
+ this.day = day;
255
+ this.end_time = end_time;
256
+ this.location_name = location_name;
257
+ this.number_of_available_sessions = number_of_available_sessions;
258
+ this.sessions = sessions;
259
+ this.start_time = start_time;
260
+ this.type = type;
261
+ }
262
+ static asFormGroup(slot) {
263
+ return new FormGroup({
264
+ id: new FormControl(slot?.id || ''),
265
+ calendar_id: new FormControl(slot?.calendar_id || ''),
266
+ location_id: new FormControl(slot?.location_id || '', Validators.required),
267
+ day: new FormControl(slot?.day || '', Validators.required),
268
+ end_time: new FormControl(slot?.end_time || '', Validators.required),
269
+ number_of_available_sessions: new FormControl(slot?.number_of_available_sessions || 0, Validators.required),
270
+ start_time: new FormControl(slot?.start_time || '', Validators.required),
271
+ type: new FormControl(slot?.type || '', Validators.required),
272
+ });
273
+ }
274
+ }
275
+
276
+ class BookingCalendarSlotSession {
277
+ constructor(id, section_id, slot_id, team_id, end_time, section_name, start_time, team_name) {
278
+ this.id = id;
279
+ this.section_id = section_id;
280
+ this.slot_id = slot_id;
281
+ this.team_id = team_id;
282
+ this.end_time = end_time;
283
+ this.section_name = section_name;
284
+ this.start_time = start_time;
285
+ this.team_name = team_name;
286
+ }
287
+ static asFormGroup(session) {
288
+ return new FormGroup({
289
+ id: new FormControl(session?.id || ''),
290
+ section_id: new FormControl(session?.section_id || ''),
291
+ slot_id: new FormControl(session?.slot_id || '', Validators.required),
292
+ team_id: new FormControl(session?.team_id || ''),
293
+ end_time: new FormControl(session?.end_time || '', Validators.required),
294
+ section_name: new FormControl(session?.section_name || ''),
295
+ start_time: new FormControl(session?.start_time || '', Validators.required),
296
+ team_name: new FormControl(session?.team_name || '')
297
+ });
298
+ }
299
+ }
300
+
221
301
  class Calendar {
222
302
  constructor(id, club_id, section_id, name, types_to_show) {
223
303
  this.id = id;
@@ -404,13 +484,6 @@ class ClubSection {
404
484
  }
405
485
  }
406
486
 
407
- class ClubTeam {
408
- constructor(id, name) {
409
- this.id = id;
410
- this.name = name;
411
- }
412
- }
413
-
414
487
  class Collection {
415
488
  constructor(count, next, previous, resources) {
416
489
  this.count = count;
@@ -895,9 +968,10 @@ class SearchMember {
895
968
  }
896
969
 
897
970
  class MemberActivityInvite {
898
- constructor(id, comment, last_invite, leader, member_email, member_id, member_name, next_invite, response_date, status) {
971
+ constructor(id, comment, current_num_attendants, last_invite, leader, member_email, member_id, member_name, next_invite, response_date, status) {
899
972
  this.id = id;
900
973
  this.comment = comment;
974
+ this.current_num_attendants = current_num_attendants;
901
975
  this.last_invite = last_invite;
902
976
  this.leader = leader;
903
977
  this.member_email = member_email;
@@ -935,13 +1009,14 @@ class MemberPublicForm {
935
1009
  }
936
1010
 
937
1011
  class MemberTeam {
938
- constructor(club, section, id, email, name, phone) {
1012
+ constructor(club, section, id, email, name, phone, section_name) {
939
1013
  this.club = club;
940
1014
  this.section = section;
941
1015
  this.id = id;
942
1016
  this.email = email;
943
1017
  this.name = name;
944
1018
  this.phone = phone;
1019
+ this.section_name = section_name;
945
1020
  }
946
1021
  }
947
1022
 
@@ -1027,19 +1102,13 @@ class SearchClub {
1027
1102
  }
1028
1103
  }
1029
1104
 
1030
- class SearchMemberTeam {
1031
- constructor(club, id, name, section) {
1105
+ class SearchTeam {
1106
+ constructor(club, section, id, name, section_name) {
1032
1107
  this.club = club;
1033
- this.id = id;
1034
- this.name = name;
1035
1108
  this.section = section;
1036
- }
1037
- }
1038
-
1039
- class SearchTeam {
1040
- constructor(id, name) {
1041
1109
  this.id = id;
1042
1110
  this.name = name;
1111
+ this.section_name = section_name;
1043
1112
  }
1044
1113
  }
1045
1114
 
@@ -1204,7 +1273,7 @@ const memberFactory = (apiMember) => new Member(apiMember.id, apiMember.club_id,
1204
1273
  const activityExtraMemberFactory = (apiActivityExtraMember) => new ActivityExtraMember(apiActivityExtraMember.id, apiActivityExtraMember.member_id, apiActivityExtraMember.team_id, apiActivityExtraMember.created, apiActivityExtraMember.leader, apiActivityExtraMember.member.birth_date ?
1205
1274
  memberFactory(apiActivityExtraMember.member) : searchMemberFactory(apiActivityExtraMember.member), apiActivityExtraMember.member_name);
1206
1275
 
1207
- const memberActivityInviteFactory = (invitedMember) => new MemberActivityInvite(invitedMember.id, invitedMember.comment, invitedMember.last_invite, invitedMember.leader, invitedMember.member_email, invitedMember.member_id, invitedMember.member_name, invitedMember.next_invite, invitedMember.response_date, invitedMember.status);
1276
+ 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);
1208
1277
 
1209
1278
  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, '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);
1210
1279
 
@@ -1258,8 +1327,6 @@ const clubImageFactory = (apiClubImage) => new ClubImage(apiClubImage.club_id, a
1258
1327
 
1259
1328
  const clubSectionFactory = (apiSection) => new ClubSection(apiSection.id, apiSection.name);
1260
1329
 
1261
- const clubTeamFactory = (apiClubTeam) => new SearchTeam(apiClubTeam.id, apiClubTeam.name);
1262
-
1263
1330
  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);
1264
1331
 
1265
1332
  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);
@@ -1288,7 +1355,7 @@ const memberPublicFormFactory = (apiMemberPublicForm) => new MemberPublicForm(ap
1288
1355
 
1289
1356
  const sectionFactory = (apiSection) => new Section(apiSection.id, apiSection.name);
1290
1357
 
1291
- const memberTeamFactory = (apiMemberTeam) => new MemberTeam(clubFactory(apiMemberTeam.club), apiMemberTeam.section ? sectionFactory(apiMemberTeam.section) : null, apiMemberTeam.id, apiMemberTeam.email, apiMemberTeam.name, apiMemberTeam.phone);
1358
+ const memberTeamFactory = (apiMemberTeam) => new MemberTeam(clubFactory(apiMemberTeam.club), apiMemberTeam.section ? sectionFactory(apiMemberTeam.section) : null, apiMemberTeam.id, apiMemberTeam.email, apiMemberTeam.name, apiMemberTeam.phone, apiMemberTeam.section_name);
1292
1359
 
1293
1360
  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);
1294
1361
 
@@ -1322,12 +1389,8 @@ const searchMemberCardFactory = (apiSearchMemberCard) => new SearchMemberCard(ap
1322
1389
 
1323
1390
  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);
1324
1391
 
1325
- const searchMemberTeamFactory = (apiSearchMemberTeam) => new SearchMemberTeam(clubFactory(apiSearchMemberTeam.club), apiSearchMemberTeam.id, apiSearchMemberTeam.name, apiSearchMemberTeam.section ? sectionFactory(apiSearchMemberTeam.section) : null);
1326
-
1327
1392
  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);
1328
1393
 
1329
- const sectionTeamFactory = (apiSectionTeam) => new SearchTeam(apiSectionTeam.id, apiSectionTeam.name);
1330
-
1331
1394
  const tokenFactory = (apiToken) => new Token(apiToken.access_token, apiToken.refresh_token);
1332
1395
 
1333
1396
  const userFactory = (apiUser) => new User(apiUser.device_token, apiUser.email, apiUser.first_name, apiUser.is_staff, apiUser.language, apiUser.last_name, apiUser.new_email);
@@ -1391,13 +1454,14 @@ const TEAM_ACTIVITIES_PATH = ':teamId/activities/';
1391
1454
  const TEAM_ACTIVITY_INVITES_PATH = ':teamId/activities/:activityId/invites/';
1392
1455
  const TEAM_ACTIVITY_INVITE_PATH = ':teamId/activities/:activityId/invites/:activityInviteId/';
1393
1456
  const TEAM_ACTIVITY_INVITE_RESEND_PATH = ':teamId/activities/:activityId/invites/:activityInviteId/resend-invite/';
1394
- const TEAM_ACTIVITY_LOCATIONS_PATH = ':teamId/activities/locations/';
1395
1457
  const TEAM_ACTIVITY_NEW_PATH = ':teamId/activities/new/';
1396
1458
  const TEAM_ACTIVITY_PARTICIPANTS_PATH = ':teamId/activities/:activityId/participants/';
1397
1459
  const TEAM_ACTIVITY_PATH = ':teamId/activities/:id/';
1398
1460
  const TEAM_ACTIVITY_SETTINGS_PATH = ':teamId/activities/settings/';
1399
1461
  const TEAM_ACTIVITY_TYPES_PATH = ':teamId/activities/types/';
1400
1462
  const TEAM_CALENDAR_PATH = ':teamId/activities/calendar/';
1463
+ const TEAM_ACTIVITY_LOCATIONS_PATH = ':teamId/activities/locations/';
1464
+ const CLUB_ACTIVITY_LOCATIONS_PATH = ':clubId/activities/locations/';
1401
1465
  class ActivityService {
1402
1466
  constructor(apiService) {
1403
1467
  this.apiService = apiService;
@@ -1480,6 +1544,16 @@ class ActivityService {
1480
1544
  this.activityLocationCollection = activityLocationCollection;
1481
1545
  }));
1482
1546
  }
1547
+ getClubActivityLocations(clubId) {
1548
+ if (this.activityLocationResponseDate && this.activityLocationResponseDate > sub(new Date(), { hours: 1 })) {
1549
+ return of(this.activityLocationCollection);
1550
+ }
1551
+ return this.apiService
1552
+ .getCollection(activityLocationFactory, Role.ClubAdmin, CLUB_ACTIVITY_LOCATIONS_PATH, { clubId }, { params: { limit: 'null' } }).pipe(tap((activityLocationCollection) => {
1553
+ this.activityLocationResponseDate = new Date();
1554
+ this.activityLocationCollection = activityLocationCollection;
1555
+ }));
1556
+ }
1483
1557
  getTeamActivityNew(teamId) {
1484
1558
  return this.apiService
1485
1559
  .getResource(activityFactory, Role.TeamAdmin, TEAM_ACTIVITY_NEW_PATH, { teamId });
@@ -1588,6 +1662,148 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImpo
1588
1662
  }]
1589
1663
  }], ctorParameters: function () { return [{ type: ApiService }]; } });
1590
1664
 
1665
+ const bookingCalendarFactory = (apiBookingCalendar) => new BookingCalendar(apiBookingCalendar.id, apiBookingCalendar.club_id, apiBookingCalendar.section_id, apiBookingCalendar.team_id, apiBookingCalendar.club_name, apiBookingCalendar.color, apiBookingCalendar.name, apiBookingCalendar.section_name, apiBookingCalendar.team_name);
1666
+
1667
+ const bookingCalendarSlotSessionFactory = (apiBookingSlotSession) => new BookingCalendarSlotSession(apiBookingSlotSession.id, apiBookingSlotSession.section_id, apiBookingSlotSession.slot_id, apiBookingSlotSession.team_id, apiBookingSlotSession.end_time, apiBookingSlotSession.section_name, apiBookingSlotSession.start_time, apiBookingSlotSession.team_name);
1668
+
1669
+ const bookingCalendarSlotFactory = (apiBookingSlot) => new BookingCalendarSlot(apiBookingSlot.id, apiBookingSlot.calendar_id, apiBookingSlot.location_id, apiBookingSlot.color, apiBookingSlot.day, apiBookingSlot.end_time, apiBookingSlot.location_name, apiBookingSlot.number_of_available_sessions, apiBookingSlot.sessions && apiBookingSlot.sessions.length ? apiBookingSlot.sessions.map((apiBookingSlotSession) => bookingCalendarSlotSessionFactory(apiBookingSlotSession)) : [], apiBookingSlot.start_time, apiBookingSlot.type);
1670
+
1671
+ const CLUB_BOOKING_CALENDARS_PATH = ':clubId/activities/calendars/';
1672
+ const CLUB_BOOKING_CALENDAR_PATH = ':clubId/activities/calendars/:id/';
1673
+ const CLUB_BOOKING_CALENDAR_SLOTS_PATH = ':clubId/activities/slots/';
1674
+ const CLUB_BOOKING_CALENDAR_SLOT_PATH = ':clubId/activities/slots/:id/';
1675
+ const CLUB_BOOKING_CALENDAR_SLOT_SESSIONS_PATH = ':clubId/activities/sessions/';
1676
+ const CLUB_BOOKING_CALENDAR_SLOT_SESSION_PATH = ':clubId/activities/sessions/:id/';
1677
+ class BookingCalendarService {
1678
+ constructor(apiService) {
1679
+ this.apiService = apiService;
1680
+ }
1681
+ // region Booking calendar
1682
+ createClubBookingCalendar(clubId, calendar) {
1683
+ delete calendar.id;
1684
+ return this.apiService
1685
+ .postResource(bookingCalendarFactory, Role.ClubAdmin, CLUB_BOOKING_CALENDARS_PATH, {
1686
+ clubId,
1687
+ }, calendar);
1688
+ }
1689
+ getClubBookingCalendars(clubId, name = null) {
1690
+ const params = { limit: 'null' };
1691
+ if (name) {
1692
+ params['name'] = name;
1693
+ }
1694
+ return this.apiService
1695
+ .getCollection(bookingCalendarFactory, Role.ClubAdmin, CLUB_BOOKING_CALENDARS_PATH, { clubId }, {
1696
+ params
1697
+ });
1698
+ }
1699
+ getClubBookingCalendar(clubId, id) {
1700
+ return this.apiService
1701
+ .getResource(bookingCalendarFactory, Role.ClubAdmin, CLUB_BOOKING_CALENDAR_PATH, { clubId, id });
1702
+ }
1703
+ updateClubBookingCalendar(clubId, calendar) {
1704
+ return this.apiService
1705
+ .updateResource(bookingCalendarFactory, Role.ClubAdmin, CLUB_BOOKING_CALENDAR_PATH, {
1706
+ clubId,
1707
+ id: calendar.id
1708
+ }, calendar);
1709
+ }
1710
+ deleteClubBookingCalendar(clubId, id) {
1711
+ return this.apiService
1712
+ .deleteResource(Role.ClubAdmin, CLUB_BOOKING_CALENDAR_PATH, {
1713
+ clubId,
1714
+ id
1715
+ });
1716
+ }
1717
+ // endregion
1718
+ // region Booking calendar slot
1719
+ createClubBookingCalendarSlot(clubId, slot) {
1720
+ delete slot.id;
1721
+ return this.apiService
1722
+ .postResource(bookingCalendarSlotFactory, Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOTS_PATH, {
1723
+ clubId,
1724
+ }, slot);
1725
+ }
1726
+ getClubBookingCalendarSlots(clubId, startDate = null, endDate = null) {
1727
+ const params = { limit: 'null' };
1728
+ if (startDate) {
1729
+ params['day__gte'] = startDate;
1730
+ }
1731
+ if (endDate) {
1732
+ params['day__lte'] = endDate;
1733
+ }
1734
+ return this.apiService
1735
+ .getCollection(bookingCalendarSlotFactory, Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOTS_PATH, { clubId }, {
1736
+ params
1737
+ });
1738
+ }
1739
+ getClubBookingCalendarSlot(clubId, id) {
1740
+ return this.apiService
1741
+ .getResource(bookingCalendarSlotFactory, Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOT_PATH, { clubId, id });
1742
+ }
1743
+ updateClubBookingCalendarSlot(clubId, slot) {
1744
+ return this.apiService
1745
+ .updateResource(bookingCalendarSlotFactory, Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOT_PATH, {
1746
+ clubId,
1747
+ id: slot.id
1748
+ }, slot);
1749
+ }
1750
+ deleteClubBookingCalendarSlot(clubId, id) {
1751
+ return this.apiService
1752
+ .deleteResource(Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOT_PATH, {
1753
+ clubId,
1754
+ id
1755
+ });
1756
+ }
1757
+ // endregion
1758
+ // region Booking calendar slot session
1759
+ createClubBookingCalendarSlotSession(clubId, session) {
1760
+ delete session.id;
1761
+ return this.apiService
1762
+ .postResource(bookingCalendarSlotSessionFactory, Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOT_SESSIONS_PATH, {
1763
+ clubId,
1764
+ }, session);
1765
+ }
1766
+ getClubBookingCalendarSlotSessions(clubId, startDate = null, endDate = null) {
1767
+ const params = { limit: 'null' };
1768
+ if (startDate) {
1769
+ params['day__gte'] = startDate;
1770
+ }
1771
+ if (endDate) {
1772
+ params['day__lte'] = endDate;
1773
+ }
1774
+ return this.apiService
1775
+ .getCollection(bookingCalendarSlotSessionFactory, Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOT_SESSIONS_PATH, { clubId }, {
1776
+ params
1777
+ });
1778
+ }
1779
+ getClubBookingCalendarSlotSession(clubId, id) {
1780
+ return this.apiService
1781
+ .getResource(bookingCalendarSlotSessionFactory, Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOT_SESSION_PATH, { clubId, id });
1782
+ }
1783
+ updateClubBookingCalendarSlotSession(clubId, session) {
1784
+ return this.apiService
1785
+ .updateResource(bookingCalendarSlotSessionFactory, Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOT_SESSION_PATH, {
1786
+ clubId,
1787
+ id: session.id
1788
+ }, session);
1789
+ }
1790
+ deleteClubBookingCalendarSlotSession(clubId, id) {
1791
+ return this.apiService
1792
+ .deleteResource(Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOT_SESSION_PATH, {
1793
+ clubId,
1794
+ id
1795
+ });
1796
+ }
1797
+ }
1798
+ BookingCalendarService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: BookingCalendarService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1799
+ BookingCalendarService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: BookingCalendarService, providedIn: 'root' });
1800
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: BookingCalendarService, decorators: [{
1801
+ type: Injectable,
1802
+ args: [{
1803
+ providedIn: 'root'
1804
+ }]
1805
+ }], ctorParameters: function () { return [{ type: ApiService }]; } });
1806
+
1591
1807
  const MEMBER_CLUB_INFO = ':memberId/club-info/';
1592
1808
  const TEAM_CLUB_INFO = ':teamId/club-info/';
1593
1809
  class ClubService {
@@ -2215,6 +2431,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImpo
2215
2431
  }]
2216
2432
  }], ctorParameters: function () { return [{ type: ApiService }]; } });
2217
2433
 
2434
+ const searchTeamFactory = (apiSearchTeam) => new SearchTeam(apiSearchTeam.club ? clubFactory(apiSearchTeam.club) : undefined, apiSearchTeam.section ? sectionFactory(apiSearchTeam.section) : undefined, apiSearchTeam.id, apiSearchTeam.name, apiSearchTeam.section_name);
2435
+
2218
2436
  const CLUB_TEAMS_PATH = ':clubId/teams/';
2219
2437
  const MEMBER_TEAM_MEMBER_PATH = ':memberId/teams/:teamId/team-members/:id/';
2220
2438
  const MEMBER_TEAM_MEMBERS_PATH = ':memberId/teams/:teamId/team-members/';
@@ -2222,7 +2440,7 @@ const MEMBER_TEAM_EXTRA_MEMBER_PATH = ':memberId/teams/:teamId/extra-members/:id
2222
2440
  const MEMBER_TEAM_EXTRA_MEMBERS_PATH = ':memberId/teams/:teamId/extra-members/';
2223
2441
  const MEMBER_TEAM_PATH = ':memberId/teams/:teamId/';
2224
2442
  const MEMBER_TEAMS_PATH = ':memberId/teams/';
2225
- const SECTION_TEAMS_PATH = 'sections/:sectionId/teams/';
2443
+ const SECTION_TEAMS_PATH = ':sectionId/teams/';
2226
2444
  const TEAM_LEADER_TEAM_MEMBER_PATH = ':teamId/team-members/:id/';
2227
2445
  const TEAM_LEADER_TEAM_MEMBERS_PATH = ':teamId/team-members/';
2228
2446
  const TEAM_LEADER_TEAM_PATH = ':teamId/team-detail/';
@@ -2236,7 +2454,7 @@ class TeamService {
2236
2454
  return this.apiService.deleteResource(Role.TeamAdmin, TEAM_LEADER_TEAM_MEMBER_PATH, { teamId, id });
2237
2455
  }
2238
2456
  getClubTeams(clubId) {
2239
- return this.apiService.getCollection(clubTeamFactory, Role.ClubAdmin, CLUB_TEAMS_PATH, { clubId });
2457
+ return this.apiService.getCollection(searchTeamFactory, Role.ClubAdmin, CLUB_TEAMS_PATH, { clubId });
2240
2458
  }
2241
2459
  getMemberTeam(memberId, teamId) {
2242
2460
  return this.apiService.getResource(memberTeamFactory, Role.MemberAdmin, MEMBER_TEAM_PATH, { memberId, teamId });
@@ -2254,10 +2472,10 @@ class TeamService {
2254
2472
  return this.apiService.getCollection(searchMemberTeamThroughFactory, Role.MemberAdmin, MEMBER_TEAM_MEMBERS_PATH, { memberId, teamId }, { params: { member_q: q, offset: offset.toString(10) } });
2255
2473
  }
2256
2474
  getMemberTeams(memberId) {
2257
- return this.apiService.getCollection(searchMemberTeamFactory, Role.MemberAdmin, MEMBER_TEAMS_PATH, { memberId });
2475
+ return this.apiService.getCollection(searchTeamFactory, Role.MemberAdmin, MEMBER_TEAMS_PATH, { memberId });
2258
2476
  }
2259
- getSectionTeams(role, sectionId) {
2260
- return this.apiService.getCollection(sectionTeamFactory, role, SECTION_TEAMS_PATH, { sectionId });
2477
+ getSectionTeams(sectionId) {
2478
+ return this.apiService.getCollection(searchTeamFactory, Role.SectionAdmin, SECTION_TEAMS_PATH, { sectionId });
2261
2479
  }
2262
2480
  getTeamLeaderTeam(teamId) {
2263
2481
  return this.apiService.getResource(memberTeamFactory, Role.TeamAdmin, TEAM_LEADER_TEAM_PATH, { teamId });
@@ -2627,5 +2845,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImpo
2627
2845
  * Generated bundle index. Do not edit.
2628
2846
  */
2629
2847
 
2630
- export { APP, Activity, ActivityExtraMember, ActivityInvite, ActivityLocation, ActivityService, ActivitySettings, ActivityType, Auth, AuthMember, AuthSection, AuthService, AuthTeam, AuthTeamSection, AuthenticatedGuard, Authentication, AuthenticationInterceptor, AuthenticationService, Calendar, CalendarEvent, Card, CardDeal, CardLogo, CardLogoUrls, CardMemberTicket, CardTheme, CardTicket, CardTicketLocation, Club, ClubImage, ClubSection, ClubService, ClubTeam, Collection, ConstantService, Contact, CreditCard, DataAccessModule, Directory, Email, EmailRecipient, EmailService, Event, ExternalLink, ExternalLinkService, FileObject, FileService, GeneralImage, Giro, HandleGrantTokenGuard, HomeTeam, ImageUrls, InvoiceService, Member, MemberActivityInvite, MemberAttribute, MemberCard, MemberCardService, MemberContact, MemberFee, MemberFunction, MemberInvoice, MemberInvoiceRow, MemberPublicForm, MemberPublicFormService, MemberService, MemberTeam, MemberTeamThrough, MemberValidationSettings, News, NewsService, Partner, PaymentAttempt, PaymentAttemptService, Role, SearchClub, SearchMember, SearchMemberCard, SearchMemberInvoice, SearchMemberTeam, SearchTeam, Section, SectionService, Swish, SwishQrCode, TeamService, Token, TokenService, USER_NOTIFICATIONS_PATH, UnpaidMemberInvoice, User, UserNotification, UserNotificationService, UserService, Zimpler };
2848
+ export { APP, Activity, ActivityExtraMember, ActivityInvite, ActivityLocation, ActivityService, ActivitySettings, ActivityType, Auth, AuthMember, AuthSection, AuthService, AuthTeam, AuthTeamSection, AuthenticatedGuard, Authentication, AuthenticationInterceptor, AuthenticationService, BookingCalendar, BookingCalendarService, BookingCalendarSlot, BookingCalendarSlotSession, Calendar, CalendarEvent, Card, CardDeal, CardLogo, CardLogoUrls, CardMemberTicket, CardTheme, CardTicket, CardTicketLocation, Club, ClubImage, ClubSection, ClubService, Collection, ConstantService, Contact, CreditCard, DataAccessModule, Directory, Email, EmailRecipient, EmailService, Event, ExternalLink, ExternalLinkService, FileObject, FileService, GeneralImage, Giro, HandleGrantTokenGuard, HomeTeam, ImageUrls, InvoiceService, Member, MemberActivityInvite, MemberAttribute, MemberCard, MemberCardService, MemberContact, MemberFee, MemberFunction, MemberInvoice, MemberInvoiceRow, MemberPublicForm, MemberPublicFormService, MemberService, MemberTeam, MemberTeamThrough, MemberValidationSettings, News, NewsService, Partner, PaymentAttempt, PaymentAttemptService, Role, SearchClub, SearchMember, SearchMemberCard, SearchMemberInvoice, SearchTeam, Section, SectionService, Swish, SwishQrCode, TeamService, Token, TokenService, USER_NOTIFICATIONS_PATH, UnpaidMemberInvoice, User, UserNotification, UserNotificationService, UserService, Zimpler };
2631
2849
  //# sourceMappingURL=myclub_se-data-access.mjs.map