@myclub_se/data-access 2.12.1 → 2.13.1

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 (31) hide show
  1. package/esm2020/lib/api-models/api-booking-calendar-slot-session.mjs +1 -1
  2. package/esm2020/lib/api-models/api-booking-calendar.mjs +1 -1
  3. package/esm2020/lib/api-models/api-overbooked-location.mjs +2 -0
  4. package/esm2020/lib/api-models/index.mjs +2 -1
  5. package/esm2020/lib/models/booking-calendar-slot-session.mjs +6 -2
  6. package/esm2020/lib/models/booking-calendar.mjs +13 -2
  7. package/esm2020/lib/models/index.mjs +3 -1
  8. package/esm2020/lib/models/overbooked-location.mjs +10 -0
  9. package/esm2020/lib/models/search-team.mjs +8 -1
  10. package/esm2020/lib/services/booking-calendar.service.mjs +50 -2
  11. package/esm2020/lib/services/factories/booking-calendar-factory.mjs +3 -2
  12. package/esm2020/lib/services/factories/booking-calendar-slot-session-factory.mjs +2 -2
  13. package/esm2020/lib/services/factories/index.mjs +2 -1
  14. package/esm2020/lib/services/factories/overbooked-location-factory.mjs +3 -0
  15. package/fesm2015/myclub_se-data-access.mjs +113 -33
  16. package/fesm2015/myclub_se-data-access.mjs.map +1 -1
  17. package/fesm2020/myclub_se-data-access.mjs +113 -33
  18. package/fesm2020/myclub_se-data-access.mjs.map +1 -1
  19. package/lib/api-models/api-booking-calendar-slot-session.d.ts +3 -0
  20. package/lib/api-models/api-booking-calendar.d.ts +3 -0
  21. package/lib/api-models/api-overbooked-location.d.ts +7 -0
  22. package/lib/api-models/index.d.ts +1 -0
  23. package/lib/models/booking-calendar-slot-session.d.ts +5 -1
  24. package/lib/models/booking-calendar.d.ts +6 -1
  25. package/lib/models/index.d.ts +2 -0
  26. package/lib/models/overbooked-location.d.ts +8 -0
  27. package/lib/models/search-team.d.ts +5 -0
  28. package/lib/services/booking-calendar.service.d.ts +6 -0
  29. package/lib/services/factories/index.d.ts +1 -0
  30. package/lib/services/factories/overbooked-location-factory.d.ts +3 -0
  31. package/package.json +1 -1
@@ -307,8 +307,25 @@ class Authentication {
307
307
  }
308
308
  }
309
309
 
310
+ class SearchTeam {
311
+ constructor(club, section, id, club_name, name, section_name) {
312
+ this.club = club;
313
+ this.section = section;
314
+ this.id = id;
315
+ this.club_name = club_name;
316
+ this.name = name;
317
+ this.section_name = section_name;
318
+ }
319
+ static asFormGroup(team) {
320
+ return new FormGroup({
321
+ id: new FormControl((team === null || team === void 0 ? void 0 : team.id) || ''),
322
+ name: new FormControl((team === null || team === void 0 ? void 0 : team.name) || '', Validators.required),
323
+ });
324
+ }
325
+ }
326
+
310
327
  class BookingCalendar {
311
- 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, location_groups) {
328
+ 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, location_groups, available_for_teams) {
312
329
  this.id = id;
313
330
  this.club_id = club_id;
314
331
  this.section_id = section_id;
@@ -321,15 +338,23 @@ class BookingCalendar {
321
338
  this.max_application_number = max_application_number;
322
339
  this.allow_team_export = allow_team_export;
323
340
  this.allow_repeated_bookings = allow_repeated_bookings;
341
+ this.is_default = is_default;
324
342
  this.location_groups = location_groups;
343
+ this.available_for_teams = available_for_teams;
325
344
  }
326
345
  static asFormGroup(calendar) {
327
346
  const locationGroups = [];
347
+ const availableForTeams = [];
328
348
  if (calendar === null || calendar === void 0 ? void 0 : calendar.location_groups) {
329
349
  calendar.location_groups.forEach((locationGroup) => {
330
350
  locationGroups.push(ActivityLocationGroup.asFormGroup(locationGroup));
331
351
  });
332
352
  }
353
+ if (calendar === null || calendar === void 0 ? void 0 : calendar.available_for_teams) {
354
+ calendar.available_for_teams.forEach((team) => {
355
+ availableForTeams.push(SearchTeam.asFormGroup(team));
356
+ });
357
+ }
333
358
  return new FormGroup({
334
359
  id: new FormControl((calendar === null || calendar === void 0 ? void 0 : calendar.id) || ''),
335
360
  club_id: new FormControl((calendar === null || calendar === void 0 ? void 0 : calendar.club_id) || ''),
@@ -341,7 +366,9 @@ class BookingCalendar {
341
366
  team_name: new FormControl((calendar === null || calendar === void 0 ? void 0 : calendar.team_name) || ''),
342
367
  status: new FormControl((calendar === null || calendar === void 0 ? void 0 : calendar.status) || 'preliminary'),
343
368
  location_groups: new FormArray(locationGroups),
369
+ available_for_teams: new FormArray(availableForTeams),
344
370
  max_application_number: new FormControl((calendar === null || calendar === void 0 ? void 0 : calendar.max_application_number) || 0),
371
+ is_default: new FormControl((calendar === null || calendar === void 0 ? void 0 : calendar.is_default) || false),
345
372
  allow_team_export: new FormControl((calendar === null || calendar === void 0 ? void 0 : calendar.allow_team_export) || false),
346
373
  allow_repeated_bookings: new FormControl((calendar === null || calendar === void 0 ? void 0 : calendar.allow_repeated_bookings) || false)
347
374
  });
@@ -452,7 +479,7 @@ class BookingCalendarSlot {
452
479
  }
453
480
 
454
481
  class BookingCalendarSlotSession {
455
- constructor(id, section_id, slot_id, team_id, title, end_time, section_name, start_time, team_name, is_overbooked, type, location_zones_taken, slot_index, comment, location_part_id, location_part_name, location_id, repeat, activity_type_id, color = null, update_repeating, update_until_date = null) {
482
+ constructor(id, section_id, slot_id, team_id, title, end_time, section_name, start_time, team_name, is_overbooked, last_repeating_date, type, location_zones_taken, slot_index, comment, location_part_id, location_part_name, location_name, location_id, day, repeat, activity_type_id, color = null, update_repeating, update_until_date = null) {
456
483
  this.id = id;
457
484
  this.section_id = section_id;
458
485
  this.slot_id = slot_id;
@@ -463,13 +490,16 @@ class BookingCalendarSlotSession {
463
490
  this.start_time = start_time;
464
491
  this.team_name = team_name;
465
492
  this.is_overbooked = is_overbooked;
493
+ this.last_repeating_date = last_repeating_date;
466
494
  this.type = type;
467
495
  this.location_zones_taken = location_zones_taken;
468
496
  this.slot_index = slot_index;
469
497
  this.comment = comment;
470
498
  this.location_part_id = location_part_id;
471
499
  this.location_part_name = location_part_name;
500
+ this.location_name = location_name;
472
501
  this.location_id = location_id;
502
+ this.day = day;
473
503
  this.repeat = repeat;
474
504
  this.activity_type_id = activity_type_id;
475
505
  this.color = color;
@@ -488,6 +518,7 @@ class BookingCalendarSlotSession {
488
518
  start_time: new FormControl((session === null || session === void 0 ? void 0 : session.start_time) || '', Validators.required),
489
519
  team_name: new FormControl((session === null || session === void 0 ? void 0 : session.team_name) || ''),
490
520
  is_overbooked: new FormControl((session === null || session === void 0 ? void 0 : session.is_overbooked) || false),
521
+ last_repeating_date: new FormControl((session === null || session === void 0 ? void 0 : session.last_repeating_date) || null),
491
522
  type: new FormControl((session === null || session === void 0 ? void 0 : session.type) || ''),
492
523
  location_zones_taken: new FormControl((session === null || session === void 0 ? void 0 : session.location_zones_taken) || 1, [Validators.min(1), Validators.required]),
493
524
  comment: new FormControl((session === null || session === void 0 ? void 0 : session.comment) || ''),
@@ -1458,6 +1489,27 @@ class OpenActivity {
1458
1489
  }
1459
1490
  }
1460
1491
 
1492
+ class OptionalFee {
1493
+ constructor(id, activity_id, fee_id, amount, text) {
1494
+ this.id = id;
1495
+ this.activity_id = activity_id;
1496
+ this.fee_id = fee_id;
1497
+ this.amount = amount;
1498
+ this.text = text;
1499
+ this.checked = false;
1500
+ }
1501
+ }
1502
+
1503
+ class OverbookedLocation {
1504
+ constructor(start_time, end_time, day, location_name, session_names) {
1505
+ this.start_time = start_time;
1506
+ this.end_time = end_time;
1507
+ this.day = day;
1508
+ this.location_name = location_name;
1509
+ this.session_names = session_names;
1510
+ }
1511
+ }
1512
+
1461
1513
  class Partner {
1462
1514
  constructor(id, image, name, url) {
1463
1515
  this.id = id;
@@ -1510,17 +1562,6 @@ class SearchClub {
1510
1562
  }
1511
1563
  }
1512
1564
 
1513
- class SearchTeam {
1514
- constructor(club, section, id, club_name, name, section_name) {
1515
- this.club = club;
1516
- this.section = section;
1517
- this.id = id;
1518
- this.club_name = club_name;
1519
- this.name = name;
1520
- this.section_name = section_name;
1521
- }
1522
- }
1523
-
1524
1565
  class Section {
1525
1566
  constructor(id, name) {
1526
1567
  this.id = id;
@@ -1633,11 +1674,17 @@ const authTeamFactory = (apiAuthTeam) => new AuthTeam(apiAuthTeam.id, apiAuthTea
1633
1674
 
1634
1675
  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);
1635
1676
 
1636
- 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.location_groups && apiBookingCalendar.location_groups.length ? apiBookingCalendar.location_groups.map((apiActivityLocationGroup) => activityLocationGroupFactory(apiActivityLocationGroup)) : []);
1677
+ const clubFactory = (apiClub) => new Club(apiClub.id, apiClub.name);
1678
+
1679
+ const sectionFactory = (apiSection) => new Section(apiSection.id, apiSection.name);
1680
+
1681
+ 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);
1682
+
1683
+ 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.location_groups && apiBookingCalendar.location_groups.length ? apiBookingCalendar.location_groups.map((apiActivityLocationGroup) => activityLocationGroupFactory(apiActivityLocationGroup)) : [], apiBookingCalendar.available_for_teams && apiBookingCalendar.available_for_teams.length ? apiBookingCalendar.available_for_teams.map((apiSearchTeam) => searchTeamFactory(apiSearchTeam)) : []);
1637
1684
 
1638
1685
  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.location_zones_taken, apiBookingApplicationTime.applicant_comment, apiBookingApplicationTime.reviewer_comment, apiBookingApplicationTime.status, apiBookingApplicationTime.location_part_id, apiBookingApplicationTime.location_part_name, apiBookingApplicationTime.location_id, 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.location_name);
1639
1686
 
1640
- 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.type, apiBookingSlotSession.location_zones_taken, apiBookingSlotSession.slot_index, apiBookingSlotSession.comment, apiBookingSlotSession.location_part_id, apiBookingSlotSession.location_part_name, apiBookingSlotSession.location_id, apiBookingSlotSession.repeat, apiBookingSlotSession.activity_type_id, apiBookingSlotSession.color, apiBookingSlotSession.update_repeating, apiBookingSlotSession.update_until_date);
1687
+ 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.location_zones_taken, apiBookingSlotSession.slot_index, apiBookingSlotSession.comment, apiBookingSlotSession.location_part_id, apiBookingSlotSession.location_part_name, apiBookingSlotSession.location_name, apiBookingSlotSession.location_id, apiBookingSlotSession.day, apiBookingSlotSession.repeat, apiBookingSlotSession.activity_type_id, apiBookingSlotSession.color, apiBookingSlotSession.update_repeating, apiBookingSlotSession.update_until_date);
1641
1688
 
1642
1689
  const bookingCalendarSlotFactory = (apiBookingSlot) => new BookingCalendarSlot(apiBookingSlot.id, apiBookingSlot.calendar_id, apiBookingSlot.calendar_status, apiBookingSlot.location_id, apiBookingSlot.color, apiBookingSlot.day, apiBookingSlot.end_time, apiBookingSlot.group_id, apiBookingSlot.location_name, 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);
1643
1690
 
@@ -1667,8 +1714,6 @@ const cardTicketLocationFactory = (apiCardTicketLocation) => new CardTicketLocat
1667
1714
 
1668
1715
  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);
1669
1716
 
1670
- const clubFactory = (apiClub) => new Club(apiClub.id, apiClub.name);
1671
-
1672
1717
  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);
1673
1718
 
1674
1719
  const clubSectionFactory = (apiSection) => new ClubSection(apiSection.id, apiSection.name);
@@ -1699,10 +1744,6 @@ const memberInvoiceRowFactory = (apiMemberInvoiceRow) => new MemberInvoiceRow(ap
1699
1744
 
1700
1745
  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);
1701
1746
 
1702
- const sectionFactory = (apiSection) => new Section(apiSection.id, apiSection.name);
1703
-
1704
- 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);
1705
-
1706
1747
  const memberPublicFormFieldOptionFactory = (apiMemberPublicFormFieldOption) => new MemberPublicFormFieldOption(apiMemberPublicFormFieldOption.id, apiMemberPublicFormFieldOption.name, apiMemberPublicFormFieldOption.selected, apiMemberPublicFormFieldOption.default);
1707
1748
 
1708
1749
  const memberPublicFormFieldFactory = (apiMemberPublicFormField) => new MemberPublicFormField(apiMemberPublicFormField.all_choice_options && apiMemberPublicFormField.all_choice_options.length ?
@@ -1737,21 +1778,12 @@ const memberTeamThroughFactory = (apiMemberTeamThrough) => new MemberTeamThrough
1737
1778
 
1738
1779
  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);
1739
1780
 
1740
- class OptionalFee {
1741
- constructor(id, activity_id, fee_id, amount, text) {
1742
- this.id = id;
1743
- this.activity_id = activity_id;
1744
- this.fee_id = fee_id;
1745
- this.amount = amount;
1746
- this.text = text;
1747
- this.checked = false;
1748
- }
1749
- }
1750
-
1751
1781
  const optionalFeeFactory = (apiOptionalFee) => new OptionalFee(apiOptionalFee.id, apiOptionalFee.activity_id, apiOptionalFee.fee_id, apiOptionalFee.amount, apiOptionalFee.text);
1752
1782
 
1753
1783
  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);
1754
1784
 
1785
+ const overbookedLocationFactory = (apiOverbookedLocation) => new OverbookedLocation(apiOverbookedLocation.start_time, apiOverbookedLocation.end_time, apiOverbookedLocation.day, apiOverbookedLocation.location_name, apiOverbookedLocation.session_names);
1786
+
1755
1787
  const otherMemberFieldFactory = (apiOtherMemberFieldFactory) => new OtherMemberField(apiOtherMemberFieldFactory.display_name, apiOtherMemberFieldFactory.field_name, apiOtherMemberFieldFactory.value);
1756
1788
 
1757
1789
  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)) : []);
@@ -2617,6 +2649,8 @@ const CLUB_BOOKING_CALENDAR_REPEATABLE_SESSION_PATH = ':clubId/activities/sessio
2617
2649
  const CLUB_BOOKING_SETTINGS_PATH = ':clubId/activities/booking-settings/';
2618
2650
  const CLUB_BOOKING_CALENDAR_APPLICATION_TIME_PATH = ':clubId/activities/application-times/:id/';
2619
2651
  const CLUB_BOOKING_CALENDAR_APPLICATION_TIMES_PATH = ':clubId/activities/application-times/';
2652
+ const CLUB_BOOKING_OVERBOOKED_LOCATIONS_PATH = ':clubId/activities/overbooked/locations/';
2653
+ const CLUB_BOOKING_OVERBOOKED_SESSIONS_PATH = ':clubId/activities/overbooked/sessions/';
2620
2654
  const SECTION_BOOKING_CALENDARS_PATH = ':sectionId/activities/calendars/';
2621
2655
  const SECTION_BOOKING_CALENDAR_PATH = ':sectionId/activities/calendars/:id/';
2622
2656
  const SECTION_BOOKING_CALENDAR_SLOTS_PATH = ':sectionId/activities/slots/';
@@ -2632,6 +2666,8 @@ const SECTION_BOOKING_CALENDAR_REPEATABLE_SESSION_PATH = ':sectionId/activities/
2632
2666
  const SECTION_BOOKING_SETTINGS_PATH = ':sectionId/activities/booking-settings/';
2633
2667
  const SECTION_BOOKING_CALENDAR_APPLICATION_TIME_PATH = ':sectionId/activities/application-times/:id/';
2634
2668
  const SECTION_BOOKING_CALENDAR_APPLICATION_TIMES_PATH = ':sectionId/activities/application-times/';
2669
+ const SECTION_BOOKING_OVERBOOKED_LOCATIONS_PATH = ':sectionId/activities/overbooked/locations/';
2670
+ const SECTION_BOOKING_OVERBOOKED_SESSIONS_PATH = ':sectionId/activities/overbooked/sessions/';
2635
2671
  const TEAM_BOOKING_CALENDARS_PATH = ':teamId/activities/calendars/';
2636
2672
  const TEAM_BOOKING_CALENDAR_SLOTS_PATH = ':teamId/activities/slots/';
2637
2673
  const TEAM_BOOKING_CALENDAR_SLOTS_SYNC_PATH = ':teamId/activities/slots/sync/';
@@ -3329,6 +3365,50 @@ class BookingCalendarService {
3329
3365
  id
3330
3366
  });
3331
3367
  }
3368
+ // endregion
3369
+ // region Overbooked locations
3370
+ getOverbookedLocations(role, clubOrSectionOrTeamId, bookingSlotFilter) {
3371
+ if (role == Role.ClubAdmin) {
3372
+ return this.getClubOverbookedLocations(clubOrSectionOrTeamId, bookingSlotFilter);
3373
+ }
3374
+ return this.getSectionOverbookedLocations(clubOrSectionOrTeamId, bookingSlotFilter);
3375
+ }
3376
+ getClubOverbookedLocations(clubId, bookingSlotFilter) {
3377
+ const params = bookingSlotFilter.toParams();
3378
+ return this.apiService
3379
+ .getCollection(overbookedLocationFactory, Role.ClubAdmin, CLUB_BOOKING_OVERBOOKED_LOCATIONS_PATH, { clubId }, {
3380
+ params
3381
+ });
3382
+ }
3383
+ getSectionOverbookedLocations(sectionId, bookingSlotFilter) {
3384
+ const params = bookingSlotFilter.toParams();
3385
+ return this.apiService
3386
+ .getCollection(overbookedLocationFactory, Role.SectionAdmin, SECTION_BOOKING_OVERBOOKED_LOCATIONS_PATH, { sectionId }, {
3387
+ params
3388
+ });
3389
+ }
3390
+ // endregion
3391
+ // region Overbooked sessions
3392
+ getOverbookedSessions(role, clubOrSectionOrTeamId, bookingSlotFilter) {
3393
+ if (role == Role.ClubAdmin) {
3394
+ return this.getClubOverbookedSessions(clubOrSectionOrTeamId, bookingSlotFilter);
3395
+ }
3396
+ return this.getSectionOverbookedSessions(clubOrSectionOrTeamId, bookingSlotFilter);
3397
+ }
3398
+ getClubOverbookedSessions(clubId, bookingSlotFilter) {
3399
+ const params = bookingSlotFilter.toParams();
3400
+ return this.apiService
3401
+ .getCollection(bookingCalendarSlotSessionFactory, Role.ClubAdmin, CLUB_BOOKING_OVERBOOKED_SESSIONS_PATH, { clubId }, {
3402
+ params
3403
+ });
3404
+ }
3405
+ getSectionOverbookedSessions(sectionId, bookingSlotFilter) {
3406
+ const params = bookingSlotFilter.toParams();
3407
+ return this.apiService
3408
+ .getCollection(bookingCalendarSlotSessionFactory, Role.SectionAdmin, SECTION_BOOKING_OVERBOOKED_SESSIONS_PATH, { sectionId }, {
3409
+ params
3410
+ });
3411
+ }
3332
3412
  }
3333
3413
  BookingCalendarService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: BookingCalendarService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
3334
3414
  BookingCalendarService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: BookingCalendarService, providedIn: 'root' });
@@ -4534,5 +4614,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImpo
4534
4614
  * Generated bundle index. Do not edit.
4535
4615
  */
4536
4616
 
4537
- export { APP, Activity, ActivityExtraMember, ActivityInvite, ActivityLocation, ActivityLocationGroup, ActivityLocationPart, ActivityLocationTag, ActivityService, ActivitySettings, ActivityType, Auth, AuthMember, AuthSection, AuthService, AuthTeam, AuthTeamSection, AuthenticatedGuard, Authentication, AuthenticationInterceptor, AuthenticationService, 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, OtherMember, OtherMemberField, 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 };
4617
+ export { APP, Activity, ActivityExtraMember, ActivityInvite, ActivityLocation, ActivityLocationGroup, ActivityLocationPart, ActivityLocationTag, ActivityService, ActivitySettings, ActivityType, Auth, AuthMember, AuthSection, AuthService, AuthTeam, AuthTeamSection, AuthenticatedGuard, Authentication, AuthenticationInterceptor, AuthenticationService, 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, 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 };
4538
4618
  //# sourceMappingURL=myclub_se-data-access.mjs.map