@myclub_se/data-access 2.5.3 → 2.5.5
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.
- package/esm2020/lib/api-models/api-booking-calendar-application-time.mjs +2 -0
- package/esm2020/lib/api-models/api-booking-calendar-slot.mjs +1 -1
- package/esm2020/lib/api-models/api-member-public-form.mjs +1 -1
- package/esm2020/lib/api-models/index.mjs +2 -1
- package/esm2020/lib/models/booking-calendar-application-time.mjs +34 -0
- package/esm2020/lib/models/booking-calendar-slot.mjs +3 -2
- package/esm2020/lib/models/index.mjs +2 -1
- package/esm2020/lib/models/member-public-form.mjs +5 -2
- package/esm2020/lib/services/activity.service.mjs +26 -4
- package/esm2020/lib/services/booking-calendar.service.mjs +194 -2
- package/esm2020/lib/services/factories/booking-calendar-application-time-factory.mjs +3 -0
- package/esm2020/lib/services/factories/booking-calendar-slot-factory.mjs +3 -2
- package/esm2020/lib/services/factories/index.mjs +3 -1
- package/esm2020/lib/services/factories/member-public-form-factory.mjs +10 -3
- package/fesm2015/myclub_se-data-access.mjs +272 -11
- package/fesm2015/myclub_se-data-access.mjs.map +1 -1
- package/fesm2020/myclub_se-data-access.mjs +272 -11
- package/fesm2020/myclub_se-data-access.mjs.map +1 -1
- package/lib/api-models/api-booking-calendar-application-time.d.ts +14 -0
- package/lib/api-models/api-booking-calendar-slot.d.ts +2 -0
- package/lib/api-models/api-member-public-form.d.ts +3 -0
- package/lib/api-models/index.d.ts +1 -0
- package/lib/models/booking-calendar-application-time.d.ts +30 -0
- package/lib/models/booking-calendar-slot.d.ts +3 -1
- package/lib/models/index.d.ts +1 -0
- package/lib/models/member-public-form.d.ts +4 -1
- package/lib/services/activity.service.d.ts +4 -2
- package/lib/services/booking-calendar.service.d.ts +20 -1
- package/lib/services/factories/booking-calendar-application-time-factory.d.ts +3 -0
- package/lib/services/factories/index.d.ts +2 -0
- package/package.json +1 -1
- package/esm2020/lib/types/booking-calendar-slot-reserved-time-type.mjs +0 -2
- package/lib/types/booking-calendar-slot-reserved-time-type.d.ts +0 -1
|
@@ -257,8 +257,41 @@ class BookingCalendar {
|
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
259
|
|
|
260
|
+
class BookingCalendarApplicationTime {
|
|
261
|
+
constructor(id, section_id, slot_id, team_id, end_time, section_name, start_time, team_name, location_zones_taken, applicant_comment, reviewer_comment, status) {
|
|
262
|
+
this.id = id;
|
|
263
|
+
this.section_id = section_id;
|
|
264
|
+
this.slot_id = slot_id;
|
|
265
|
+
this.team_id = team_id;
|
|
266
|
+
this.end_time = end_time;
|
|
267
|
+
this.section_name = section_name;
|
|
268
|
+
this.start_time = start_time;
|
|
269
|
+
this.team_name = team_name;
|
|
270
|
+
this.location_zones_taken = location_zones_taken;
|
|
271
|
+
this.applicant_comment = applicant_comment;
|
|
272
|
+
this.reviewer_comment = reviewer_comment;
|
|
273
|
+
this.status = status;
|
|
274
|
+
}
|
|
275
|
+
static asFormGroup(session) {
|
|
276
|
+
return new FormGroup({
|
|
277
|
+
id: new FormControl(session?.id || ''),
|
|
278
|
+
section_id: new FormControl(session?.section_id || ''),
|
|
279
|
+
slot_id: new FormControl(session?.slot_id || '', Validators.required),
|
|
280
|
+
team_id: new FormControl(session?.team_id || '', Validators.required),
|
|
281
|
+
end_time: new FormControl(session?.end_time || '', Validators.required),
|
|
282
|
+
section_name: new FormControl(session?.section_name || ''),
|
|
283
|
+
start_time: new FormControl(session?.start_time || '', Validators.required),
|
|
284
|
+
team_name: new FormControl(session?.team_name || ''),
|
|
285
|
+
location_zones_taken: new FormControl(session?.location_zones_taken || 1, [Validators.min(1), Validators.required]),
|
|
286
|
+
applicant_comment: new FormControl(session?.applicant_comment || null),
|
|
287
|
+
reviewer_comment: new FormControl(session?.reviewer_comment || null),
|
|
288
|
+
status: new FormControl(session?.status || ''),
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
260
293
|
class BookingCalendarSlot {
|
|
261
|
-
constructor(id, calendar_id, location_id, color, day, end_time, group_id, location_name, number_of_available_sessions, sessions, open_sessions, start_time, type, repeat, update_repeating, reserved_time_enabled, repeat_num, repeat_to_day, repeat_type, reserved_time, reserved_time_position) {
|
|
294
|
+
constructor(id, calendar_id, location_id, color, day, end_time, group_id, location_name, number_of_available_sessions, sessions, open_sessions, start_time, type, repeat, update_repeating, reserved_time_enabled, repeat_num, repeat_to_day, repeat_type, reserved_time, reserved_time_position, application_times) {
|
|
262
295
|
this.id = id;
|
|
263
296
|
this.calendar_id = calendar_id;
|
|
264
297
|
this.location_id = location_id;
|
|
@@ -280,6 +313,7 @@ class BookingCalendarSlot {
|
|
|
280
313
|
this.repeat_type = repeat_type;
|
|
281
314
|
this.reserved_time = reserved_time;
|
|
282
315
|
this.reserved_time_position = reserved_time_position;
|
|
316
|
+
this.application_times = application_times;
|
|
283
317
|
}
|
|
284
318
|
static asFormGroup(slot) {
|
|
285
319
|
return new FormGroup({
|
|
@@ -1070,7 +1104,7 @@ class MemberActivityInvite {
|
|
|
1070
1104
|
}
|
|
1071
1105
|
|
|
1072
1106
|
class MemberPublicForm {
|
|
1073
|
-
constructor(id, active_form, active_to, userToken, comment, dataprotection_policy_choice, dataprotection_policy_url, fields, full_text, has_nationality_field, max_members_per_team, max_registered_in_form_total, member_types, member_type_help_text, name, num_chars_birth_date, num_registered, role_help_text, roles, team_help_text, teams, url) {
|
|
1107
|
+
constructor(id, active_form, active_to, userToken, comment, dataprotection_policy_choice, dataprotection_policy_url, fields, full_text, has_nationality_field, max_members_per_team, max_registered_in_form_total, member_fields, member_types, member_type_help_text, name, num_chars_birth_date, num_registered, registered, register_family, role_help_text, roles, team_help_text, teams, url) {
|
|
1074
1108
|
this.id = id;
|
|
1075
1109
|
this.active_form = active_form;
|
|
1076
1110
|
this.active_to = active_to;
|
|
@@ -1083,11 +1117,14 @@ class MemberPublicForm {
|
|
|
1083
1117
|
this.has_nationality_field = has_nationality_field;
|
|
1084
1118
|
this.max_members_per_team = max_members_per_team;
|
|
1085
1119
|
this.max_registered_in_form_total = max_registered_in_form_total;
|
|
1120
|
+
this.member_fields = member_fields;
|
|
1086
1121
|
this.member_types = member_types;
|
|
1087
1122
|
this.member_type_help_text = member_type_help_text;
|
|
1088
1123
|
this.name = name;
|
|
1089
1124
|
this.num_chars_birth_date = num_chars_birth_date;
|
|
1090
1125
|
this.num_registered = num_registered;
|
|
1126
|
+
this.registered = registered;
|
|
1127
|
+
this.register_family = register_family;
|
|
1091
1128
|
this.role_help_text = role_help_text;
|
|
1092
1129
|
this.roles = roles;
|
|
1093
1130
|
this.team_help_text = team_help_text;
|
|
@@ -1421,6 +1458,10 @@ const activityInviteFactory = (apiActivityInvite) => new ActivityInvite(apiActiv
|
|
|
1421
1458
|
|
|
1422
1459
|
const activityLocationFactory = (apiActivityLocation) => new ActivityLocation(apiActivityLocation.id, apiActivityLocation.club_id, apiActivityLocation.section_id, apiActivityLocation.active, apiActivityLocation.mun_location_city_area, apiActivityLocation.mun_location_name, apiActivityLocation.name);
|
|
1423
1460
|
|
|
1461
|
+
const activityLocationGroupFactory = (apiActivityLocationGroup) => {
|
|
1462
|
+
return new ActivityLocationGroup(apiActivityLocationGroup.id, apiActivityLocationGroup.club_id, apiActivityLocationGroup.section_id, apiActivityLocationGroup.active, apiActivityLocationGroup.name, apiActivityLocationGroup.locations && apiActivityLocationGroup.locations.length ? apiActivityLocationGroup.locations.map((apiActivityLocation) => activityLocationFactory(apiActivityLocation)) : []);
|
|
1463
|
+
};
|
|
1464
|
+
|
|
1424
1465
|
const activitySettingsFactory = (apiActivitySettings) => new ActivitySettings(apiActivitySettings.day_options, apiActivitySettings.hour_options, apiActivitySettings.invite_group_options, apiActivitySettings.invite_settings_options, apiActivitySettings.max_attendance_options, apiActivitySettings.meet_up_time_options, apiActivitySettings.remind_receiver_options, apiActivitySettings.repeat_options, apiActivitySettings.repeat_type_options);
|
|
1425
1466
|
|
|
1426
1467
|
const activityTypeFactory = (apiActivityType) => new ActivityType(apiActivityType.id, apiActivityType.club_id, apiActivityType.section_id, apiActivityType.active, apiActivityType.base_type, apiActivityType.name);
|
|
@@ -1437,9 +1478,11 @@ const authFactory = (apiAuth) => new Auth(apiAuth.id, apiAuth.name, apiAuth.club
|
|
|
1437
1478
|
|
|
1438
1479
|
const bookingCalendarFactory = (apiBookingCalendar) => new BookingCalendar(apiBookingCalendar.id, apiBookingCalendar.club_id, apiBookingCalendar.section_id, apiBookingCalendar.team_id, apiBookingCalendar.club_name, apiBookingCalendar.color, apiBookingCalendar.name, apiBookingCalendar.section_name, apiBookingCalendar.team_name);
|
|
1439
1480
|
|
|
1481
|
+
const bookingCalendarApplicationTimeFactory = (apiBookingApplicationTime) => new BookingCalendarApplicationTime(apiBookingApplicationTime.id, apiBookingApplicationTime.section_id, apiBookingApplicationTime.slot_id, apiBookingApplicationTime.team_id, apiBookingApplicationTime.end_time, apiBookingApplicationTime.section_name, apiBookingApplicationTime.start_time, apiBookingApplicationTime.team_name, apiBookingApplicationTime.location_zones_taken, apiBookingApplicationTime.applicant_comment, apiBookingApplicationTime.reviewer_comment, apiBookingApplicationTime.status);
|
|
1482
|
+
|
|
1440
1483
|
const bookingCalendarSlotSessionFactory = (apiBookingSlotSession) => new BookingCalendarSlotSession(apiBookingSlotSession.id, apiBookingSlotSession.section_id, apiBookingSlotSession.slot_id, apiBookingSlotSession.team_id, apiBookingSlotSession.end_time, apiBookingSlotSession.section_name, apiBookingSlotSession.start_time, apiBookingSlotSession.team_name, apiBookingSlotSession.is_overbooked, apiBookingSlotSession.type, apiBookingSlotSession.location_zones_taken, apiBookingSlotSession.slot_index);
|
|
1441
1484
|
|
|
1442
|
-
const bookingCalendarSlotFactory = (apiBookingSlot) => new BookingCalendarSlot(apiBookingSlot.id, apiBookingSlot.calendar_id, 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', false, false, 6, format(new Date(), 'yyyy-MM-dd'), 'repeat_until', apiBookingSlot.reserved_time, apiBookingSlot.reserved_time_position);
|
|
1485
|
+
const bookingCalendarSlotFactory = (apiBookingSlot) => new BookingCalendarSlot(apiBookingSlot.id, apiBookingSlot.calendar_id, 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', false, 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)) : []);
|
|
1443
1486
|
|
|
1444
1487
|
const bookingSettingsFactory = (apiBookingSettings) => new BookingSettings(apiBookingSettings.id, apiBookingSettings.club_id, apiBookingSettings.calendar_step, apiBookingSettings.calendar_min_time, apiBookingSettings.calendar_max_time, apiBookingSettings.require_team_on_closed_session);
|
|
1445
1488
|
|
|
@@ -1512,14 +1555,21 @@ const memberTypeFactory = (apiMemberType) => new MemberType(apiMemberType.id, ap
|
|
|
1512
1555
|
|
|
1513
1556
|
const memberPublicFormFactory = (apiMemberPublicForm) => {
|
|
1514
1557
|
const fields = new Map();
|
|
1558
|
+
const member_fields = new Map();
|
|
1559
|
+
if (apiMemberPublicForm.member_fields) {
|
|
1560
|
+
Object.entries(apiMemberPublicForm.member_fields)
|
|
1561
|
+
.forEach(([key, field]) => {
|
|
1562
|
+
member_fields.set(key, memberPublicFormFieldFactory(field));
|
|
1563
|
+
});
|
|
1564
|
+
}
|
|
1515
1565
|
if (apiMemberPublicForm.fields) {
|
|
1516
1566
|
Object.entries(apiMemberPublicForm.fields)
|
|
1517
1567
|
.forEach(([key, field]) => {
|
|
1518
1568
|
fields.set(key, memberPublicFormFieldFactory(field));
|
|
1519
1569
|
});
|
|
1520
1570
|
}
|
|
1521
|
-
return new MemberPublicForm(apiMemberPublicForm.id, apiMemberPublicForm.active_from, apiMemberPublicForm.active_to, apiMemberPublicForm.user_token, apiMemberPublicForm.comment, apiMemberPublicForm.dataprotection_policy_choice, apiMemberPublicForm.dataprotection_policy_url, fields, apiMemberPublicForm.full_text, apiMemberPublicForm.has_nationality_field, apiMemberPublicForm.max_members_per_team, apiMemberPublicForm.max_registered_in_form_total, apiMemberPublicForm.member_types && apiMemberPublicForm.member_types.length ?
|
|
1522
|
-
apiMemberPublicForm.member_types.map((memberType) => memberTypeFactory(memberType)) : [], apiMemberPublicForm.member_type_help_text, apiMemberPublicForm.name, apiMemberPublicForm.num_chars_birth_date, apiMemberPublicForm.num_registered, apiMemberPublicForm.role_help_text, apiMemberPublicForm.roles && apiMemberPublicForm.roles.length
|
|
1571
|
+
return new MemberPublicForm(apiMemberPublicForm.id, apiMemberPublicForm.active_from, apiMemberPublicForm.active_to, apiMemberPublicForm.user_token, apiMemberPublicForm.comment, apiMemberPublicForm.dataprotection_policy_choice, apiMemberPublicForm.dataprotection_policy_url, fields, apiMemberPublicForm.full_text, apiMemberPublicForm.has_nationality_field, apiMemberPublicForm.max_members_per_team, apiMemberPublicForm.max_registered_in_form_total, member_fields, apiMemberPublicForm.member_types && apiMemberPublicForm.member_types.length ?
|
|
1572
|
+
apiMemberPublicForm.member_types.map((memberType) => memberTypeFactory(memberType)) : [], apiMemberPublicForm.member_type_help_text, apiMemberPublicForm.name, apiMemberPublicForm.num_chars_birth_date, apiMemberPublicForm.num_registered, apiMemberPublicForm.registered, apiMemberPublicForm.register_family, apiMemberPublicForm.role_help_text, apiMemberPublicForm.roles && apiMemberPublicForm.roles.length
|
|
1523
1573
|
? apiMemberPublicForm.roles.map((role) => groupRoleFactory(role)) : [], apiMemberPublicForm.team_help_text, apiMemberPublicForm.teams && apiMemberPublicForm.teams.length
|
|
1524
1574
|
? apiMemberPublicForm.teams.map((team) => searchTeamFactory(team)) : [], apiMemberPublicForm.url);
|
|
1525
1575
|
};
|
|
@@ -1615,10 +1665,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImpo
|
|
|
1615
1665
|
}]
|
|
1616
1666
|
}], ctorParameters: function () { return [{ type: ApiService }]; } });
|
|
1617
1667
|
|
|
1618
|
-
const activityLocationGroupFactory = (apiActivityLocationGroup) => {
|
|
1619
|
-
return new ActivityLocationGroup(apiActivityLocationGroup.id, apiActivityLocationGroup.club_id, apiActivityLocationGroup.section_id, apiActivityLocationGroup.active, apiActivityLocationGroup.name, apiActivityLocationGroup.locations && apiActivityLocationGroup.locations.length ? apiActivityLocationGroup.locations.map((apiActivityLocation) => activityLocationFactory(apiActivityLocation)) : []);
|
|
1620
|
-
};
|
|
1621
|
-
|
|
1622
1668
|
const MEMBER_ACTIVITY_INVITE_PATH = ':memberId/activities/:activityInviteId/';
|
|
1623
1669
|
const MEMBER_ACTIVITY_INVITES_PATH = ':memberId/activities/';
|
|
1624
1670
|
const MEMBER_CALENDAR_PATH = ':memberId/activities/calendar/';
|
|
@@ -1634,9 +1680,10 @@ const TEAM_ACTIVITY_SETTINGS_PATH = ':teamId/activities/settings/';
|
|
|
1634
1680
|
const CLUB_ACTIVITY_SETTINGS_PATH = ':clubId/activities/settings/';
|
|
1635
1681
|
const TEAM_ACTIVITY_TYPES_PATH = ':teamId/activities/types/';
|
|
1636
1682
|
const TEAM_CALENDAR_PATH = ':teamId/activities/calendar/';
|
|
1637
|
-
const TEAM_ACTIVITY_LOCATIONS_PATH = ':teamId/activities/locations/';
|
|
1638
1683
|
const CLUB_ACTIVITY_LOCATIONS_PATH = ':clubId/activities/locations/';
|
|
1639
1684
|
const CLUB_ACTIVITY_LOCATION_GROUPS_PATH = ':clubId/activities/locations/groups/';
|
|
1685
|
+
const TEAM_ACTIVITY_LOCATIONS_PATH = ':teamId/activities/locations/';
|
|
1686
|
+
const TEAM_ACTIVITY_LOCATION_GROUPS_PATH = ':teamId/activities/locations/groups/';
|
|
1640
1687
|
class ActivityService {
|
|
1641
1688
|
constructor(apiService) {
|
|
1642
1689
|
this.apiService = apiService;
|
|
@@ -1729,6 +1776,12 @@ class ActivityService {
|
|
|
1729
1776
|
this.activityLocationCollection = activityLocationCollection;
|
|
1730
1777
|
}));
|
|
1731
1778
|
}
|
|
1779
|
+
getActivityLocationGroups(role, clubOrTeamId) {
|
|
1780
|
+
if (role == Role.ClubAdmin) {
|
|
1781
|
+
return this.getClubActivityLocationGroups(clubOrTeamId);
|
|
1782
|
+
}
|
|
1783
|
+
return this.getTeamActivityLocationGroups(clubOrTeamId);
|
|
1784
|
+
}
|
|
1732
1785
|
getClubActivityLocationGroups(clubId) {
|
|
1733
1786
|
if (this.activityLocationGroupResponseDate && this.activityLocationGroupResponseDate > sub(new Date(), { hours: 1 })) {
|
|
1734
1787
|
return of(this.activityLocationGroupCollection);
|
|
@@ -1739,6 +1792,16 @@ class ActivityService {
|
|
|
1739
1792
|
this.activityLocationGroupCollection = activityLocationGroupCollection;
|
|
1740
1793
|
}));
|
|
1741
1794
|
}
|
|
1795
|
+
getTeamActivityLocationGroups(teamId) {
|
|
1796
|
+
if (this.activityLocationGroupResponseDate && this.activityLocationGroupResponseDate > sub(new Date(), { hours: 1 })) {
|
|
1797
|
+
return of(this.activityLocationGroupCollection);
|
|
1798
|
+
}
|
|
1799
|
+
return this.apiService
|
|
1800
|
+
.getCollection(activityLocationGroupFactory, Role.TeamAdmin, TEAM_ACTIVITY_LOCATION_GROUPS_PATH, { teamId }, { params: { limit: 'null' } }).pipe(tap((activityLocationGroupCollection) => {
|
|
1801
|
+
this.activityLocationGroupResponseDate = new Date();
|
|
1802
|
+
this.activityLocationGroupCollection = activityLocationGroupCollection;
|
|
1803
|
+
}));
|
|
1804
|
+
}
|
|
1742
1805
|
getTeamActivityNew(teamId) {
|
|
1743
1806
|
return this.apiService
|
|
1744
1807
|
.getResource(activityFactory, Role.TeamAdmin, TEAM_ACTIVITY_NEW_PATH, { teamId });
|
|
@@ -1750,6 +1813,12 @@ class ActivityService {
|
|
|
1750
1813
|
activityId
|
|
1751
1814
|
}, { params: { limit: 'null' } });
|
|
1752
1815
|
}
|
|
1816
|
+
getActivitySettings(role, clubOrTeamId) {
|
|
1817
|
+
if (role === Role.ClubAdmin) {
|
|
1818
|
+
return this.getClubActivitySettings(clubOrTeamId);
|
|
1819
|
+
}
|
|
1820
|
+
return this.getTeamActivitySettings(clubOrTeamId);
|
|
1821
|
+
}
|
|
1753
1822
|
getTeamActivitySettings(teamId) {
|
|
1754
1823
|
return this.apiService
|
|
1755
1824
|
.getResource(activitySettingsFactory, Role.TeamAdmin, TEAM_ACTIVITY_SETTINGS_PATH, {
|
|
@@ -1857,6 +1926,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImpo
|
|
|
1857
1926
|
const CLUB_BOOKING_CALENDARS_PATH = ':clubId/activities/calendars/';
|
|
1858
1927
|
const CLUB_BOOKING_CALENDAR_PATH = ':clubId/activities/calendars/:id/';
|
|
1859
1928
|
const CLUB_BOOKING_CALENDAR_SLOTS_PATH = ':clubId/activities/slots/';
|
|
1929
|
+
const CLUB_BOOKING_CALENDAR_SLOTS_APPLICATION_TIMES_PATH = ':clubId/activities/slots/application-times/';
|
|
1860
1930
|
const CLUB_BOOKING_CALENDAR_SLOTS_COPY_PATH = ':clubId/activities/slots/copy/';
|
|
1861
1931
|
const CLUB_BOOKING_CALENDAR_SLOTS_CLEAR_PATH = ':clubId/activities/slots/clear/';
|
|
1862
1932
|
const CLUB_BOOKING_CALENDAR_SLOT_PATH = ':clubId/activities/slots/:id/';
|
|
@@ -1864,6 +1934,15 @@ const CLUB_BOOKING_CALENDAR_REPEATABLE_SLOT_PATH = ':clubId/activities/slots/:id
|
|
|
1864
1934
|
const CLUB_BOOKING_CALENDAR_SLOT_SESSIONS_PATH = ':clubId/activities/sessions/';
|
|
1865
1935
|
const CLUB_BOOKING_CALENDAR_SLOT_SESSION_PATH = ':clubId/activities/sessions/:id/';
|
|
1866
1936
|
const CLUB_BOOKING_SETTINGS_PATH = ':clubId/activities/booking-settings/';
|
|
1937
|
+
const CLUB_BOOKING_CALENDAR_APPLICATION_TIME_PATH = ':clubId/activities/application-times/:id/';
|
|
1938
|
+
const TEAM_BOOKING_CALENDARS_PATH = ':teamId/activities/calendars/';
|
|
1939
|
+
const TEAM_BOOKING_CALENDAR_SLOTS_PATH = ':teamId/activities/slots/';
|
|
1940
|
+
const TEAM_BOOKING_CALENDAR_SLOTS_APPLICATION_TIMES_PATH = ':teamId/activities/slots/application-times/';
|
|
1941
|
+
const TEAM_BOOKING_SETTINGS_PATH = ':teamId/activities/booking-settings/';
|
|
1942
|
+
const TEAM_BOOKING_CALENDAR_SLOT_SESSIONS_PATH = ':teamId/activities/sessions/';
|
|
1943
|
+
const TEAM_BOOKING_CALENDAR_SLOT_SESSION_PATH = ':teamId/activities/sessions/:id/';
|
|
1944
|
+
const TEAM_BOOKING_CALENDAR_APPLICATION_TIMES_PATH = ':teamId/activities/application-times/';
|
|
1945
|
+
const TEAM_BOOKING_CALENDAR_APPLICATION_TIME_PATH = ':teamId/activities/application-times/:id/';
|
|
1867
1946
|
class BookingCalendarService {
|
|
1868
1947
|
constructor(apiService) {
|
|
1869
1948
|
this.apiService = apiService;
|
|
@@ -1876,6 +1955,12 @@ class BookingCalendarService {
|
|
|
1876
1955
|
clubId,
|
|
1877
1956
|
}, calendar);
|
|
1878
1957
|
}
|
|
1958
|
+
getBookingCalendars(role, clubOrTeamId, name = null) {
|
|
1959
|
+
if (role == Role.ClubAdmin) {
|
|
1960
|
+
return this.getClubBookingCalendars(clubOrTeamId, name);
|
|
1961
|
+
}
|
|
1962
|
+
return this.getTeamBookingCalendars(clubOrTeamId, name);
|
|
1963
|
+
}
|
|
1879
1964
|
getClubBookingCalendars(clubId, name = null) {
|
|
1880
1965
|
const params = { limit: 'null' };
|
|
1881
1966
|
if (name) {
|
|
@@ -1886,6 +1971,16 @@ class BookingCalendarService {
|
|
|
1886
1971
|
params
|
|
1887
1972
|
});
|
|
1888
1973
|
}
|
|
1974
|
+
getTeamBookingCalendars(teamId, name = null) {
|
|
1975
|
+
const params = { limit: 'null' };
|
|
1976
|
+
if (name) {
|
|
1977
|
+
params['name'] = name;
|
|
1978
|
+
}
|
|
1979
|
+
return this.apiService
|
|
1980
|
+
.getCollection(bookingCalendarFactory, Role.TeamAdmin, TEAM_BOOKING_CALENDARS_PATH, { teamId }, {
|
|
1981
|
+
params
|
|
1982
|
+
});
|
|
1983
|
+
}
|
|
1889
1984
|
getClubBookingCalendar(clubId, id) {
|
|
1890
1985
|
return this.apiService
|
|
1891
1986
|
.getResource(bookingCalendarFactory, Role.ClubAdmin, CLUB_BOOKING_CALENDAR_PATH, { clubId, id });
|
|
@@ -1913,6 +2008,12 @@ class BookingCalendarService {
|
|
|
1913
2008
|
clubId,
|
|
1914
2009
|
}, slot);
|
|
1915
2010
|
}
|
|
2011
|
+
getBookingCalendarSlots(role, clubOrTeamId, startDate = null, endDate = null, calendarIds = null, locationIds = null, teamIds = null, hasOpenSessions = null) {
|
|
2012
|
+
if (role == Role.ClubAdmin) {
|
|
2013
|
+
return this.getClubBookingCalendarSlots(clubOrTeamId, startDate, endDate, calendarIds, locationIds, teamIds, hasOpenSessions);
|
|
2014
|
+
}
|
|
2015
|
+
return this.getTeamBookingCalendarSlots(clubOrTeamId, startDate, endDate, calendarIds, locationIds, teamIds, hasOpenSessions);
|
|
2016
|
+
}
|
|
1916
2017
|
getClubBookingCalendarSlots(clubId, startDate = null, endDate = null, calendarIds = null, locationIds = null, teamIds = null, hasOpenSessions = null) {
|
|
1917
2018
|
const params = { limit: 'null' };
|
|
1918
2019
|
if (startDate) {
|
|
@@ -1938,6 +2039,87 @@ class BookingCalendarService {
|
|
|
1938
2039
|
params
|
|
1939
2040
|
});
|
|
1940
2041
|
}
|
|
2042
|
+
getTeamBookingCalendarSlots(teamId, startDate = null, endDate = null, calendarIds = null, locationIds = null, teamIds = null, hasOpenSessions = null) {
|
|
2043
|
+
const params = { limit: 'null' };
|
|
2044
|
+
if (startDate) {
|
|
2045
|
+
params['day__gte'] = startDate;
|
|
2046
|
+
}
|
|
2047
|
+
if (endDate) {
|
|
2048
|
+
params['day__lte'] = endDate;
|
|
2049
|
+
}
|
|
2050
|
+
if (calendarIds && calendarIds.length) {
|
|
2051
|
+
params['calendar_id'] = calendarIds.join(',');
|
|
2052
|
+
}
|
|
2053
|
+
if (locationIds && locationIds.length) {
|
|
2054
|
+
params['location_id'] = locationIds.join(',');
|
|
2055
|
+
}
|
|
2056
|
+
if (teamIds && teamIds.length) {
|
|
2057
|
+
params['team_id'] = teamIds.join(',');
|
|
2058
|
+
}
|
|
2059
|
+
if (typeof hasOpenSessions === 'boolean') {
|
|
2060
|
+
params['has_open_sessions'] = String(hasOpenSessions);
|
|
2061
|
+
}
|
|
2062
|
+
return this.apiService
|
|
2063
|
+
.getCollection(bookingCalendarSlotFactory, Role.TeamAdmin, TEAM_BOOKING_CALENDAR_SLOTS_PATH, { teamId }, {
|
|
2064
|
+
params
|
|
2065
|
+
});
|
|
2066
|
+
}
|
|
2067
|
+
getBookingCalendarApplicationTimeSlots(role, clubOrTeamId, startDate = null, endDate = null, calendarIds = null, locationIds = null, teamIds = null, hasOpenSessions = null) {
|
|
2068
|
+
if (role == Role.ClubAdmin) {
|
|
2069
|
+
return this.getClubBookingCalendarApplicationTimeSlots(clubOrTeamId, startDate, endDate, calendarIds, locationIds, teamIds, hasOpenSessions);
|
|
2070
|
+
}
|
|
2071
|
+
return this.getTeamBookingCalendarApplicationTimeSlots(clubOrTeamId, startDate, endDate, calendarIds, locationIds, teamIds, hasOpenSessions);
|
|
2072
|
+
}
|
|
2073
|
+
getClubBookingCalendarApplicationTimeSlots(clubId, startDate = null, endDate = null, calendarIds = null, locationIds = null, teamIds = null, hasOpenSessions = null) {
|
|
2074
|
+
const params = { limit: 'null' };
|
|
2075
|
+
if (startDate) {
|
|
2076
|
+
params['day__gte'] = startDate;
|
|
2077
|
+
}
|
|
2078
|
+
if (endDate) {
|
|
2079
|
+
params['day__lte'] = endDate;
|
|
2080
|
+
}
|
|
2081
|
+
if (calendarIds && calendarIds.length) {
|
|
2082
|
+
params['calendar_id'] = calendarIds.join(',');
|
|
2083
|
+
}
|
|
2084
|
+
if (locationIds && locationIds.length) {
|
|
2085
|
+
params['location_id'] = locationIds.join(',');
|
|
2086
|
+
}
|
|
2087
|
+
if (teamIds && teamIds.length) {
|
|
2088
|
+
params['team_id'] = teamIds.join(',');
|
|
2089
|
+
}
|
|
2090
|
+
if (typeof hasOpenSessions === 'boolean') {
|
|
2091
|
+
params['has_open_sessions'] = String(hasOpenSessions);
|
|
2092
|
+
}
|
|
2093
|
+
return this.apiService
|
|
2094
|
+
.getCollection(bookingCalendarSlotFactory, Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOTS_APPLICATION_TIMES_PATH, { clubId }, {
|
|
2095
|
+
params
|
|
2096
|
+
});
|
|
2097
|
+
}
|
|
2098
|
+
getTeamBookingCalendarApplicationTimeSlots(teamId, startDate = null, endDate = null, calendarIds = null, locationIds = null, teamIds = null, hasOpenSessions = null) {
|
|
2099
|
+
const params = { limit: 'null' };
|
|
2100
|
+
if (startDate) {
|
|
2101
|
+
params['day__gte'] = startDate;
|
|
2102
|
+
}
|
|
2103
|
+
if (endDate) {
|
|
2104
|
+
params['day__lte'] = endDate;
|
|
2105
|
+
}
|
|
2106
|
+
if (calendarIds && calendarIds.length) {
|
|
2107
|
+
params['calendar_id'] = calendarIds.join(',');
|
|
2108
|
+
}
|
|
2109
|
+
if (locationIds && locationIds.length) {
|
|
2110
|
+
params['location_id'] = locationIds.join(',');
|
|
2111
|
+
}
|
|
2112
|
+
if (teamIds && teamIds.length) {
|
|
2113
|
+
params['team_id'] = teamIds.join(',');
|
|
2114
|
+
}
|
|
2115
|
+
if (typeof hasOpenSessions === 'boolean') {
|
|
2116
|
+
params['has_open_sessions'] = String(hasOpenSessions);
|
|
2117
|
+
}
|
|
2118
|
+
return this.apiService
|
|
2119
|
+
.getCollection(bookingCalendarSlotFactory, Role.TeamAdmin, TEAM_BOOKING_CALENDAR_SLOTS_APPLICATION_TIMES_PATH, { teamId }, {
|
|
2120
|
+
params
|
|
2121
|
+
});
|
|
2122
|
+
}
|
|
1941
2123
|
copyClubBookingCalendarSlots(clubId, weekRelativeIndexes, onlyCopySlots = false, startDate = null, endDate = null, calendarIds = null, locationIds = null, teamIds = null, hasOpenSessions = null) {
|
|
1942
2124
|
const params = { limit: 'null' };
|
|
1943
2125
|
if (startDate) {
|
|
@@ -2023,6 +2205,12 @@ class BookingCalendarService {
|
|
|
2023
2205
|
}
|
|
2024
2206
|
// endregion
|
|
2025
2207
|
// region Booking calendar slot session
|
|
2208
|
+
createBookingCalendarSlotSession(role, clubOrTeamId, session) {
|
|
2209
|
+
if (role === Role.ClubAdmin) {
|
|
2210
|
+
return this.createClubBookingCalendarSlotSession(clubOrTeamId, session);
|
|
2211
|
+
}
|
|
2212
|
+
return this.createTeamBookingCalendarSlotSession(clubOrTeamId, session);
|
|
2213
|
+
}
|
|
2026
2214
|
createClubBookingCalendarSlotSession(clubId, session) {
|
|
2027
2215
|
delete session.id;
|
|
2028
2216
|
return this.apiService
|
|
@@ -2030,6 +2218,13 @@ class BookingCalendarService {
|
|
|
2030
2218
|
clubId,
|
|
2031
2219
|
}, session);
|
|
2032
2220
|
}
|
|
2221
|
+
createTeamBookingCalendarSlotSession(teamId, session) {
|
|
2222
|
+
delete session.id;
|
|
2223
|
+
return this.apiService
|
|
2224
|
+
.postResource(bookingCalendarSlotSessionFactory, Role.TeamAdmin, TEAM_BOOKING_CALENDAR_SLOT_SESSIONS_PATH, {
|
|
2225
|
+
teamId,
|
|
2226
|
+
}, session);
|
|
2227
|
+
}
|
|
2033
2228
|
getClubBookingCalendarSlotSessions(clubId, startDate = null, endDate = null) {
|
|
2034
2229
|
const params = { limit: 'null' };
|
|
2035
2230
|
if (startDate) {
|
|
@@ -2047,6 +2242,12 @@ class BookingCalendarService {
|
|
|
2047
2242
|
return this.apiService
|
|
2048
2243
|
.getResource(bookingCalendarSlotSessionFactory, Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOT_SESSION_PATH, { clubId, id });
|
|
2049
2244
|
}
|
|
2245
|
+
updateBookingCalendarSlotSession(role, clubOrTeamId, session) {
|
|
2246
|
+
if (role === Role.ClubAdmin) {
|
|
2247
|
+
return this.updateClubBookingCalendarSlotSession(clubOrTeamId, session);
|
|
2248
|
+
}
|
|
2249
|
+
return this.updateTeamBookingCalendarSlotSession(clubOrTeamId, session);
|
|
2250
|
+
}
|
|
2050
2251
|
updateClubBookingCalendarSlotSession(clubId, session) {
|
|
2051
2252
|
return this.apiService
|
|
2052
2253
|
.updateResource(bookingCalendarSlotSessionFactory, Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOT_SESSION_PATH, {
|
|
@@ -2054,6 +2255,19 @@ class BookingCalendarService {
|
|
|
2054
2255
|
id: session.id
|
|
2055
2256
|
}, session);
|
|
2056
2257
|
}
|
|
2258
|
+
updateTeamBookingCalendarSlotSession(teamId, session) {
|
|
2259
|
+
return this.apiService
|
|
2260
|
+
.updateResource(bookingCalendarSlotSessionFactory, Role.TeamAdmin, TEAM_BOOKING_CALENDAR_SLOT_SESSION_PATH, {
|
|
2261
|
+
teamId,
|
|
2262
|
+
id: session.id
|
|
2263
|
+
}, session);
|
|
2264
|
+
}
|
|
2265
|
+
deleteBookingCalendarSlotSession(role, clubOrTeamId, id) {
|
|
2266
|
+
if (role == Role.ClubAdmin) {
|
|
2267
|
+
return this.deleteClubBookingCalendarSlotSession(clubOrTeamId, id);
|
|
2268
|
+
}
|
|
2269
|
+
return this.deleteTeamBookingCalendarSlotSession(clubOrTeamId, id);
|
|
2270
|
+
}
|
|
2057
2271
|
deleteClubBookingCalendarSlotSession(clubId, id) {
|
|
2058
2272
|
return this.apiService
|
|
2059
2273
|
.deleteResource(Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOT_SESSION_PATH, {
|
|
@@ -2061,18 +2275,65 @@ class BookingCalendarService {
|
|
|
2061
2275
|
id
|
|
2062
2276
|
});
|
|
2063
2277
|
}
|
|
2278
|
+
deleteTeamBookingCalendarSlotSession(teamId, id) {
|
|
2279
|
+
return this.apiService
|
|
2280
|
+
.deleteResource(Role.TeamAdmin, TEAM_BOOKING_CALENDAR_SLOT_SESSION_PATH, {
|
|
2281
|
+
teamId,
|
|
2282
|
+
id
|
|
2283
|
+
});
|
|
2284
|
+
}
|
|
2064
2285
|
// endregion
|
|
2065
2286
|
// region Booking Setting
|
|
2287
|
+
getBookingSettings(role, clubOrTeamId) {
|
|
2288
|
+
if (role == Role.ClubAdmin) {
|
|
2289
|
+
return this.getClubBookingSettings(clubOrTeamId);
|
|
2290
|
+
}
|
|
2291
|
+
return this.getTeamBookingSettings(clubOrTeamId);
|
|
2292
|
+
}
|
|
2066
2293
|
getClubBookingSettings(clubId) {
|
|
2067
2294
|
return this.apiService
|
|
2068
2295
|
.getResource(bookingSettingsFactory, Role.ClubAdmin, CLUB_BOOKING_SETTINGS_PATH, { clubId });
|
|
2069
2296
|
}
|
|
2297
|
+
getTeamBookingSettings(teamId) {
|
|
2298
|
+
return this.apiService
|
|
2299
|
+
.getResource(bookingSettingsFactory, Role.TeamAdmin, TEAM_BOOKING_SETTINGS_PATH, { teamId });
|
|
2300
|
+
}
|
|
2070
2301
|
updateClubBookingSettings(clubId, bookingSettings) {
|
|
2071
2302
|
return this.apiService
|
|
2072
2303
|
.updateResource(bookingSettingsFactory, Role.ClubAdmin, CLUB_BOOKING_SETTINGS_PATH, {
|
|
2073
2304
|
clubId,
|
|
2074
2305
|
}, bookingSettings);
|
|
2075
2306
|
}
|
|
2307
|
+
// endregion
|
|
2308
|
+
// region Booking Calendar Application Times
|
|
2309
|
+
updateClubBookingCalendarApplicationTime(clubId, availableTime) {
|
|
2310
|
+
return this.apiService
|
|
2311
|
+
.updateResource(bookingCalendarApplicationTimeFactory, Role.ClubAdmin, CLUB_BOOKING_CALENDAR_APPLICATION_TIME_PATH, {
|
|
2312
|
+
clubId,
|
|
2313
|
+
id: availableTime.id
|
|
2314
|
+
}, availableTime);
|
|
2315
|
+
}
|
|
2316
|
+
createTeamBookingCalendarApplicationTime(teamId, availableTime) {
|
|
2317
|
+
delete availableTime.id;
|
|
2318
|
+
return this.apiService
|
|
2319
|
+
.postResource(bookingCalendarApplicationTimeFactory, Role.TeamAdmin, TEAM_BOOKING_CALENDAR_APPLICATION_TIMES_PATH, {
|
|
2320
|
+
teamId,
|
|
2321
|
+
}, availableTime);
|
|
2322
|
+
}
|
|
2323
|
+
updateTeamBookingCalendarApplicationTime(teamId, availableTime) {
|
|
2324
|
+
return this.apiService
|
|
2325
|
+
.updateResource(bookingCalendarApplicationTimeFactory, Role.TeamAdmin, TEAM_BOOKING_CALENDAR_APPLICATION_TIME_PATH, {
|
|
2326
|
+
teamId,
|
|
2327
|
+
id: availableTime.id
|
|
2328
|
+
}, availableTime);
|
|
2329
|
+
}
|
|
2330
|
+
deleteTeamBookingCalendarApplicationTime(teamId, id) {
|
|
2331
|
+
return this.apiService
|
|
2332
|
+
.deleteResource(Role.TeamAdmin, TEAM_BOOKING_CALENDAR_APPLICATION_TIME_PATH, {
|
|
2333
|
+
teamId,
|
|
2334
|
+
id
|
|
2335
|
+
});
|
|
2336
|
+
}
|
|
2076
2337
|
}
|
|
2077
2338
|
BookingCalendarService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: BookingCalendarService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2078
2339
|
BookingCalendarService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: BookingCalendarService, providedIn: 'root' });
|
|
@@ -3132,5 +3393,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImpo
|
|
|
3132
3393
|
* Generated bundle index. Do not edit.
|
|
3133
3394
|
*/
|
|
3134
3395
|
|
|
3135
|
-
export { APP, Activity, ActivityExtraMember, ActivityInvite, ActivityLocation, ActivityLocationGroup, ActivityService, ActivitySettings, ActivityType, Auth, AuthMember, AuthSection, AuthService, AuthTeam, AuthTeamSection, AuthenticatedGuard, Authentication, AuthenticationInterceptor, AuthenticationService, BookingCalendar, BookingCalendarService, BookingCalendarSlot, BookingCalendarSlotSession, BookingSettings, 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, Member, MemberActivityInvite, MemberAttribute, MemberCard, MemberCardService, MemberContact, MemberFee, MemberFunction, MemberInvoice, MemberInvoiceRow, MemberPublicForm, MemberPublicFormField, MemberPublicFormFieldOption, MemberPublicFormService, MemberService, MemberTeam, MemberTeamThrough, MemberType, MemberValidationSettings, News, NewsService, Partner, PaymentAttempt, PaymentAttemptService, Role, SearchClub, SearchMember, SearchMemberCard, SearchMemberInvoice, SearchTeam, Section, SectionService, Swish, SwishQrCode, TeamService, Token, TokenService, USER_NOTIFICATIONS_PATH, UnpaidMemberInvoice, User, UserNotification, UserNotificationService, UserService, Zimpler };
|
|
3396
|
+
export { APP, Activity, ActivityExtraMember, ActivityInvite, ActivityLocation, ActivityLocationGroup, ActivityService, ActivitySettings, ActivityType, Auth, AuthMember, AuthSection, AuthService, AuthTeam, AuthTeamSection, AuthenticatedGuard, Authentication, AuthenticationInterceptor, AuthenticationService, BookingCalendar, BookingCalendarApplicationTime, BookingCalendarService, BookingCalendarSlot, BookingCalendarSlotSession, BookingSettings, 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, Member, MemberActivityInvite, MemberAttribute, MemberCard, MemberCardService, MemberContact, MemberFee, MemberFunction, MemberInvoice, MemberInvoiceRow, MemberPublicForm, MemberPublicFormField, MemberPublicFormFieldOption, MemberPublicFormService, MemberService, MemberTeam, MemberTeamThrough, MemberType, MemberValidationSettings, News, NewsService, Partner, PaymentAttempt, PaymentAttemptService, Role, SearchClub, SearchMember, SearchMemberCard, SearchMemberInvoice, SearchTeam, Section, SectionService, Swish, SwishQrCode, TeamService, Token, TokenService, USER_NOTIFICATIONS_PATH, UnpaidMemberInvoice, User, UserNotification, UserNotificationService, UserService, Zimpler };
|
|
3136
3397
|
//# sourceMappingURL=myclub_se-data-access.mjs.map
|