@myclub_se/data-access 2.14.0 → 2.15.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 (76) hide show
  1. package/esm2020/lib/api-models/api-bookable-group.mjs +2 -0
  2. package/esm2020/lib/api-models/api-bookable-item.mjs +2 -0
  3. package/esm2020/lib/api-models/api-bookable-part.mjs +2 -0
  4. package/esm2020/lib/api-models/api-bookable-tag.mjs +2 -0
  5. package/esm2020/lib/api-models/api-booking-calendar-application-time.mjs +1 -1
  6. package/esm2020/lib/api-models/api-booking-calendar-slot-session.mjs +1 -1
  7. package/esm2020/lib/api-models/api-booking-calendar-slot.mjs +1 -1
  8. package/esm2020/lib/api-models/api-booking-calendar.mjs +1 -1
  9. package/esm2020/lib/api-models/api-member/api-member-attribute.mjs +1 -1
  10. package/esm2020/lib/api-models/api-overbooked-bookable-item.mjs +2 -0
  11. package/esm2020/lib/api-models/index.mjs +6 -1
  12. package/esm2020/lib/models/activity-location-part.mjs +4 -4
  13. package/esm2020/lib/models/bookable-group.mjs +21 -0
  14. package/esm2020/lib/models/bookable-item.mjs +34 -0
  15. package/esm2020/lib/models/bookable-part.mjs +14 -0
  16. package/esm2020/lib/models/bookable-tag.mjs +17 -0
  17. package/esm2020/lib/models/booking-calendar-application-time.mjs +9 -9
  18. package/esm2020/lib/models/booking-calendar-slot-session.mjs +9 -9
  19. package/esm2020/lib/models/booking-calendar-slot.mjs +5 -5
  20. package/esm2020/lib/models/booking-calendar.mjs +9 -9
  21. package/esm2020/lib/models/index.mjs +6 -1
  22. package/esm2020/lib/models/member/member-attribute.mjs +2 -2
  23. package/esm2020/lib/models/news.mjs +3 -3
  24. package/esm2020/lib/models/overbooked-bookable-item.mjs +10 -0
  25. package/esm2020/lib/services/activity.service.mjs +2 -189
  26. package/esm2020/lib/services/bookable.service.mjs +258 -0
  27. package/esm2020/lib/services/booking-calendar.service.mjs +30 -26
  28. package/esm2020/lib/services/factories/bookable-group-factory.mjs +6 -0
  29. package/esm2020/lib/services/factories/bookable-item-factory.mjs +5 -0
  30. package/esm2020/lib/services/factories/bookable-part-factory.mjs +5 -0
  31. package/esm2020/lib/services/factories/bookable-tag-factory.mjs +5 -0
  32. package/esm2020/lib/services/factories/booking-calendar-application-time-factory.mjs +2 -2
  33. package/esm2020/lib/services/factories/booking-calendar-factory.mjs +3 -3
  34. package/esm2020/lib/services/factories/booking-calendar-slot-factory.mjs +2 -2
  35. package/esm2020/lib/services/factories/booking-calendar-slot-session-factory.mjs +2 -2
  36. package/esm2020/lib/services/factories/index.mjs +7 -1
  37. package/esm2020/lib/services/factories/overbooked-bookable-item-factory.mjs +3 -0
  38. package/esm2020/lib/services/index.mjs +2 -1
  39. package/fesm2015/myclub_se-data-access.mjs +425 -248
  40. package/fesm2015/myclub_se-data-access.mjs.map +1 -1
  41. package/fesm2020/myclub_se-data-access.mjs +425 -248
  42. package/fesm2020/myclub_se-data-access.mjs.map +1 -1
  43. package/lib/api-models/api-bookable-group.d.ts +9 -0
  44. package/lib/api-models/api-bookable-item.d.ts +12 -0
  45. package/lib/api-models/api-bookable-part.d.ts +4 -0
  46. package/lib/api-models/api-bookable-tag.d.ts +7 -0
  47. package/lib/api-models/api-booking-calendar-application-time.d.ts +5 -5
  48. package/lib/api-models/api-booking-calendar-slot-session.d.ts +5 -5
  49. package/lib/api-models/api-booking-calendar-slot.d.ts +2 -2
  50. package/lib/api-models/api-booking-calendar.d.ts +2 -2
  51. package/lib/api-models/api-member/api-member-attribute.d.ts +1 -1
  52. package/lib/api-models/api-overbooked-bookable-item.d.ts +7 -0
  53. package/lib/api-models/index.d.ts +5 -0
  54. package/lib/models/activity-location-part.d.ts +1 -1
  55. package/lib/models/bookable-group.d.ts +18 -0
  56. package/lib/models/bookable-item.d.ts +22 -0
  57. package/lib/models/bookable-part.d.ts +10 -0
  58. package/lib/models/bookable-tag.d.ts +13 -0
  59. package/lib/models/booking-calendar-application-time.d.ts +8 -8
  60. package/lib/models/booking-calendar-slot-session.d.ts +8 -8
  61. package/lib/models/booking-calendar-slot.d.ts +4 -4
  62. package/lib/models/booking-calendar.d.ts +4 -4
  63. package/lib/models/index.d.ts +5 -0
  64. package/lib/models/member/member-attribute.d.ts +3 -3
  65. package/lib/models/overbooked-bookable-item.d.ts +8 -0
  66. package/lib/services/activity.service.d.ts +1 -31
  67. package/lib/services/bookable.service.d.ts +44 -0
  68. package/lib/services/booking-calendar.service.d.ts +6 -5
  69. package/lib/services/factories/bookable-group-factory.d.ts +3 -0
  70. package/lib/services/factories/bookable-item-factory.d.ts +3 -0
  71. package/lib/services/factories/bookable-part-factory.d.ts +3 -0
  72. package/lib/services/factories/bookable-tag-factory.d.ts +3 -0
  73. package/lib/services/factories/index.d.ts +6 -0
  74. package/lib/services/factories/overbooked-bookable-item-factory.d.ts +3 -0
  75. package/lib/services/index.d.ts +1 -0
  76. package/package.json +1 -1
@@ -152,10 +152,10 @@ class ActivityLocationPart {
152
152
  this.id = id;
153
153
  this.name = name;
154
154
  }
155
- static asFormGroup(tag) {
155
+ static asFormGroup(part) {
156
156
  return new FormGroup({
157
- id: new FormControl((tag === null || tag === void 0 ? void 0 : tag.id) || ''),
158
- name: new FormControl((tag === null || tag === void 0 ? void 0 : tag.name) || '', Validators.required),
157
+ id: new FormControl((part === null || part === void 0 ? void 0 : part.id) || ''),
158
+ name: new FormControl((part === null || part === void 0 ? void 0 : part.name) || '', Validators.required),
159
159
  });
160
160
  }
161
161
  }
@@ -319,6 +319,86 @@ class Authentication {
319
319
  }
320
320
  }
321
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 === null || bookableGroup === void 0 ? void 0 : bookableGroup.id) || ''),
334
+ club_id: new FormControl((bookableGroup === null || bookableGroup === void 0 ? void 0 : bookableGroup.club_id) || '', Validators.required),
335
+ section_id: new FormControl((bookableGroup === null || bookableGroup === void 0 ? void 0 : bookableGroup.section_id) || ''),
336
+ name: new FormControl((bookableGroup === null || bookableGroup === void 0 ? void 0 : bookableGroup.name) || '', Validators.required),
337
+ active: new FormControl(typeof (bookableGroup === null || bookableGroup === void 0 ? void 0 : bookableGroup.active) !== 'undefined' ? bookableGroup === null || bookableGroup === void 0 ? void 0 : 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 === null || tag === void 0 ? void 0 : tag.id) || ''),
353
+ name: new FormControl((tag === null || tag === void 0 ? void 0 : 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 === null || part === void 0 ? void 0 : part.id) || ''),
366
+ name: new FormControl((part === null || part === void 0 ? void 0 : 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 === null || bookable === void 0 ? void 0 : bookable.tags) {
386
+ bookable.tags.forEach((tag) => tags.push(BookableTag.asFormGroup(tag)));
387
+ }
388
+ if (bookable === null || bookable === void 0 ? void 0 : bookable.parts) {
389
+ bookable.parts.forEach((part) => parts.push(BookablePart.asFormGroup(part)));
390
+ }
391
+ return new FormGroup({
392
+ id: new FormControl((bookable === null || bookable === void 0 ? void 0 : bookable.id) || ''),
393
+ club_id: new FormControl((bookable === null || bookable === void 0 ? void 0 : bookable.club_id) || '', Validators.required),
394
+ active: new FormControl(typeof (bookable === null || bookable === void 0 ? void 0 : bookable.active) !== 'undefined' ? bookable === null || bookable === void 0 ? void 0 : bookable.active : false),
395
+ group_id: new FormControl((bookable === null || bookable === void 0 ? void 0 : bookable.group_id) || ''),
396
+ tags: new FormArray(tags),
397
+ parts: new FormArray(parts),
398
+ });
399
+ }
400
+ }
401
+
322
402
  class SearchTeam {
323
403
  constructor(club, section, id, club_name, name, section_name) {
324
404
  this.club = club;
@@ -337,7 +417,7 @@ class SearchTeam {
337
417
  }
338
418
 
339
419
  class BookingCalendar {
340
- 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) {
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) {
341
421
  this.id = id;
342
422
  this.club_id = club_id;
343
423
  this.section_id = section_id;
@@ -351,15 +431,15 @@ class BookingCalendar {
351
431
  this.allow_team_export = allow_team_export;
352
432
  this.allow_repeated_bookings = allow_repeated_bookings;
353
433
  this.is_default = is_default;
354
- this.location_groups = location_groups;
355
434
  this.available_for_teams = available_for_teams;
435
+ this.bookable_groups = bookable_groups;
356
436
  }
357
437
  static asFormGroup(calendar) {
358
- const locationGroups = [];
438
+ const bookableGroups = [];
359
439
  const availableForTeams = [];
360
- if (calendar === null || calendar === void 0 ? void 0 : calendar.location_groups) {
361
- calendar.location_groups.forEach((locationGroup) => {
362
- locationGroups.push(ActivityLocationGroup.asFormGroup(locationGroup));
440
+ if (calendar === null || calendar === void 0 ? void 0 : calendar.bookable_groups) {
441
+ calendar.bookable_groups.forEach((bookableGroup) => {
442
+ bookableGroups.push(BookableGroup.asFormGroup(bookableGroup));
363
443
  });
364
444
  }
365
445
  if (calendar === null || calendar === void 0 ? void 0 : calendar.available_for_teams) {
@@ -377,7 +457,7 @@ class BookingCalendar {
377
457
  section_name: new FormControl((calendar === null || calendar === void 0 ? void 0 : calendar.section_name) || ''),
378
458
  team_name: new FormControl((calendar === null || calendar === void 0 ? void 0 : calendar.team_name) || ''),
379
459
  status: new FormControl((calendar === null || calendar === void 0 ? void 0 : calendar.status) || 'preliminary'),
380
- location_groups: new FormArray(locationGroups),
460
+ bookable_groups: new FormArray(bookableGroups),
381
461
  available_for_teams: new FormArray(availableForTeams),
382
462
  max_application_number: new FormControl((calendar === null || calendar === void 0 ? void 0 : calendar.max_application_number) || 0),
383
463
  is_default: new FormControl((calendar === null || calendar === void 0 ? void 0 : calendar.is_default) || false),
@@ -388,7 +468,7 @@ class BookingCalendar {
388
468
  }
389
469
 
390
470
  class BookingCalendarApplicationTime {
391
- constructor(id, section_id, slot_id, team_id, title, end_time, section_name, start_time, team_name, location_zones_taken, applicant_comment, reviewer_comment, status, location_part_id, location_part_name, location_id, repeat, activity_type_id, color = null, slot_start_time, slot_end_time, slot_day, slot_number_of_available_sessions, slot_last_repeating_date, created, location_name) {
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) {
392
472
  this.id = id;
393
473
  this.section_id = section_id;
394
474
  this.slot_id = slot_id;
@@ -398,13 +478,9 @@ class BookingCalendarApplicationTime {
398
478
  this.section_name = section_name;
399
479
  this.start_time = start_time;
400
480
  this.team_name = team_name;
401
- this.location_zones_taken = location_zones_taken;
402
481
  this.applicant_comment = applicant_comment;
403
482
  this.reviewer_comment = reviewer_comment;
404
483
  this.status = status;
405
- this.location_part_id = location_part_id;
406
- this.location_part_name = location_part_name;
407
- this.location_id = location_id;
408
484
  this.repeat = repeat;
409
485
  this.activity_type_id = activity_type_id;
410
486
  this.color = color;
@@ -414,7 +490,11 @@ class BookingCalendarApplicationTime {
414
490
  this.slot_number_of_available_sessions = slot_number_of_available_sessions;
415
491
  this.slot_last_repeating_date = slot_last_repeating_date;
416
492
  this.created = created;
417
- this.location_name = location_name;
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;
418
498
  }
419
499
  static asFormGroup(session) {
420
500
  return new FormGroup({
@@ -427,28 +507,26 @@ class BookingCalendarApplicationTime {
427
507
  section_name: new FormControl((session === null || session === void 0 ? void 0 : session.section_name) || ''),
428
508
  start_time: new FormControl((session === null || session === void 0 ? void 0 : session.start_time) || '', Validators.required),
429
509
  team_name: new FormControl((session === null || session === void 0 ? void 0 : session.team_name) || ''),
430
- location_zones_taken: new FormControl((session === null || session === void 0 ? void 0 : session.location_zones_taken) || 1, [Validators.min(1), Validators.required]),
431
510
  applicant_comment: new FormControl((session === null || session === void 0 ? void 0 : session.applicant_comment) || null),
432
511
  reviewer_comment: new FormControl((session === null || session === void 0 ? void 0 : session.reviewer_comment) || null),
433
512
  status: new FormControl((session === null || session === void 0 ? void 0 : session.status) || ''),
434
- location_part_id: new FormControl((session === null || session === void 0 ? void 0 : session.location_part_id) || ''),
435
513
  repeat: new FormControl((session === null || session === void 0 ? void 0 : session.repeat) || false),
436
514
  activity_type_id: new FormControl((session === null || session === void 0 ? void 0 : session.activity_type_id) || null),
515
+ bookable_zones_taken: new FormControl((session === null || session === void 0 ? void 0 : session.bookable_zones_taken) || 1, [Validators.min(1), Validators.required]),
516
+ bookable_part_id: new FormControl((session === null || session === void 0 ? void 0 : session.bookable_part_id) || ''),
437
517
  });
438
518
  }
439
519
  }
440
520
 
441
521
  class BookingCalendarSlot {
442
- constructor(id, calendar_id, calendar_status, location_id, color, day, end_time, group_id, location_name, 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) {
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) {
443
523
  this.id = id;
444
524
  this.calendar_id = calendar_id;
445
525
  this.calendar_status = calendar_status;
446
- this.location_id = location_id;
447
526
  this.color = color;
448
527
  this.day = day;
449
528
  this.end_time = end_time;
450
529
  this.group_id = group_id;
451
- this.location_name = location_name;
452
530
  this.number_of_available_sessions = number_of_available_sessions;
453
531
  this.sessions = sessions;
454
532
  this.open_sessions = open_sessions;
@@ -465,12 +543,13 @@ class BookingCalendarSlot {
465
543
  this.reserved_time_position = reserved_time_position;
466
544
  this.application_times = application_times;
467
545
  this.last_repeating_date = last_repeating_date;
546
+ this.bookable_name = bookable_name;
547
+ this.bookable_id = bookable_id;
468
548
  }
469
549
  static asFormGroup(slot) {
470
550
  return new FormGroup({
471
551
  id: new FormControl((slot === null || slot === void 0 ? void 0 : slot.id) || ''),
472
552
  calendar_id: new FormControl((slot === null || slot === void 0 ? void 0 : slot.calendar_id) || '', Validators.required),
473
- location_id: new FormControl((slot === null || slot === void 0 ? void 0 : slot.location_id) || '', Validators.required),
474
553
  day: new FormControl((slot === null || slot === void 0 ? void 0 : slot.day) || '', Validators.required),
475
554
  end_time: new FormControl((slot === null || slot === void 0 ? void 0 : slot.end_time) || '', Validators.required),
476
555
  group_id: new FormControl((slot === null || slot === void 0 ? void 0 : slot.group_id) || null, { nonNullable: false }),
@@ -486,12 +565,13 @@ class BookingCalendarSlot {
486
565
  reserved_time_enabled: new FormControl(typeof (slot === null || slot === void 0 ? void 0 : slot.reserved_time_enabled) !== 'undefined' ? slot === null || slot === void 0 ? void 0 : slot.reserved_time_enabled : false),
487
566
  reserved_time: new FormControl((slot === null || slot === void 0 ? void 0 : slot.reserved_time) || '00:00'),
488
567
  reserved_time_position: new FormControl((slot === null || slot === void 0 ? void 0 : slot.reserved_time_position) || ''),
568
+ bookable_id: new FormControl((slot === null || slot === void 0 ? void 0 : slot.bookable_id) || '', Validators.required),
489
569
  });
490
570
  }
491
571
  }
492
572
 
493
573
  class BookingCalendarSlotSession {
494
- 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) {
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) {
495
575
  this.id = id;
496
576
  this.section_id = section_id;
497
577
  this.slot_id = slot_id;
@@ -504,19 +584,19 @@ class BookingCalendarSlotSession {
504
584
  this.is_overbooked = is_overbooked;
505
585
  this.last_repeating_date = last_repeating_date;
506
586
  this.type = type;
507
- this.location_zones_taken = location_zones_taken;
508
587
  this.slot_index = slot_index;
509
588
  this.comment = comment;
510
- this.location_part_id = location_part_id;
511
- this.location_part_name = location_part_name;
512
- this.location_name = location_name;
513
- this.location_id = location_id;
514
589
  this.day = day;
515
590
  this.repeat = repeat;
516
591
  this.activity_type_id = activity_type_id;
517
592
  this.color = color;
518
593
  this.update_repeating = update_repeating;
519
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;
520
600
  }
521
601
  static asFormGroup(session) {
522
602
  return new FormGroup({
@@ -532,13 +612,13 @@ class BookingCalendarSlotSession {
532
612
  is_overbooked: new FormControl((session === null || session === void 0 ? void 0 : session.is_overbooked) || false),
533
613
  last_repeating_date: new FormControl((session === null || session === void 0 ? void 0 : session.last_repeating_date) || null),
534
614
  type: new FormControl((session === null || session === void 0 ? void 0 : session.type) || ''),
535
- location_zones_taken: new FormControl((session === null || session === void 0 ? void 0 : session.location_zones_taken) || 1, [Validators.min(1), Validators.required]),
536
615
  comment: new FormControl((session === null || session === void 0 ? void 0 : session.comment) || ''),
537
- location_part_id: new FormControl((session === null || session === void 0 ? void 0 : session.location_part_id) || ''),
538
616
  repeat: new FormControl((session === null || session === void 0 ? void 0 : session.repeat) || false),
539
617
  activity_type_id: new FormControl((session === null || session === void 0 ? void 0 : session.activity_type_id) || null),
540
618
  update_repeating: new FormControl(!!(session === null || session === void 0 ? void 0 : session.update_repeating) || false),
541
619
  update_until_date: new FormControl(null),
620
+ bookable_zones_taken: new FormControl((session === null || session === void 0 ? void 0 : session.bookable_zones_taken) || 1, [Validators.min(1), Validators.required]),
621
+ bookable_part_id: new FormControl((session === null || session === void 0 ? void 0 : session.bookable_part_id) || ''),
542
622
  });
543
623
  }
544
624
  }
@@ -1177,7 +1257,7 @@ class MemberAttribute {
1177
1257
  name: new FormControl((attribute === null || attribute === void 0 ? void 0 : attribute.name) || ''),
1178
1258
  options: attributeOptions,
1179
1259
  type: new FormControl((attribute === null || attribute === void 0 ? void 0 : attribute.type) || 'text'),
1180
- value: new FormControl((attribute === null || attribute === void 0 ? void 0 : attribute.type) === 'bool' ? attribute === null || attribute === void 0 ? void 0 : attribute.value : (attribute === null || attribute === void 0 ? void 0 : attribute.value) || '')
1260
+ value: new FormControl((attribute === null || attribute === void 0 ? void 0 : attribute.type) === 'bool' ? attribute === null || attribute === void 0 ? void 0 : attribute.value : ((attribute === null || attribute === void 0 ? void 0 : attribute.type) === 'date' ? (attribute === null || attribute === void 0 ? void 0 : attribute.value) || undefined : (attribute === null || attribute === void 0 ? void 0 : attribute.value) || ''))
1181
1261
  });
1182
1262
  }
1183
1263
  }
@@ -1427,11 +1507,11 @@ class News {
1427
1507
  }
1428
1508
  return new FormGroup({
1429
1509
  id: new FormControl((news === null || news === void 0 ? void 0 : news.id) || ''),
1430
- active_to: new FormControl((news === null || news === void 0 ? void 0 : news.active_to) || ''),
1510
+ active_to: new FormControl((news === null || news === void 0 ? void 0 : news.active_to) || undefined),
1431
1511
  ingress: new FormControl((news === null || news === void 0 ? void 0 : news.ingress) || '', [Validators.required, Validators.minLength(1)]),
1432
1512
  news_image: new FormControl((news === null || news === void 0 ? void 0 : news.news_image) || ''),
1433
1513
  news_image_text: new FormControl((news === null || news === void 0 ? void 0 : news.news_image_text) || ''),
1434
- published_date: new FormControl((news === null || news === void 0 ? void 0 : news.published_date) || ''),
1514
+ published_date: new FormControl((news === null || news === void 0 ? void 0 : news.published_date) || undefined),
1435
1515
  show_on_my_pages: new FormControl(show_on_my_pages),
1436
1516
  show_on_webpage: new FormControl(show_on_webpage),
1437
1517
  text: new FormControl((news === null || news === void 0 ? void 0 : news.text) || '', [Validators.required, Validators.minLength(1)]),
@@ -1513,6 +1593,16 @@ class OptionalFee {
1513
1593
  }
1514
1594
  }
1515
1595
 
1596
+ class OverbookedBookableItem {
1597
+ constructor(start_time, end_time, day, bookable_name, session_names) {
1598
+ this.start_time = start_time;
1599
+ this.end_time = end_time;
1600
+ this.day = day;
1601
+ this.bookable_name = bookable_name;
1602
+ this.session_names = session_names;
1603
+ }
1604
+ }
1605
+
1516
1606
  class OverbookedLocation {
1517
1607
  constructor(start_time, end_time, day, location_name, session_names) {
1518
1608
  this.start_time = start_time;
@@ -1689,19 +1779,33 @@ const authTeamFactory = (apiAuthTeam) => new AuthTeam(apiAuthTeam.id, apiAuthTea
1689
1779
 
1690
1780
  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);
1691
1781
 
1782
+ const bookablePartFactory = (apiBookablePart) => {
1783
+ return new BookablePart(apiBookablePart.id, apiBookablePart.name);
1784
+ };
1785
+
1786
+ const bookableTagFactory = (apiBookableTag) => {
1787
+ return new BookableTag(apiBookableTag.id, apiBookableTag.club_id, apiBookableTag.section_id, apiBookableTag.name, apiBookableTag.bookable_item_names);
1788
+ };
1789
+
1790
+ 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)) : []);
1791
+
1792
+ const bookableGroupFactory = (apiBookableGroup) => {
1793
+ 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)) : []);
1794
+ };
1795
+
1692
1796
  const clubFactory = (apiClub) => new Club(apiClub.id, apiClub.name);
1693
1797
 
1694
1798
  const sectionFactory = (apiSection) => new Section(apiSection.id, apiSection.name);
1695
1799
 
1696
1800
  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);
1697
1801
 
1698
- 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)) : []);
1802
+ 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)) : []);
1699
1803
 
1700
- 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);
1804
+ 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);
1701
1805
 
1702
- 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);
1806
+ 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);
1703
1807
 
1704
- 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);
1808
+ 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);
1705
1809
 
1706
1810
  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);
1707
1811
 
@@ -1797,6 +1901,8 @@ const optionalFeeFactory = (apiOptionalFee) => new OptionalFee(apiOptionalFee.id
1797
1901
 
1798
1902
  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);
1799
1903
 
1904
+ const overbookedBookableItemFactory = (apiOverbookedBookableItem) => new OverbookedBookableItem(apiOverbookedBookableItem.start_time, apiOverbookedBookableItem.end_time, apiOverbookedBookableItem.day, apiOverbookedBookableItem.bookable_name, apiOverbookedBookableItem.session_names);
1905
+
1800
1906
  const overbookedLocationFactory = (apiOverbookedLocation) => new OverbookedLocation(apiOverbookedLocation.start_time, apiOverbookedLocation.end_time, apiOverbookedLocation.day, apiOverbookedLocation.location_name, apiOverbookedLocation.session_names);
1801
1907
 
1802
1908
  const otherMemberFieldFactory = (apiOtherMemberFieldFactory) => new OtherMemberField(apiOtherMemberFieldFactory.display_name, apiOtherMemberFieldFactory.field_name, apiOtherMemberFieldFactory.value);
@@ -2033,24 +2139,11 @@ const TEAM_ACTIVITY_TYPES_PATH = ':teamId/activities/types/';
2033
2139
  const TEAM_CALENDAR_PATH = ':teamId/activities/calendar/';
2034
2140
  const CLUB_ACTIVITY_LOCATIONS_PATH = ':clubId/activities/locations/';
2035
2141
  const CLUB_ACTIVITY_LOCATION_PATH = ':clubId/activities/locations/:locationId/';
2036
- const CLUB_ACTIVITY_LOCATION_GROUPS_PATH = ':clubId/activities/locations/groups/';
2037
- const CLUB_ACTIVITY_LOCATION_GROUP_PATH = ':clubId/activities/locations/groups/:groupId/';
2038
- const CLUB_ACTIVITY_LOCATION_TAGS_PATH = ':clubId/activities/locations/tags/';
2039
- const CLUB_ACTIVITY_LOCATION_TAG_PATH = ':clubId/activities/locations/tags/:tagId/';
2040
- const CLUB_ACTIVITY_LOCATION_PARTS_PATH = ':clubId/activities/locations/:locationId/parts/';
2041
2142
  const CLUB_ACTIVITY_TYPES_PATH = ':clubId/activities/types/';
2042
2143
  const CLUB_ACTIVITY_TYPE_PATH = ':clubId/activities/types/:typeId/';
2043
2144
  const TEAM_ACTIVITY_LOCATIONS_PATH = ':teamId/activities/locations/';
2044
- const TEAM_ACTIVITY_LOCATION_GROUPS_PATH = ':teamId/activities/locations/groups/';
2045
- const TEAM_ACTIVITY_LOCATION_TAGS_PATH = ':teamId/activities/locations/tags/';
2046
- const TEAM_ACTIVITY_LOCATION_PARTS_PATH = ':teamId/activities/locations/:locationId/parts/';
2047
2145
  const SECTION_ACTIVITY_LOCATIONS_PATH = ':sectionId/activities/locations/';
2048
2146
  const SECTION_ACTIVITY_LOCATION_PATH = ':sectionId/activities/locations/:locationId/';
2049
- const SECTION_ACTIVITY_LOCATION_GROUPS_PATH = ':sectionId/activities/locations/groups/';
2050
- const SECTION_ACTIVITY_LOCATION_GROUP_PATH = ':sectionId/activities/locations/groups/:groupId/';
2051
- const SECTION_ACTIVITY_LOCATION_TAGS_PATH = ':sectionId/activities/locations/tags/';
2052
- const SECTION_ACTIVITY_LOCATION_TAG_PATH = ':sectionId/activities/locations/tags/:tagId/';
2053
- const SECTION_ACTIVITY_LOCATION_PARTS_PATH = ':sectionId/activities/locations/:locationId/parts/';
2054
2147
  const SECTION_ACTIVITY_TYPES_PATH = ':sectionId/activities/types/';
2055
2148
  const SECTION_ACTIVITY_TYPE_PATH = ':sectionId/activities/types/:typeId/';
2056
2149
  class ActivityService {
@@ -2251,179 +2344,6 @@ class ActivityService {
2251
2344
  locationId: location.id
2252
2345
  }, location);
2253
2346
  }
2254
- getActivityLocationGroups(role, clubOrSectionOrTeamId) {
2255
- if (role == Role.ClubAdmin) {
2256
- return this.getClubActivityLocationGroups(clubOrSectionOrTeamId);
2257
- }
2258
- else if (role == Role.SectionAdmin) {
2259
- return this.getSectionActivityLocationGroups(clubOrSectionOrTeamId);
2260
- }
2261
- return this.getTeamActivityLocationGroups(clubOrSectionOrTeamId);
2262
- }
2263
- getClubActivityLocationGroups(clubId) {
2264
- return this.apiService
2265
- .getCollection(activityLocationGroupFactory, Role.ClubAdmin, CLUB_ACTIVITY_LOCATION_GROUPS_PATH, { clubId }, { params: { limit: 'null' } });
2266
- }
2267
- getSectionActivityLocationGroups(sectionId) {
2268
- return this.apiService
2269
- .getCollection(activityLocationGroupFactory, Role.SectionAdmin, SECTION_ACTIVITY_LOCATION_GROUPS_PATH, { sectionId }, { params: { limit: 'null' } });
2270
- }
2271
- getTeamActivityLocationGroups(teamId) {
2272
- return this.apiService
2273
- .getCollection(activityLocationGroupFactory, Role.TeamAdmin, TEAM_ACTIVITY_LOCATION_GROUPS_PATH, { teamId }, { params: { limit: 'null' } });
2274
- }
2275
- updateActivityLocationGroup(role, clubOrSectionOrTeamId, locationGroup) {
2276
- if (role === Role.ClubAdmin) {
2277
- return this.updateClubActivityLocationGroup(clubOrSectionOrTeamId, locationGroup);
2278
- }
2279
- return this.updateSectionActivityLocationGroup(clubOrSectionOrTeamId, locationGroup);
2280
- }
2281
- updateClubActivityLocationGroup(clubId, locationGroup) {
2282
- return this.apiService
2283
- .updateResource(activityLocationGroupFactory, Role.ClubAdmin, CLUB_ACTIVITY_LOCATION_GROUP_PATH, {
2284
- clubId,
2285
- groupId: locationGroup.id
2286
- }, locationGroup);
2287
- }
2288
- updateSectionActivityLocationGroup(sectionId, locationGroup) {
2289
- return this.apiService
2290
- .updateResource(activityLocationGroupFactory, Role.SectionAdmin, SECTION_ACTIVITY_LOCATION_GROUP_PATH, {
2291
- sectionId,
2292
- groupId: locationGroup.id
2293
- }, locationGroup);
2294
- }
2295
- createActivityLocationGroup(role, clubOrSectionOrTeamId, locationGroup) {
2296
- if (role === Role.ClubAdmin) {
2297
- return this.createClubActivityLocationGroup(clubOrSectionOrTeamId, locationGroup);
2298
- }
2299
- return this.createSectionActivityLocationGroup(clubOrSectionOrTeamId, locationGroup);
2300
- }
2301
- createClubActivityLocationGroup(clubId, locationGroup) {
2302
- delete locationGroup.id;
2303
- return this.apiService
2304
- .postResource(activityLocationGroupFactory, Role.ClubAdmin, CLUB_ACTIVITY_LOCATION_GROUPS_PATH, {
2305
- clubId,
2306
- }, locationGroup);
2307
- }
2308
- createSectionActivityLocationGroup(sectionId, locationGroup) {
2309
- delete locationGroup.id;
2310
- return this.apiService
2311
- .postResource(activityLocationGroupFactory, Role.SectionAdmin, SECTION_ACTIVITY_LOCATION_GROUPS_PATH, {
2312
- sectionId,
2313
- }, locationGroup);
2314
- }
2315
- getActivityLocationTags(role, clubOrSectionOrTeamId) {
2316
- if (role == Role.ClubAdmin) {
2317
- return this.getClubActivityLocationTags(clubOrSectionOrTeamId);
2318
- }
2319
- else if (role == Role.SectionAdmin) {
2320
- return this.getSectionActivityLocationTags(clubOrSectionOrTeamId);
2321
- }
2322
- return this.getTeamActivityLocationTags(clubOrSectionOrTeamId);
2323
- }
2324
- getClubActivityLocationTags(clubId) {
2325
- return this.apiService
2326
- .getCollection(activityLocationTagFactory, Role.ClubAdmin, CLUB_ACTIVITY_LOCATION_TAGS_PATH, { clubId }, { params: { limit: 'null' } });
2327
- }
2328
- getSectionActivityLocationTags(sectionId) {
2329
- return this.apiService
2330
- .getCollection(activityLocationTagFactory, Role.SectionAdmin, SECTION_ACTIVITY_LOCATION_TAGS_PATH, { sectionId }, { params: { limit: 'null' } });
2331
- }
2332
- getTeamActivityLocationTags(teamId) {
2333
- return this.apiService
2334
- .getCollection(activityLocationTagFactory, Role.TeamAdmin, TEAM_ACTIVITY_LOCATION_TAGS_PATH, { teamId }, { params: { limit: 'null' } });
2335
- }
2336
- createActivityLocationTag(role, clubOrSectionOrTeamId, tag) {
2337
- if (role == Role.ClubAdmin) {
2338
- return this.createClubActivityLocationTag(clubOrSectionOrTeamId, tag);
2339
- }
2340
- else if (role == Role.SectionAdmin) {
2341
- return this.createSectionActivityLocationTag(clubOrSectionOrTeamId, tag);
2342
- }
2343
- return this.createTeamActivityLocationTag(clubOrSectionOrTeamId, tag);
2344
- }
2345
- createClubActivityLocationTag(clubId, tag) {
2346
- delete tag.id;
2347
- return this.apiService
2348
- .postResource(activityLocationTagFactory, Role.ClubAdmin, CLUB_ACTIVITY_LOCATION_TAGS_PATH, {
2349
- clubId,
2350
- }, tag);
2351
- }
2352
- createSectionActivityLocationTag(sectionId, tag) {
2353
- delete tag.id;
2354
- return this.apiService
2355
- .postResource(activityLocationTagFactory, Role.SectionAdmin, SECTION_ACTIVITY_LOCATION_TAGS_PATH, {
2356
- sectionId,
2357
- }, tag);
2358
- }
2359
- createTeamActivityLocationTag(teamId, tag) {
2360
- delete tag.id;
2361
- return this.apiService
2362
- .postResource(activityLocationTagFactory, Role.TeamAdmin, TEAM_ACTIVITY_LOCATION_TAGS_PATH, {
2363
- teamId,
2364
- }, tag);
2365
- }
2366
- updateActivityLocationTag(role, clubOrSectionOrTeamId, tag) {
2367
- if (role == Role.ClubAdmin) {
2368
- return this.updateClubActivityLocationTag(clubOrSectionOrTeamId, tag);
2369
- }
2370
- return this.updateSectionActivityLocationTag(clubOrSectionOrTeamId, tag);
2371
- }
2372
- updateClubActivityLocationTag(clubId, tag) {
2373
- return this.apiService
2374
- .updateResource(activityLocationTagFactory, Role.ClubAdmin, CLUB_ACTIVITY_LOCATION_TAG_PATH, {
2375
- clubId,
2376
- tagId: tag.id,
2377
- }, tag);
2378
- }
2379
- updateSectionActivityLocationTag(sectionId, tag) {
2380
- return this.apiService
2381
- .updateResource(activityLocationTagFactory, Role.SectionAdmin, SECTION_ACTIVITY_LOCATION_TAG_PATH, {
2382
- sectionId,
2383
- tagId: tag.id,
2384
- }, tag);
2385
- }
2386
- deleteActivityLocationTag(role, clubOrSectionOrTeamId, tag) {
2387
- if (role == Role.ClubAdmin) {
2388
- return this.deleteClubActivityLocationTag(clubOrSectionOrTeamId, tag);
2389
- }
2390
- return this.deleteSectionActivityLocationTag(clubOrSectionOrTeamId, tag);
2391
- }
2392
- deleteClubActivityLocationTag(clubId, tag) {
2393
- return this.apiService
2394
- .deleteResource(Role.ClubAdmin, CLUB_ACTIVITY_LOCATION_TAG_PATH, {
2395
- clubId,
2396
- tagId: tag.id,
2397
- });
2398
- }
2399
- deleteSectionActivityLocationTag(sectionId, tag) {
2400
- return this.apiService
2401
- .deleteResource(Role.SectionAdmin, SECTION_ACTIVITY_LOCATION_TAG_PATH, {
2402
- sectionId,
2403
- tagId: tag.id,
2404
- });
2405
- }
2406
- getActivityLocationParts(role, clubOrSectionOrTeamId, locationId) {
2407
- if (role == Role.ClubAdmin) {
2408
- return this.getClubActivityLocationParts(clubOrSectionOrTeamId, locationId);
2409
- }
2410
- else if (role == Role.SectionAdmin) {
2411
- return this.getSectionActivityLocationParts(clubOrSectionOrTeamId, locationId);
2412
- }
2413
- return this.getTeamActivityLocationParts(clubOrSectionOrTeamId, locationId);
2414
- }
2415
- getClubActivityLocationParts(clubId, locationId) {
2416
- return this.apiService
2417
- .getCollection(activityLocationPartFactory, Role.ClubAdmin, CLUB_ACTIVITY_LOCATION_PARTS_PATH, { clubId, locationId }, { params: { limit: 'null' } });
2418
- }
2419
- getSectionActivityLocationParts(sectionId, locationId) {
2420
- return this.apiService
2421
- .getCollection(activityLocationPartFactory, Role.SectionAdmin, SECTION_ACTIVITY_LOCATION_PARTS_PATH, { sectionId, locationId }, { params: { limit: 'null' } });
2422
- }
2423
- getTeamActivityLocationParts(teamId, locationId) {
2424
- return this.apiService
2425
- .getCollection(activityLocationPartFactory, Role.TeamAdmin, TEAM_ACTIVITY_LOCATION_PARTS_PATH, { teamId, locationId }, { params: { limit: 'null' } });
2426
- }
2427
2347
  getTeamActivityNew(teamId) {
2428
2348
  return this.apiService
2429
2349
  .getResource(activityFactory, Role.TeamAdmin, TEAM_ACTIVITY_NEW_PATH, { teamId });
@@ -2649,6 +2569,259 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImpo
2649
2569
  }]
2650
2570
  }], ctorParameters: function () { return [{ type: ApiService }]; } });
2651
2571
 
2572
+ const CLUB_BOOKABLES_PATH = ':clubId/activities/bookables/';
2573
+ const CLUB_BOOKABLE_PATH = ':clubId/activities/bookables/:bookableId/';
2574
+ const CLUB_BOOKABLE_GROUPS_PATH = ':clubId/activities/bookables/groups/';
2575
+ const CLUB_BOOKABLE_GROUP_PATH = ':clubId/activities/bookables/groups/:groupId/';
2576
+ const CLUB_BOOKABLE_TAGS_PATH = ':clubId/activities/bookables/tags/';
2577
+ const CLUB_BOOKABLE_TAG_PATH = ':clubId/activities/bookables/tags/:tagId/';
2578
+ const CLUB_BOOKABLE_PARTS_PATH = ':clubId/activities/bookables/:bookableId/parts/';
2579
+ const TEAM_BOOKABLES_PATH = ':teamId/activities/bookables/';
2580
+ const TEAM_BOOKABLE_GROUPS_PATH = ':teamId/activities/bookables/groups/';
2581
+ const TEAM_BOOKABLE_TAGS_PATH = ':teamId/activities/bookables/tags/';
2582
+ const TEAM_BOOKABLE_PARTS_PATH = ':teamId/activities/bookables/:bookableId/parts/';
2583
+ const SECTION_BOOKABLES_PATH = ':sectionId/activities/bookables/';
2584
+ const SECTION_BOOKABLE_PATH = ':sectionId/activities/bookables/:bookableId/';
2585
+ const SECTION_BOOKABLE_GROUPS_PATH = ':sectionId/activities/bookables/groups/';
2586
+ const SECTION_BOOKABLE_GROUP_PATH = ':sectionId/activities/bookables/groups/:groupId/';
2587
+ const SECTION_BOOKABLE_TAGS_PATH = ':sectionId/activities/bookables/tags/';
2588
+ const SECTION_BOOKABLE_TAG_PATH = ':sectionId/activities/bookables/tags/:tagId/';
2589
+ const SECTION_BOOKABLE_PARTS_PATH = ':sectionId/activities/bookables/:bookableId/parts/';
2590
+ class BookableService {
2591
+ constructor(apiService) {
2592
+ this.apiService = apiService;
2593
+ }
2594
+ // region Bookable Items
2595
+ getBookableItems(role, clubOrSectionOrTeamId) {
2596
+ if (role == Role.ClubAdmin) {
2597
+ return this.getClubBookableItems(clubOrSectionOrTeamId);
2598
+ }
2599
+ else if (role == Role.SectionAdmin) {
2600
+ return this.getSectionBookableItems(clubOrSectionOrTeamId);
2601
+ }
2602
+ return this.getTeamBookableItems(clubOrSectionOrTeamId);
2603
+ }
2604
+ getTeamBookableItems(teamId) {
2605
+ return this.apiService
2606
+ .getCollection(bookableItemFactory, Role.TeamAdmin, TEAM_BOOKABLES_PATH, { teamId }, { params: { limit: 'null' } });
2607
+ }
2608
+ getClubBookableItems(clubId) {
2609
+ return this.apiService
2610
+ .getCollection(bookableItemFactory, Role.ClubAdmin, CLUB_BOOKABLES_PATH, { clubId }, { params: { limit: 'null' } });
2611
+ }
2612
+ getSectionBookableItems(sectionId) {
2613
+ return this.apiService
2614
+ .getCollection(bookableItemFactory, Role.SectionAdmin, SECTION_BOOKABLES_PATH, { sectionId }, { params: { limit: 'null' } });
2615
+ }
2616
+ updateBookableItem(role, clubOrSectionOrTeamId, bookableItem) {
2617
+ if (role === Role.ClubAdmin) {
2618
+ return this.updateClubBookableItem(clubOrSectionOrTeamId, bookableItem);
2619
+ }
2620
+ return this.updateSectionBookableItem(clubOrSectionOrTeamId, bookableItem);
2621
+ }
2622
+ updateClubBookableItem(clubId, bookableItem) {
2623
+ return this.apiService
2624
+ .updateResource(bookableItemFactory, Role.ClubAdmin, CLUB_BOOKABLE_PATH, {
2625
+ clubId,
2626
+ bookableId: bookableItem.id
2627
+ }, bookableItem);
2628
+ }
2629
+ updateSectionBookableItem(sectionId, bookableItem) {
2630
+ return this.apiService
2631
+ .updateResource(bookableItemFactory, Role.SectionAdmin, SECTION_BOOKABLE_PATH, {
2632
+ sectionId,
2633
+ bookableId: bookableItem.id
2634
+ }, bookableItem);
2635
+ }
2636
+ // endregion
2637
+ // region Bookable Groups
2638
+ getBookableGroups(role, clubOrSectionOrTeamId) {
2639
+ if (role == Role.ClubAdmin) {
2640
+ return this.getClubBookableGroups(clubOrSectionOrTeamId);
2641
+ }
2642
+ else if (role == Role.SectionAdmin) {
2643
+ return this.getSectionBookableGroups(clubOrSectionOrTeamId);
2644
+ }
2645
+ return this.getTeamBookableGroups(clubOrSectionOrTeamId);
2646
+ }
2647
+ getClubBookableGroups(clubId) {
2648
+ return this.apiService
2649
+ .getCollection(bookableGroupFactory, Role.ClubAdmin, CLUB_BOOKABLE_GROUPS_PATH, { clubId }, { params: { limit: 'null' } });
2650
+ }
2651
+ getSectionBookableGroups(sectionId) {
2652
+ return this.apiService
2653
+ .getCollection(bookableGroupFactory, Role.SectionAdmin, SECTION_BOOKABLE_GROUPS_PATH, { sectionId }, { params: { limit: 'null' } });
2654
+ }
2655
+ getTeamBookableGroups(teamId) {
2656
+ return this.apiService
2657
+ .getCollection(bookableGroupFactory, Role.TeamAdmin, TEAM_BOOKABLE_GROUPS_PATH, { teamId }, { params: { limit: 'null' } });
2658
+ }
2659
+ updateBookableGroup(role, clubOrSectionOrTeamId, bookableGroup) {
2660
+ if (role === Role.ClubAdmin) {
2661
+ return this.updateClubBookableGroup(clubOrSectionOrTeamId, bookableGroup);
2662
+ }
2663
+ return this.updateSectionBookableGroup(clubOrSectionOrTeamId, bookableGroup);
2664
+ }
2665
+ updateClubBookableGroup(clubId, bookableGroup) {
2666
+ return this.apiService
2667
+ .updateResource(bookableGroupFactory, Role.ClubAdmin, CLUB_BOOKABLE_GROUP_PATH, {
2668
+ clubId,
2669
+ groupId: bookableGroup.id
2670
+ }, bookableGroup);
2671
+ }
2672
+ updateSectionBookableGroup(sectionId, bookableGroup) {
2673
+ return this.apiService
2674
+ .updateResource(bookableGroupFactory, Role.SectionAdmin, SECTION_BOOKABLE_GROUP_PATH, {
2675
+ sectionId,
2676
+ groupId: bookableGroup.id
2677
+ }, bookableGroup);
2678
+ }
2679
+ createBookableGroup(role, clubOrSectionOrTeamId, bookableGroup) {
2680
+ if (role === Role.ClubAdmin) {
2681
+ return this.createClubBookableGroup(clubOrSectionOrTeamId, bookableGroup);
2682
+ }
2683
+ return this.createSectionBookableGroup(clubOrSectionOrTeamId, bookableGroup);
2684
+ }
2685
+ createClubBookableGroup(clubId, bookableGroup) {
2686
+ delete bookableGroup.id;
2687
+ return this.apiService
2688
+ .postResource(bookableGroupFactory, Role.ClubAdmin, CLUB_BOOKABLE_GROUPS_PATH, {
2689
+ clubId,
2690
+ }, bookableGroup);
2691
+ }
2692
+ createSectionBookableGroup(sectionId, bookableGroup) {
2693
+ delete bookableGroup.id;
2694
+ return this.apiService
2695
+ .postResource(bookableGroupFactory, Role.SectionAdmin, SECTION_BOOKABLE_GROUPS_PATH, {
2696
+ sectionId,
2697
+ }, bookableGroup);
2698
+ }
2699
+ // endregion
2700
+ // region Bookable Tags
2701
+ getBookableTags(role, clubOrSectionOrTeamId) {
2702
+ if (role == Role.ClubAdmin) {
2703
+ return this.getClubBookableTags(clubOrSectionOrTeamId);
2704
+ }
2705
+ else if (role == Role.SectionAdmin) {
2706
+ return this.getSectionBookableTags(clubOrSectionOrTeamId);
2707
+ }
2708
+ return this.getTeamBookableTags(clubOrSectionOrTeamId);
2709
+ }
2710
+ getClubBookableTags(clubId) {
2711
+ return this.apiService
2712
+ .getCollection(bookableTagFactory, Role.ClubAdmin, CLUB_BOOKABLE_TAGS_PATH, { clubId }, { params: { limit: 'null' } });
2713
+ }
2714
+ getSectionBookableTags(sectionId) {
2715
+ return this.apiService
2716
+ .getCollection(bookableTagFactory, Role.SectionAdmin, SECTION_BOOKABLE_TAGS_PATH, { sectionId }, { params: { limit: 'null' } });
2717
+ }
2718
+ getTeamBookableTags(teamId) {
2719
+ return this.apiService
2720
+ .getCollection(bookableTagFactory, Role.TeamAdmin, TEAM_BOOKABLE_TAGS_PATH, { teamId }, { params: { limit: 'null' } });
2721
+ }
2722
+ createBookableTag(role, clubOrSectionOrTeamId, tag) {
2723
+ if (role == Role.ClubAdmin) {
2724
+ return this.createClubBookableTag(clubOrSectionOrTeamId, tag);
2725
+ }
2726
+ else if (role == Role.SectionAdmin) {
2727
+ return this.createSectionBookableTag(clubOrSectionOrTeamId, tag);
2728
+ }
2729
+ return this.createTeamBookableTag(clubOrSectionOrTeamId, tag);
2730
+ }
2731
+ createClubBookableTag(clubId, tag) {
2732
+ delete tag.id;
2733
+ return this.apiService
2734
+ .postResource(bookableTagFactory, Role.ClubAdmin, CLUB_BOOKABLE_TAGS_PATH, {
2735
+ clubId,
2736
+ }, tag);
2737
+ }
2738
+ createSectionBookableTag(sectionId, tag) {
2739
+ delete tag.id;
2740
+ return this.apiService
2741
+ .postResource(bookableTagFactory, Role.SectionAdmin, SECTION_BOOKABLE_TAGS_PATH, {
2742
+ sectionId,
2743
+ }, tag);
2744
+ }
2745
+ createTeamBookableTag(teamId, tag) {
2746
+ delete tag.id;
2747
+ return this.apiService
2748
+ .postResource(bookableTagFactory, Role.TeamAdmin, TEAM_BOOKABLE_TAGS_PATH, {
2749
+ teamId,
2750
+ }, tag);
2751
+ }
2752
+ updateBookableTag(role, clubOrSectionOrTeamId, tag) {
2753
+ if (role == Role.ClubAdmin) {
2754
+ return this.updateClubBookableTag(clubOrSectionOrTeamId, tag);
2755
+ }
2756
+ return this.updateSectionBookableTag(clubOrSectionOrTeamId, tag);
2757
+ }
2758
+ updateClubBookableTag(clubId, tag) {
2759
+ return this.apiService
2760
+ .updateResource(bookableTagFactory, Role.ClubAdmin, CLUB_BOOKABLE_TAG_PATH, {
2761
+ clubId,
2762
+ tagId: tag.id,
2763
+ }, tag);
2764
+ }
2765
+ updateSectionBookableTag(sectionId, tag) {
2766
+ return this.apiService
2767
+ .updateResource(bookableTagFactory, Role.SectionAdmin, SECTION_BOOKABLE_TAG_PATH, {
2768
+ sectionId,
2769
+ tagId: tag.id,
2770
+ }, tag);
2771
+ }
2772
+ deleteBookableTag(role, clubOrSectionOrTeamId, tag) {
2773
+ if (role == Role.ClubAdmin) {
2774
+ return this.deleteClubBookableTag(clubOrSectionOrTeamId, tag);
2775
+ }
2776
+ return this.deleteSectionBookableTag(clubOrSectionOrTeamId, tag);
2777
+ }
2778
+ deleteClubBookableTag(clubId, tag) {
2779
+ return this.apiService
2780
+ .deleteResource(Role.ClubAdmin, CLUB_BOOKABLE_TAG_PATH, {
2781
+ clubId,
2782
+ tagId: tag.id,
2783
+ });
2784
+ }
2785
+ deleteSectionBookableTag(sectionId, tag) {
2786
+ return this.apiService
2787
+ .deleteResource(Role.SectionAdmin, SECTION_BOOKABLE_TAG_PATH, {
2788
+ sectionId,
2789
+ tagId: tag.id,
2790
+ });
2791
+ }
2792
+ // endregion
2793
+ // region Bookable Parts
2794
+ getBookableParts(role, clubOrSectionOrTeamId, bookableId) {
2795
+ if (role == Role.ClubAdmin) {
2796
+ return this.getClubBookableParts(clubOrSectionOrTeamId, bookableId);
2797
+ }
2798
+ else if (role == Role.SectionAdmin) {
2799
+ return this.getSectionBookableParts(clubOrSectionOrTeamId, bookableId);
2800
+ }
2801
+ return this.getTeamBookableParts(clubOrSectionOrTeamId, bookableId);
2802
+ }
2803
+ getClubBookableParts(clubId, bookableId) {
2804
+ return this.apiService
2805
+ .getCollection(bookablePartFactory, Role.ClubAdmin, CLUB_BOOKABLE_PARTS_PATH, { clubId, bookableId }, { params: { limit: 'null' } });
2806
+ }
2807
+ getSectionBookableParts(sectionId, bookableId) {
2808
+ return this.apiService
2809
+ .getCollection(bookablePartFactory, Role.SectionAdmin, SECTION_BOOKABLE_PARTS_PATH, { sectionId, bookableId }, { params: { limit: 'null' } });
2810
+ }
2811
+ getTeamBookableParts(teamId, bookableId) {
2812
+ return this.apiService
2813
+ .getCollection(bookablePartFactory, Role.TeamAdmin, TEAM_BOOKABLE_PARTS_PATH, { teamId, bookableId }, { params: { limit: 'null' } });
2814
+ }
2815
+ }
2816
+ BookableService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: BookableService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
2817
+ BookableService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: BookableService, providedIn: 'root' });
2818
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: BookableService, decorators: [{
2819
+ type: Injectable,
2820
+ args: [{
2821
+ providedIn: 'root'
2822
+ }]
2823
+ }], ctorParameters: function () { return [{ type: ApiService }]; } });
2824
+
2652
2825
  const CLUB_BOOKING_CALENDARS_PATH = ':clubId/activities/calendars/';
2653
2826
  const CLUB_BOOKING_CALENDAR_PATH = ':clubId/activities/calendars/:id/';
2654
2827
  const CLUB_BOOKING_CALENDAR_SLOTS_PATH = ':clubId/activities/slots/';
@@ -2664,8 +2837,8 @@ const CLUB_BOOKING_CALENDAR_REPEATABLE_SESSION_PATH = ':clubId/activities/sessio
2664
2837
  const CLUB_BOOKING_SETTINGS_PATH = ':clubId/activities/booking-settings/';
2665
2838
  const CLUB_BOOKING_CALENDAR_APPLICATION_TIME_PATH = ':clubId/activities/application-times/:id/';
2666
2839
  const CLUB_BOOKING_CALENDAR_APPLICATION_TIMES_PATH = ':clubId/activities/application-times/';
2667
- const CLUB_BOOKING_OVERBOOKED_LOCATIONS_PATH = ':clubId/activities/overbooked/locations/';
2668
2840
  const CLUB_BOOKING_OVERBOOKED_SESSIONS_PATH = ':clubId/activities/overbooked/sessions/';
2841
+ const CLUB_BOOKING_OVERBOOKED_BOOKABLES_PATH = ':clubId/activities/overbooked/bookables/';
2669
2842
  const SECTION_BOOKING_CALENDARS_PATH = ':sectionId/activities/calendars/';
2670
2843
  const SECTION_BOOKING_CALENDAR_PATH = ':sectionId/activities/calendars/:id/';
2671
2844
  const SECTION_BOOKING_CALENDAR_SLOTS_PATH = ':sectionId/activities/slots/';
@@ -2681,8 +2854,8 @@ const SECTION_BOOKING_CALENDAR_REPEATABLE_SESSION_PATH = ':sectionId/activities/
2681
2854
  const SECTION_BOOKING_SETTINGS_PATH = ':sectionId/activities/booking-settings/';
2682
2855
  const SECTION_BOOKING_CALENDAR_APPLICATION_TIME_PATH = ':sectionId/activities/application-times/:id/';
2683
2856
  const SECTION_BOOKING_CALENDAR_APPLICATION_TIMES_PATH = ':sectionId/activities/application-times/';
2684
- const SECTION_BOOKING_OVERBOOKED_LOCATIONS_PATH = ':sectionId/activities/overbooked/locations/';
2685
2857
  const SECTION_BOOKING_OVERBOOKED_SESSIONS_PATH = ':sectionId/activities/overbooked/sessions/';
2858
+ const SECTION_BOOKING_OVERBOOKED_BOOKABLES_PATH = ':sectionId/activities/overbooked/bookables/';
2686
2859
  const TEAM_BOOKING_CALENDARS_PATH = ':teamId/activities/calendars/';
2687
2860
  const TEAM_BOOKING_CALENDAR_SLOTS_PATH = ':teamId/activities/slots/';
2688
2861
  const TEAM_BOOKING_CALENDAR_SLOTS_SYNC_PATH = ':teamId/activities/slots/sync/';
@@ -2694,21 +2867,22 @@ const TEAM_BOOKING_CALENDAR_SLOT_PATH = ':teamId/activities/slots/:id/';
2694
2867
  const TEAM_BOOKING_CALENDAR_APPLICATION_TIMES_PATH = ':teamId/activities/application-times/';
2695
2868
  const TEAM_BOOKING_CALENDAR_APPLICATION_TIME_PATH = ':teamId/activities/application-times/:id/';
2696
2869
  class BookingSlotFilter {
2697
- constructor(startDate = null, endDate = null, calendarIds = [], locationIds = [], tagIds = [], teamIds = [], locationGroupIds = [], activityTypeIds = [], hasOpenSessions = null, showApplicationTimes = null, sortBy = null) {
2870
+ constructor(startDate = null, endDate = null, calendarIds = [], locationIds = [], bookableItemIds = [], tagIds = [], teamIds = [], bookableGroupIds = [], activityTypeIds = [], hasOpenSessions = null, showApplicationTimes = null, sortBy = null) {
2698
2871
  this.startDate = startDate;
2699
2872
  this.endDate = endDate;
2700
2873
  this.calendarIds = calendarIds;
2701
2874
  this.locationIds = locationIds;
2875
+ this.bookableItemIds = bookableItemIds;
2702
2876
  this.tagIds = tagIds;
2703
2877
  this.teamIds = teamIds;
2704
- this.locationGroupIds = locationGroupIds;
2878
+ this.bookableGroupIds = bookableGroupIds;
2705
2879
  this.activityTypeIds = activityTypeIds;
2706
2880
  this.hasOpenSessions = hasOpenSessions;
2707
2881
  this.showApplicationTimes = showApplicationTimes;
2708
2882
  this.sortBy = sortBy;
2709
2883
  }
2710
2884
  static fromFilter(filter) {
2711
- return new this(filter.startDate, filter.endDate, filter.calendarIds, filter.locationIds, filter.tagIds, filter.teamIds, filter.locationGroupIds, filter.activityTypeIds, filter.hasOpenSessions, filter.showApplicationTimes, filter.sortBy);
2885
+ 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);
2712
2886
  }
2713
2887
  toParams() {
2714
2888
  const params = { limit: 'null' };
@@ -2724,11 +2898,14 @@ class BookingSlotFilter {
2724
2898
  if (this.locationIds && this.locationIds.length) {
2725
2899
  params['location_id'] = this.locationIds.join(',');
2726
2900
  }
2727
- if (this.locationGroupIds && this.locationGroupIds.length) {
2728
- params['location_group_id'] = this.locationGroupIds.join(',');
2901
+ if (this.bookableItemIds && this.bookableItemIds.length) {
2902
+ params['bookable_id'] = this.bookableItemIds.join(',');
2903
+ }
2904
+ if (this.bookableGroupIds && this.bookableGroupIds.length) {
2905
+ params['bookable_group_id'] = this.bookableGroupIds.join(',');
2729
2906
  }
2730
2907
  if (this.tagIds && this.tagIds.length) {
2731
- params['tag_id'] = this.tagIds.join(',');
2908
+ params['bookable_tag_id'] = this.tagIds.join(',');
2732
2909
  }
2733
2910
  if (this.teamIds && this.teamIds.length) {
2734
2911
  params['team_id'] = this.teamIds.join(',');
@@ -3381,46 +3558,46 @@ class BookingCalendarService {
3381
3558
  });
3382
3559
  }
3383
3560
  // endregion
3384
- // region Overbooked locations
3385
- getOverbookedLocations(role, clubOrSectionOrTeamId, bookingSlotFilter) {
3561
+ // region Overbooked sessions
3562
+ getOverbookedSessions(role, clubOrSectionOrTeamId, bookingSlotFilter) {
3386
3563
  if (role == Role.ClubAdmin) {
3387
- return this.getClubOverbookedLocations(clubOrSectionOrTeamId, bookingSlotFilter);
3564
+ return this.getClubOverbookedSessions(clubOrSectionOrTeamId, bookingSlotFilter);
3388
3565
  }
3389
- return this.getSectionOverbookedLocations(clubOrSectionOrTeamId, bookingSlotFilter);
3566
+ return this.getSectionOverbookedSessions(clubOrSectionOrTeamId, bookingSlotFilter);
3390
3567
  }
3391
- getClubOverbookedLocations(clubId, bookingSlotFilter) {
3568
+ getClubOverbookedSessions(clubId, bookingSlotFilter) {
3392
3569
  const params = bookingSlotFilter.toParams();
3393
3570
  return this.apiService
3394
- .getCollection(overbookedLocationFactory, Role.ClubAdmin, CLUB_BOOKING_OVERBOOKED_LOCATIONS_PATH, { clubId }, {
3571
+ .getCollection(bookingCalendarSlotSessionFactory, Role.ClubAdmin, CLUB_BOOKING_OVERBOOKED_SESSIONS_PATH, { clubId }, {
3395
3572
  params
3396
3573
  });
3397
3574
  }
3398
- getSectionOverbookedLocations(sectionId, bookingSlotFilter) {
3575
+ getSectionOverbookedSessions(sectionId, bookingSlotFilter) {
3399
3576
  const params = bookingSlotFilter.toParams();
3400
3577
  return this.apiService
3401
- .getCollection(overbookedLocationFactory, Role.SectionAdmin, SECTION_BOOKING_OVERBOOKED_LOCATIONS_PATH, { sectionId }, {
3578
+ .getCollection(bookingCalendarSlotSessionFactory, Role.SectionAdmin, SECTION_BOOKING_OVERBOOKED_SESSIONS_PATH, { sectionId }, {
3402
3579
  params
3403
3580
  });
3404
3581
  }
3405
3582
  // endregion
3406
- // region Overbooked sessions
3407
- getOverbookedSessions(role, clubOrSectionOrTeamId, bookingSlotFilter) {
3583
+ // region Overbooked bookables
3584
+ getOverbookedBookables(role, clubOrSectionOrTeamId, bookingSlotFilter) {
3408
3585
  if (role == Role.ClubAdmin) {
3409
- return this.getClubOverbookedSessions(clubOrSectionOrTeamId, bookingSlotFilter);
3586
+ return this.getClubOverbookedBookables(clubOrSectionOrTeamId, bookingSlotFilter);
3410
3587
  }
3411
- return this.getSectionOverbookedSessions(clubOrSectionOrTeamId, bookingSlotFilter);
3588
+ return this.getSectionOverbookedBookables(clubOrSectionOrTeamId, bookingSlotFilter);
3412
3589
  }
3413
- getClubOverbookedSessions(clubId, bookingSlotFilter) {
3590
+ getClubOverbookedBookables(clubId, bookingSlotFilter) {
3414
3591
  const params = bookingSlotFilter.toParams();
3415
3592
  return this.apiService
3416
- .getCollection(bookingCalendarSlotSessionFactory, Role.ClubAdmin, CLUB_BOOKING_OVERBOOKED_SESSIONS_PATH, { clubId }, {
3593
+ .getCollection(overbookedBookableItemFactory, Role.ClubAdmin, CLUB_BOOKING_OVERBOOKED_BOOKABLES_PATH, { clubId }, {
3417
3594
  params
3418
3595
  });
3419
3596
  }
3420
- getSectionOverbookedSessions(sectionId, bookingSlotFilter) {
3597
+ getSectionOverbookedBookables(sectionId, bookingSlotFilter) {
3421
3598
  const params = bookingSlotFilter.toParams();
3422
3599
  return this.apiService
3423
- .getCollection(bookingCalendarSlotSessionFactory, Role.SectionAdmin, SECTION_BOOKING_OVERBOOKED_SESSIONS_PATH, { sectionId }, {
3600
+ .getCollection(overbookedBookableItemFactory, Role.SectionAdmin, SECTION_BOOKING_OVERBOOKED_BOOKABLES_PATH, { sectionId }, {
3424
3601
  params
3425
3602
  });
3426
3603
  }
@@ -4629,5 +4806,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImpo
4629
4806
  * Generated bundle index. Do not edit.
4630
4807
  */
4631
4808
 
4632
- export { APP, Activity, ActivityExtraMember, ActivityInvite, ActivityLocation, ActivityLocationGroup, ActivityLocationPart, ActivityLocationTag, ActivityParticipant, 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 };
4809
+ 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 };
4633
4810
  //# sourceMappingURL=myclub_se-data-access.mjs.map