@myclub_se/data-access 2.7.0 → 2.7.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.
- package/esm2020/lib/api-models/api-booking-settings.mjs +1 -1
- package/esm2020/lib/models/booking-settings.mjs +4 -2
- package/esm2020/lib/services/booking-calendar.service.mjs +85 -309
- package/esm2020/lib/services/factories/booking-settings-factory.mjs +2 -2
- package/fesm2015/myclub_se-data-access.mjs +89 -311
- package/fesm2015/myclub_se-data-access.mjs.map +1 -1
- package/fesm2020/myclub_se-data-access.mjs +89 -311
- package/fesm2020/myclub_se-data-access.mjs.map +1 -1
- package/lib/api-models/api-booking-settings.d.ts +1 -0
- package/lib/models/booking-settings.d.ts +3 -1
- package/lib/services/booking-calendar.service.d.ts +17 -5
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { BookingSettings } from "../../models";
|
|
2
|
-
export const bookingSettingsFactory = (apiBookingSettings) => new BookingSettings(apiBookingSettings.id, apiBookingSettings.calendar_step, apiBookingSettings.calendar_min_time, apiBookingSettings.calendar_max_time, apiBookingSettings.should_split_booking_into_zones);
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
2
|
+
export 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);
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYm9va2luZy1zZXR0aW5ncy1mYWN0b3J5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvZGF0YS1hY2Nlc3Mvc3JjL2xpYi9zZXJ2aWNlcy9mYWN0b3JpZXMvYm9va2luZy1zZXR0aW5ncy1mYWN0b3J5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBQyxlQUFlLEVBQUMsTUFBTSxjQUFjLENBQUM7QUFFN0MsTUFBTSxDQUFDLE1BQU0sc0JBQXNCLEdBQUcsQ0FBQyxrQkFBc0MsRUFBRSxFQUFFLENBQy9FLElBQUksZUFBZSxDQUNqQixrQkFBa0IsQ0FBQyxFQUFFLEVBQ3JCLGtCQUFrQixDQUFDLGFBQWEsRUFDaEMsa0JBQWtCLENBQUMsaUJBQWlCLEVBQ3BDLGtCQUFrQixDQUFDLGlCQUFpQixFQUNwQyxrQkFBa0IsQ0FBQyx5QkFBeUIsRUFDNUMsa0JBQWtCLENBQUMsK0JBQStCLENBQ25ELENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQge0FwaUJvb2tpbmdTZXR0aW5nc30gZnJvbSBcIi4uLy4uL2FwaS1tb2RlbHNcIjtcbmltcG9ydCB7Qm9va2luZ1NldHRpbmdzfSBmcm9tIFwiLi4vLi4vbW9kZWxzXCI7XG5cbmV4cG9ydCBjb25zdCBib29raW5nU2V0dGluZ3NGYWN0b3J5ID0gKGFwaUJvb2tpbmdTZXR0aW5nczogQXBpQm9va2luZ1NldHRpbmdzKSA9PlxuICBuZXcgQm9va2luZ1NldHRpbmdzKFxuICAgIGFwaUJvb2tpbmdTZXR0aW5ncy5pZCxcbiAgICBhcGlCb29raW5nU2V0dGluZ3MuY2FsZW5kYXJfc3RlcCxcbiAgICBhcGlCb29raW5nU2V0dGluZ3MuY2FsZW5kYXJfbWluX3RpbWUsXG4gICAgYXBpQm9va2luZ1NldHRpbmdzLmNhbGVuZGFyX21heF90aW1lLFxuICAgIGFwaUJvb2tpbmdTZXR0aW5ncy5jYWxlbmRhcl9zZXNzaW9uX2R1cmF0aW9uLFxuICAgIGFwaUJvb2tpbmdTZXR0aW5ncy5zaG91bGRfc3BsaXRfYm9va2luZ19pbnRvX3pvbmVzLFxuICApO1xuIl19
|
|
@@ -447,11 +447,12 @@ class BookingCalendarSlotSession {
|
|
|
447
447
|
}
|
|
448
448
|
|
|
449
449
|
class BookingSettings {
|
|
450
|
-
constructor(id, calendar_step, calendar_min_time, calendar_max_time, should_split_booking_into_zones) {
|
|
450
|
+
constructor(id, calendar_step, calendar_min_time, calendar_max_time, calendar_session_duration, should_split_booking_into_zones) {
|
|
451
451
|
this.id = id;
|
|
452
452
|
this.calendar_step = calendar_step;
|
|
453
453
|
this.calendar_min_time = calendar_min_time;
|
|
454
454
|
this.calendar_max_time = calendar_max_time;
|
|
455
|
+
this.calendar_session_duration = calendar_session_duration;
|
|
455
456
|
this.should_split_booking_into_zones = should_split_booking_into_zones;
|
|
456
457
|
}
|
|
457
458
|
static asFormGroup(settings) {
|
|
@@ -460,6 +461,7 @@ class BookingSettings {
|
|
|
460
461
|
calendar_step: new FormControl((settings === null || settings === void 0 ? void 0 : settings.calendar_step) || '01:00:00', [Validators.required]),
|
|
461
462
|
calendar_min_time: new FormControl((settings === null || settings === void 0 ? void 0 : settings.calendar_min_time) || '00:00:00', [Validators.required]),
|
|
462
463
|
calendar_max_time: new FormControl((settings === null || settings === void 0 ? void 0 : settings.calendar_max_time) || '23:00:00', [Validators.required]),
|
|
464
|
+
calendar_session_duration: new FormControl((settings === null || settings === void 0 ? void 0 : settings.calendar_session_duration) || '01:00:00', [Validators.required]),
|
|
463
465
|
should_split_booking_into_zones: new FormControl(typeof (settings === null || settings === void 0 ? void 0 : settings.should_split_booking_into_zones) !== 'undefined' ? settings === null || settings === void 0 ? void 0 : settings.should_split_booking_into_zones : true, [Validators.required]),
|
|
464
466
|
});
|
|
465
467
|
}
|
|
@@ -1592,7 +1594,7 @@ const bookingCalendarSlotSessionFactory = (apiBookingSlotSession) => new Booking
|
|
|
1592
1594
|
|
|
1593
1595
|
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', 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)) : [], apiBookingSlot.last_repeating_date);
|
|
1594
1596
|
|
|
1595
|
-
const bookingSettingsFactory = (apiBookingSettings) => new BookingSettings(apiBookingSettings.id, apiBookingSettings.calendar_step, apiBookingSettings.calendar_min_time, apiBookingSettings.calendar_max_time, apiBookingSettings.should_split_booking_into_zones);
|
|
1597
|
+
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);
|
|
1596
1598
|
|
|
1597
1599
|
const imageUrlsFactory = (apiImageUrls) => new ImageUrls(apiImageUrls.lg, apiImageUrls.md, apiImageUrls.raw, apiImageUrls.sm, apiImageUrls.xs);
|
|
1598
1600
|
|
|
@@ -2238,6 +2240,46 @@ const TEAM_BOOKING_CALENDAR_SLOT_SESSIONS_PATH = ':teamId/activities/sessions/';
|
|
|
2238
2240
|
const TEAM_BOOKING_CALENDAR_SLOT_SESSION_PATH = ':teamId/activities/sessions/:id/';
|
|
2239
2241
|
const TEAM_BOOKING_CALENDAR_APPLICATION_TIMES_PATH = ':teamId/activities/application-times/';
|
|
2240
2242
|
const TEAM_BOOKING_CALENDAR_APPLICATION_TIME_PATH = ':teamId/activities/application-times/:id/';
|
|
2243
|
+
class BookingSlotFilter {
|
|
2244
|
+
constructor(startDate = null, endDate = null, calendarIds = null, locationIds = null, tagIds = null, teamIds = null, locationGroupIds = null, hasOpenSessions = null) {
|
|
2245
|
+
this.startDate = startDate;
|
|
2246
|
+
this.endDate = endDate;
|
|
2247
|
+
this.calendarIds = calendarIds;
|
|
2248
|
+
this.locationIds = locationIds;
|
|
2249
|
+
this.tagIds = tagIds;
|
|
2250
|
+
this.teamIds = teamIds;
|
|
2251
|
+
this.locationGroupIds = locationGroupIds;
|
|
2252
|
+
this.hasOpenSessions = hasOpenSessions;
|
|
2253
|
+
}
|
|
2254
|
+
toParams() {
|
|
2255
|
+
const params = { limit: 'null' };
|
|
2256
|
+
if (this.startDate) {
|
|
2257
|
+
params['day__gte'] = this.startDate;
|
|
2258
|
+
}
|
|
2259
|
+
if (this.endDate) {
|
|
2260
|
+
params['day__lte'] = this.endDate;
|
|
2261
|
+
}
|
|
2262
|
+
if (this.calendarIds && this.calendarIds.length) {
|
|
2263
|
+
params['calendar_id'] = this.calendarIds.join(',');
|
|
2264
|
+
}
|
|
2265
|
+
if (this.locationIds && this.locationIds.length) {
|
|
2266
|
+
params['location_id'] = this.locationIds.join(',');
|
|
2267
|
+
}
|
|
2268
|
+
if (this.locationGroupIds && this.locationGroupIds.length) {
|
|
2269
|
+
params['location_group_id'] = this.locationGroupIds.join(',');
|
|
2270
|
+
}
|
|
2271
|
+
if (this.tagIds && this.tagIds.length) {
|
|
2272
|
+
params['tag_id'] = this.tagIds.join(',');
|
|
2273
|
+
}
|
|
2274
|
+
if (this.teamIds && this.teamIds.length) {
|
|
2275
|
+
params['team_id'] = this.teamIds.join(',');
|
|
2276
|
+
}
|
|
2277
|
+
if (typeof this.hasOpenSessions === 'boolean') {
|
|
2278
|
+
params['has_open_sessions'] = String(this.hasOpenSessions);
|
|
2279
|
+
}
|
|
2280
|
+
return params;
|
|
2281
|
+
}
|
|
2282
|
+
}
|
|
2241
2283
|
class BookingCalendarService {
|
|
2242
2284
|
constructor(apiService) {
|
|
2243
2285
|
this.apiService = apiService;
|
|
@@ -2364,221 +2406,74 @@ class BookingCalendarService {
|
|
|
2364
2406
|
sectionId,
|
|
2365
2407
|
}, slot);
|
|
2366
2408
|
}
|
|
2367
|
-
getBookingCalendarSlots(role, clubOrSectionOrTeamId,
|
|
2409
|
+
getBookingCalendarSlots(role, clubOrSectionOrTeamId, bookingSlotFilter) {
|
|
2368
2410
|
if (role == Role.ClubAdmin) {
|
|
2369
|
-
return this.getClubBookingCalendarSlots(clubOrSectionOrTeamId,
|
|
2411
|
+
return this.getClubBookingCalendarSlots(clubOrSectionOrTeamId, bookingSlotFilter);
|
|
2370
2412
|
}
|
|
2371
2413
|
else if (role == Role.SectionAdmin) {
|
|
2372
|
-
return this.getSectionBookingCalendarSlots(clubOrSectionOrTeamId,
|
|
2414
|
+
return this.getSectionBookingCalendarSlots(clubOrSectionOrTeamId, bookingSlotFilter);
|
|
2373
2415
|
}
|
|
2374
|
-
return this.getTeamBookingCalendarSlots(clubOrSectionOrTeamId,
|
|
2416
|
+
return this.getTeamBookingCalendarSlots(clubOrSectionOrTeamId, bookingSlotFilter);
|
|
2375
2417
|
}
|
|
2376
|
-
getClubBookingCalendarSlots(clubId,
|
|
2377
|
-
const params =
|
|
2378
|
-
if (startDate) {
|
|
2379
|
-
params['day__gte'] = startDate;
|
|
2380
|
-
}
|
|
2381
|
-
if (endDate) {
|
|
2382
|
-
params['day__lte'] = endDate;
|
|
2383
|
-
}
|
|
2384
|
-
if (calendarIds && calendarIds.length) {
|
|
2385
|
-
params['calendar_id'] = calendarIds.join(',');
|
|
2386
|
-
}
|
|
2387
|
-
if (locationIds && locationIds.length) {
|
|
2388
|
-
params['location_id'] = locationIds.join(',');
|
|
2389
|
-
}
|
|
2390
|
-
if (tagIds && tagIds.length) {
|
|
2391
|
-
params['tag_id'] = tagIds.join(',');
|
|
2392
|
-
}
|
|
2393
|
-
if (teamIds && teamIds.length) {
|
|
2394
|
-
params['team_id'] = teamIds.join(',');
|
|
2395
|
-
}
|
|
2396
|
-
if (typeof hasOpenSessions === 'boolean') {
|
|
2397
|
-
params['has_open_sessions'] = String(hasOpenSessions);
|
|
2398
|
-
}
|
|
2418
|
+
getClubBookingCalendarSlots(clubId, bookingSlotFilter) {
|
|
2419
|
+
const params = bookingSlotFilter.toParams();
|
|
2399
2420
|
return this.apiService
|
|
2400
2421
|
.getCollection(bookingCalendarSlotFactory, Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOTS_PATH, { clubId }, {
|
|
2401
2422
|
params
|
|
2402
2423
|
});
|
|
2403
2424
|
}
|
|
2404
|
-
getSectionBookingCalendarSlots(sectionId,
|
|
2405
|
-
const params =
|
|
2406
|
-
if (startDate) {
|
|
2407
|
-
params['day__gte'] = startDate;
|
|
2408
|
-
}
|
|
2409
|
-
if (endDate) {
|
|
2410
|
-
params['day__lte'] = endDate;
|
|
2411
|
-
}
|
|
2412
|
-
if (calendarIds && calendarIds.length) {
|
|
2413
|
-
params['calendar_id'] = calendarIds.join(',');
|
|
2414
|
-
}
|
|
2415
|
-
if (locationIds && locationIds.length) {
|
|
2416
|
-
params['location_id'] = locationIds.join(',');
|
|
2417
|
-
}
|
|
2418
|
-
if (tagIds && tagIds.length) {
|
|
2419
|
-
params['tag_id'] = tagIds.join(',');
|
|
2420
|
-
}
|
|
2421
|
-
if (teamIds && teamIds.length) {
|
|
2422
|
-
params['team_id'] = teamIds.join(',');
|
|
2423
|
-
}
|
|
2424
|
-
if (typeof hasOpenSessions === 'boolean') {
|
|
2425
|
-
params['has_open_sessions'] = String(hasOpenSessions);
|
|
2426
|
-
}
|
|
2425
|
+
getSectionBookingCalendarSlots(sectionId, bookingSlotFilter) {
|
|
2426
|
+
const params = bookingSlotFilter.toParams();
|
|
2427
2427
|
return this.apiService
|
|
2428
2428
|
.getCollection(bookingCalendarSlotFactory, Role.SectionAdmin, SECTION_BOOKING_CALENDAR_SLOTS_PATH, { sectionId }, {
|
|
2429
2429
|
params
|
|
2430
2430
|
});
|
|
2431
2431
|
}
|
|
2432
|
-
getTeamBookingCalendarSlots(teamId,
|
|
2433
|
-
const params =
|
|
2434
|
-
if (startDate) {
|
|
2435
|
-
params['day__gte'] = startDate;
|
|
2436
|
-
}
|
|
2437
|
-
if (endDate) {
|
|
2438
|
-
params['day__lte'] = endDate;
|
|
2439
|
-
}
|
|
2440
|
-
if (calendarIds && calendarIds.length) {
|
|
2441
|
-
params['calendar_id'] = calendarIds.join(',');
|
|
2442
|
-
}
|
|
2443
|
-
if (locationIds && locationIds.length) {
|
|
2444
|
-
params['location_id'] = locationIds.join(',');
|
|
2445
|
-
}
|
|
2446
|
-
if (tagIds && tagIds.length) {
|
|
2447
|
-
params['tag_id'] = tagIds.join(',');
|
|
2448
|
-
}
|
|
2449
|
-
if (teamIds && teamIds.length) {
|
|
2450
|
-
params['team_id'] = teamIds.join(',');
|
|
2451
|
-
}
|
|
2452
|
-
if (typeof hasOpenSessions === 'boolean') {
|
|
2453
|
-
params['has_open_sessions'] = String(hasOpenSessions);
|
|
2454
|
-
}
|
|
2432
|
+
getTeamBookingCalendarSlots(teamId, bookingSlotFilter) {
|
|
2433
|
+
const params = bookingSlotFilter.toParams();
|
|
2455
2434
|
return this.apiService
|
|
2456
2435
|
.getCollection(bookingCalendarSlotFactory, Role.TeamAdmin, TEAM_BOOKING_CALENDAR_SLOTS_PATH, { teamId }, {
|
|
2457
2436
|
params
|
|
2458
2437
|
});
|
|
2459
2438
|
}
|
|
2460
|
-
getBookingCalendarApplicationTimeSlots(role, clubOrSectionOrTeamId,
|
|
2439
|
+
getBookingCalendarApplicationTimeSlots(role, clubOrSectionOrTeamId, bookingSlotFilter) {
|
|
2461
2440
|
if (role == Role.ClubAdmin) {
|
|
2462
|
-
return this.getClubBookingCalendarApplicationTimeSlots(clubOrSectionOrTeamId,
|
|
2441
|
+
return this.getClubBookingCalendarApplicationTimeSlots(clubOrSectionOrTeamId, bookingSlotFilter);
|
|
2463
2442
|
}
|
|
2464
2443
|
else if (role == Role.SectionAdmin) {
|
|
2465
|
-
return this.getSectionBookingCalendarApplicationTimeSlots(clubOrSectionOrTeamId,
|
|
2444
|
+
return this.getSectionBookingCalendarApplicationTimeSlots(clubOrSectionOrTeamId, bookingSlotFilter);
|
|
2466
2445
|
}
|
|
2467
|
-
return this.getTeamBookingCalendarApplicationTimeSlots(clubOrSectionOrTeamId,
|
|
2446
|
+
return this.getTeamBookingCalendarApplicationTimeSlots(clubOrSectionOrTeamId, bookingSlotFilter);
|
|
2468
2447
|
}
|
|
2469
|
-
getClubBookingCalendarApplicationTimeSlots(clubId,
|
|
2470
|
-
const params =
|
|
2471
|
-
if (startDate) {
|
|
2472
|
-
params['day__gte'] = startDate;
|
|
2473
|
-
}
|
|
2474
|
-
if (endDate) {
|
|
2475
|
-
params['day__lte'] = endDate;
|
|
2476
|
-
}
|
|
2477
|
-
if (calendarIds && calendarIds.length) {
|
|
2478
|
-
params['calendar_id'] = calendarIds.join(',');
|
|
2479
|
-
}
|
|
2480
|
-
if (locationIds && locationIds.length) {
|
|
2481
|
-
params['location_id'] = locationIds.join(',');
|
|
2482
|
-
}
|
|
2483
|
-
if (tagIds && tagIds.length) {
|
|
2484
|
-
params['tag_id'] = tagIds.join(',');
|
|
2485
|
-
}
|
|
2486
|
-
if (teamIds && teamIds.length) {
|
|
2487
|
-
params['team_id'] = teamIds.join(',');
|
|
2488
|
-
}
|
|
2489
|
-
if (typeof hasOpenSessions === 'boolean') {
|
|
2490
|
-
params['has_open_sessions'] = String(hasOpenSessions);
|
|
2491
|
-
}
|
|
2448
|
+
getClubBookingCalendarApplicationTimeSlots(clubId, bookingSlotFilter) {
|
|
2449
|
+
const params = bookingSlotFilter.toParams();
|
|
2492
2450
|
return this.apiService
|
|
2493
2451
|
.getCollection(bookingCalendarSlotFactory, Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOTS_APPLICATION_TIMES_PATH, { clubId }, {
|
|
2494
2452
|
params
|
|
2495
2453
|
});
|
|
2496
2454
|
}
|
|
2497
|
-
getSectionBookingCalendarApplicationTimeSlots(sectionId,
|
|
2498
|
-
const params =
|
|
2499
|
-
if (startDate) {
|
|
2500
|
-
params['day__gte'] = startDate;
|
|
2501
|
-
}
|
|
2502
|
-
if (endDate) {
|
|
2503
|
-
params['day__lte'] = endDate;
|
|
2504
|
-
}
|
|
2505
|
-
if (calendarIds && calendarIds.length) {
|
|
2506
|
-
params['calendar_id'] = calendarIds.join(',');
|
|
2507
|
-
}
|
|
2508
|
-
if (locationIds && locationIds.length) {
|
|
2509
|
-
params['location_id'] = locationIds.join(',');
|
|
2510
|
-
}
|
|
2511
|
-
if (tagIds && tagIds.length) {
|
|
2512
|
-
params['tag_id'] = tagIds.join(',');
|
|
2513
|
-
}
|
|
2514
|
-
if (teamIds && teamIds.length) {
|
|
2515
|
-
params['team_id'] = teamIds.join(',');
|
|
2516
|
-
}
|
|
2517
|
-
if (typeof hasOpenSessions === 'boolean') {
|
|
2518
|
-
params['has_open_sessions'] = String(hasOpenSessions);
|
|
2519
|
-
}
|
|
2455
|
+
getSectionBookingCalendarApplicationTimeSlots(sectionId, bookingSlotFilter) {
|
|
2456
|
+
const params = bookingSlotFilter.toParams();
|
|
2520
2457
|
return this.apiService
|
|
2521
2458
|
.getCollection(bookingCalendarSlotFactory, Role.SectionAdmin, SECTION_BOOKING_CALENDAR_SLOTS_APPLICATION_TIMES_PATH, { sectionId }, {
|
|
2522
2459
|
params
|
|
2523
2460
|
});
|
|
2524
2461
|
}
|
|
2525
|
-
getTeamBookingCalendarApplicationTimeSlots(teamId,
|
|
2526
|
-
const params =
|
|
2527
|
-
if (startDate) {
|
|
2528
|
-
params['day__gte'] = startDate;
|
|
2529
|
-
}
|
|
2530
|
-
if (endDate) {
|
|
2531
|
-
params['day__lte'] = endDate;
|
|
2532
|
-
}
|
|
2533
|
-
if (calendarIds && calendarIds.length) {
|
|
2534
|
-
params['calendar_id'] = calendarIds.join(',');
|
|
2535
|
-
}
|
|
2536
|
-
if (locationIds && locationIds.length) {
|
|
2537
|
-
params['location_id'] = locationIds.join(',');
|
|
2538
|
-
}
|
|
2539
|
-
if (tagIds && tagIds.length) {
|
|
2540
|
-
params['tag_id'] = tagIds.join(',');
|
|
2541
|
-
}
|
|
2542
|
-
if (teamIds && teamIds.length) {
|
|
2543
|
-
params['team_id'] = teamIds.join(',');
|
|
2544
|
-
}
|
|
2545
|
-
if (typeof hasOpenSessions === 'boolean') {
|
|
2546
|
-
params['has_open_sessions'] = String(hasOpenSessions);
|
|
2547
|
-
}
|
|
2462
|
+
getTeamBookingCalendarApplicationTimeSlots(teamId, bookingSlotFilter) {
|
|
2463
|
+
const params = bookingSlotFilter.toParams();
|
|
2548
2464
|
return this.apiService
|
|
2549
2465
|
.getCollection(bookingCalendarSlotFactory, Role.TeamAdmin, TEAM_BOOKING_CALENDAR_SLOTS_APPLICATION_TIMES_PATH, { teamId }, {
|
|
2550
2466
|
params
|
|
2551
2467
|
});
|
|
2552
2468
|
}
|
|
2553
|
-
copyBookingCalendarSlots(role, clubOrSectionOrTeamId, weekRelativeIndexes, onlyCopySlots = false,
|
|
2469
|
+
copyBookingCalendarSlots(role, clubOrSectionOrTeamId, weekRelativeIndexes, onlyCopySlots = false, bookingSlotFilter) {
|
|
2554
2470
|
if (role === Role.ClubAdmin) {
|
|
2555
|
-
return this.copyClubBookingCalendarSlots(clubOrSectionOrTeamId, weekRelativeIndexes, onlyCopySlots,
|
|
2471
|
+
return this.copyClubBookingCalendarSlots(clubOrSectionOrTeamId, weekRelativeIndexes, onlyCopySlots, bookingSlotFilter);
|
|
2556
2472
|
}
|
|
2557
|
-
return this.copySectionBookingCalendarSlots(clubOrSectionOrTeamId, weekRelativeIndexes, onlyCopySlots,
|
|
2473
|
+
return this.copySectionBookingCalendarSlots(clubOrSectionOrTeamId, weekRelativeIndexes, onlyCopySlots, bookingSlotFilter);
|
|
2558
2474
|
}
|
|
2559
|
-
copyClubBookingCalendarSlots(clubId, weekRelativeIndexes, onlyCopySlots = false,
|
|
2560
|
-
const params =
|
|
2561
|
-
if (startDate) {
|
|
2562
|
-
params['day__gte'] = startDate;
|
|
2563
|
-
}
|
|
2564
|
-
if (endDate) {
|
|
2565
|
-
params['day__lte'] = endDate;
|
|
2566
|
-
}
|
|
2567
|
-
if (calendarIds && calendarIds.length) {
|
|
2568
|
-
params['calendar_id'] = calendarIds.join(',');
|
|
2569
|
-
}
|
|
2570
|
-
if (locationIds && locationIds.length) {
|
|
2571
|
-
params['location_id'] = locationIds.join(',');
|
|
2572
|
-
}
|
|
2573
|
-
if (tagIds && tagIds.length) {
|
|
2574
|
-
params['tag_id'] = tagIds.join(',');
|
|
2575
|
-
}
|
|
2576
|
-
if (teamIds && teamIds.length) {
|
|
2577
|
-
params['team_id'] = teamIds.join(',');
|
|
2578
|
-
}
|
|
2579
|
-
if (typeof hasOpenSessions === 'boolean') {
|
|
2580
|
-
params['has_open_sessions'] = String(hasOpenSessions);
|
|
2581
|
-
}
|
|
2475
|
+
copyClubBookingCalendarSlots(clubId, weekRelativeIndexes, onlyCopySlots = false, bookingSlotFilter) {
|
|
2476
|
+
const params = bookingSlotFilter.toParams();
|
|
2582
2477
|
return this.apiService
|
|
2583
2478
|
.postResourceNoResponse(Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOTS_COPY_PATH, { clubId }, {
|
|
2584
2479
|
week_relative_indexes: weekRelativeIndexes,
|
|
@@ -2587,29 +2482,8 @@ class BookingCalendarService {
|
|
|
2587
2482
|
params
|
|
2588
2483
|
});
|
|
2589
2484
|
}
|
|
2590
|
-
copySectionBookingCalendarSlots(sectionId, weekRelativeIndexes, onlyCopySlots = false,
|
|
2591
|
-
const params =
|
|
2592
|
-
if (startDate) {
|
|
2593
|
-
params['day__gte'] = startDate;
|
|
2594
|
-
}
|
|
2595
|
-
if (endDate) {
|
|
2596
|
-
params['day__lte'] = endDate;
|
|
2597
|
-
}
|
|
2598
|
-
if (calendarIds && calendarIds.length) {
|
|
2599
|
-
params['calendar_id'] = calendarIds.join(',');
|
|
2600
|
-
}
|
|
2601
|
-
if (locationIds && locationIds.length) {
|
|
2602
|
-
params['location_id'] = locationIds.join(',');
|
|
2603
|
-
}
|
|
2604
|
-
if (tagIds && tagIds.length) {
|
|
2605
|
-
params['tag_id'] = tagIds.join(',');
|
|
2606
|
-
}
|
|
2607
|
-
if (teamIds && teamIds.length) {
|
|
2608
|
-
params['team_id'] = teamIds.join(',');
|
|
2609
|
-
}
|
|
2610
|
-
if (typeof hasOpenSessions === 'boolean') {
|
|
2611
|
-
params['has_open_sessions'] = String(hasOpenSessions);
|
|
2612
|
-
}
|
|
2485
|
+
copySectionBookingCalendarSlots(sectionId, weekRelativeIndexes, onlyCopySlots = false, bookingSlotFilter) {
|
|
2486
|
+
const params = bookingSlotFilter.toParams();
|
|
2613
2487
|
return this.apiService
|
|
2614
2488
|
.postResourceNoResponse(Role.SectionAdmin, SECTION_BOOKING_CALENDAR_SLOTS_COPY_PATH, { sectionId }, {
|
|
2615
2489
|
week_relative_indexes: weekRelativeIndexes,
|
|
@@ -2618,35 +2492,14 @@ class BookingCalendarService {
|
|
|
2618
2492
|
params
|
|
2619
2493
|
});
|
|
2620
2494
|
}
|
|
2621
|
-
clearBookingCalendarSlots(role, clubOrSectionOrTeamId, currentWeekStartDate, weekRelativeIndexes, onlyDeleteSessions = false,
|
|
2495
|
+
clearBookingCalendarSlots(role, clubOrSectionOrTeamId, currentWeekStartDate, weekRelativeIndexes, onlyDeleteSessions = false, bookingSlotFilter) {
|
|
2622
2496
|
if (role === Role.ClubAdmin) {
|
|
2623
|
-
return this.clearClubBookingCalendarSlots(clubOrSectionOrTeamId, currentWeekStartDate, weekRelativeIndexes, onlyDeleteSessions,
|
|
2497
|
+
return this.clearClubBookingCalendarSlots(clubOrSectionOrTeamId, currentWeekStartDate, weekRelativeIndexes, onlyDeleteSessions, bookingSlotFilter);
|
|
2624
2498
|
}
|
|
2625
|
-
return this.clearSectionBookingCalendarSlots(clubOrSectionOrTeamId, currentWeekStartDate, weekRelativeIndexes, onlyDeleteSessions,
|
|
2499
|
+
return this.clearSectionBookingCalendarSlots(clubOrSectionOrTeamId, currentWeekStartDate, weekRelativeIndexes, onlyDeleteSessions, bookingSlotFilter);
|
|
2626
2500
|
}
|
|
2627
|
-
clearClubBookingCalendarSlots(clubId, currentWeekStartDate, weekRelativeIndexes, onlyDeleteSessions = false,
|
|
2628
|
-
const params =
|
|
2629
|
-
if (startDate) {
|
|
2630
|
-
params['day__gte'] = startDate;
|
|
2631
|
-
}
|
|
2632
|
-
if (endDate) {
|
|
2633
|
-
params['day__lte'] = endDate;
|
|
2634
|
-
}
|
|
2635
|
-
if (calendarIds && calendarIds.length) {
|
|
2636
|
-
params['calendar_id'] = calendarIds.join(',');
|
|
2637
|
-
}
|
|
2638
|
-
if (locationIds && locationIds.length) {
|
|
2639
|
-
params['location_id'] = locationIds.join(',');
|
|
2640
|
-
}
|
|
2641
|
-
if (tagIds && tagIds.length) {
|
|
2642
|
-
params['tag_id'] = tagIds.join(',');
|
|
2643
|
-
}
|
|
2644
|
-
if (teamIds && teamIds.length) {
|
|
2645
|
-
params['team_id'] = teamIds.join(',');
|
|
2646
|
-
}
|
|
2647
|
-
if (typeof hasOpenSessions === 'boolean') {
|
|
2648
|
-
params['has_open_sessions'] = String(hasOpenSessions);
|
|
2649
|
-
}
|
|
2501
|
+
clearClubBookingCalendarSlots(clubId, currentWeekStartDate, weekRelativeIndexes, onlyDeleteSessions = false, bookingSlotFilter) {
|
|
2502
|
+
const params = bookingSlotFilter.toParams();
|
|
2650
2503
|
return this.apiService
|
|
2651
2504
|
.deleteResourceWithBody(Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOTS_CLEAR_PATH, { clubId }, {
|
|
2652
2505
|
body: {
|
|
@@ -2657,29 +2510,8 @@ class BookingCalendarService {
|
|
|
2657
2510
|
params,
|
|
2658
2511
|
});
|
|
2659
2512
|
}
|
|
2660
|
-
clearSectionBookingCalendarSlots(sectionId, currentWeekStartDate, weekRelativeIndexes, onlyDeleteSessions = false,
|
|
2661
|
-
const params =
|
|
2662
|
-
if (startDate) {
|
|
2663
|
-
params['day__gte'] = startDate;
|
|
2664
|
-
}
|
|
2665
|
-
if (endDate) {
|
|
2666
|
-
params['day__lte'] = endDate;
|
|
2667
|
-
}
|
|
2668
|
-
if (calendarIds && calendarIds.length) {
|
|
2669
|
-
params['calendar_id'] = calendarIds.join(',');
|
|
2670
|
-
}
|
|
2671
|
-
if (locationIds && locationIds.length) {
|
|
2672
|
-
params['location_id'] = locationIds.join(',');
|
|
2673
|
-
}
|
|
2674
|
-
if (tagIds && tagIds.length) {
|
|
2675
|
-
params['tag_id'] = tagIds.join(',');
|
|
2676
|
-
}
|
|
2677
|
-
if (teamIds && teamIds.length) {
|
|
2678
|
-
params['team_id'] = teamIds.join(',');
|
|
2679
|
-
}
|
|
2680
|
-
if (typeof hasOpenSessions === 'boolean') {
|
|
2681
|
-
params['has_open_sessions'] = String(hasOpenSessions);
|
|
2682
|
-
}
|
|
2513
|
+
clearSectionBookingCalendarSlots(sectionId, currentWeekStartDate, weekRelativeIndexes, onlyDeleteSessions = false, bookingSlotFilter) {
|
|
2514
|
+
const params = bookingSlotFilter.toParams();
|
|
2683
2515
|
return this.apiService
|
|
2684
2516
|
.deleteResourceWithBody(Role.SectionAdmin, SECTION_BOOKING_CALENDAR_SLOTS_CLEAR_PATH, { sectionId }, {
|
|
2685
2517
|
body: {
|
|
@@ -2690,87 +2522,33 @@ class BookingCalendarService {
|
|
|
2690
2522
|
params,
|
|
2691
2523
|
});
|
|
2692
2524
|
}
|
|
2693
|
-
syncBookingCalendarSlots(role, clubOrSectionOrTeamId, currentWeekStartDate, weekRelativeIndexes,
|
|
2525
|
+
syncBookingCalendarSlots(role, clubOrSectionOrTeamId, currentWeekStartDate, weekRelativeIndexes, bookingSlotFilter) {
|
|
2694
2526
|
if (role == Role.ClubAdmin) {
|
|
2695
|
-
return this.syncClubBookingCalendarSlots(clubOrSectionOrTeamId, currentWeekStartDate, weekRelativeIndexes,
|
|
2527
|
+
return this.syncClubBookingCalendarSlots(clubOrSectionOrTeamId, currentWeekStartDate, weekRelativeIndexes, bookingSlotFilter);
|
|
2696
2528
|
}
|
|
2697
2529
|
else if (role == Role.SectionAdmin) {
|
|
2698
|
-
return this.syncSectionBookingCalendarSlots(clubOrSectionOrTeamId, currentWeekStartDate, weekRelativeIndexes,
|
|
2530
|
+
return this.syncSectionBookingCalendarSlots(clubOrSectionOrTeamId, currentWeekStartDate, weekRelativeIndexes, bookingSlotFilter);
|
|
2699
2531
|
}
|
|
2700
|
-
return this.syncTeamBookingCalendarSlots(clubOrSectionOrTeamId, currentWeekStartDate, weekRelativeIndexes,
|
|
2532
|
+
return this.syncTeamBookingCalendarSlots(clubOrSectionOrTeamId, currentWeekStartDate, weekRelativeIndexes, bookingSlotFilter);
|
|
2701
2533
|
}
|
|
2702
|
-
syncClubBookingCalendarSlots(clubId, currentWeekStartDate, weekRelativeIndexes,
|
|
2703
|
-
const params =
|
|
2704
|
-
if (startDate) {
|
|
2705
|
-
params['day__gte'] = startDate;
|
|
2706
|
-
}
|
|
2707
|
-
if (endDate) {
|
|
2708
|
-
params['day__lte'] = endDate;
|
|
2709
|
-
}
|
|
2710
|
-
if (calendarIds && calendarIds.length) {
|
|
2711
|
-
params['calendar_id'] = calendarIds.join(',');
|
|
2712
|
-
}
|
|
2713
|
-
if (locationIds && locationIds.length) {
|
|
2714
|
-
params['location_id'] = locationIds.join(',');
|
|
2715
|
-
}
|
|
2716
|
-
if (tagIds && tagIds.length) {
|
|
2717
|
-
params['tag_id'] = tagIds.join(',');
|
|
2718
|
-
}
|
|
2719
|
-
if (teamIds && teamIds.length) {
|
|
2720
|
-
params['team_id'] = teamIds.join(',');
|
|
2721
|
-
}
|
|
2534
|
+
syncClubBookingCalendarSlots(clubId, currentWeekStartDate, weekRelativeIndexes, bookingSlotFilter) {
|
|
2535
|
+
const params = bookingSlotFilter.toParams();
|
|
2722
2536
|
return this.apiService
|
|
2723
2537
|
.postResourceNoResponse(Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOTS_SYNC_PATH, { clubId }, {
|
|
2724
2538
|
current_week_start_date: currentWeekStartDate,
|
|
2725
2539
|
week_relative_indexes: weekRelativeIndexes,
|
|
2726
2540
|
}, { params });
|
|
2727
2541
|
}
|
|
2728
|
-
syncSectionBookingCalendarSlots(sectionId, currentWeekStartDate, weekRelativeIndexes,
|
|
2729
|
-
const params =
|
|
2730
|
-
if (startDate) {
|
|
2731
|
-
params['day__gte'] = startDate;
|
|
2732
|
-
}
|
|
2733
|
-
if (endDate) {
|
|
2734
|
-
params['day__lte'] = endDate;
|
|
2735
|
-
}
|
|
2736
|
-
if (calendarIds && calendarIds.length) {
|
|
2737
|
-
params['calendar_id'] = calendarIds.join(',');
|
|
2738
|
-
}
|
|
2739
|
-
if (locationIds && locationIds.length) {
|
|
2740
|
-
params['location_id'] = locationIds.join(',');
|
|
2741
|
-
}
|
|
2742
|
-
if (tagIds && tagIds.length) {
|
|
2743
|
-
params['tag_id'] = tagIds.join(',');
|
|
2744
|
-
}
|
|
2745
|
-
if (teamIds && teamIds.length) {
|
|
2746
|
-
params['team_id'] = teamIds.join(',');
|
|
2747
|
-
}
|
|
2542
|
+
syncSectionBookingCalendarSlots(sectionId, currentWeekStartDate, weekRelativeIndexes, bookingSlotFilter) {
|
|
2543
|
+
const params = bookingSlotFilter.toParams();
|
|
2748
2544
|
return this.apiService
|
|
2749
2545
|
.postResourceNoResponse(Role.SectionAdmin, SECTION_BOOKING_CALENDAR_SLOTS_SYNC_PATH, { sectionId }, {
|
|
2750
2546
|
current_week_start_date: currentWeekStartDate,
|
|
2751
2547
|
week_relative_indexes: weekRelativeIndexes,
|
|
2752
2548
|
}, { params });
|
|
2753
2549
|
}
|
|
2754
|
-
syncTeamBookingCalendarSlots(teamId, currentWeekStartDate, weekRelativeIndexes,
|
|
2755
|
-
const params =
|
|
2756
|
-
if (startDate) {
|
|
2757
|
-
params['day__gte'] = startDate;
|
|
2758
|
-
}
|
|
2759
|
-
if (endDate) {
|
|
2760
|
-
params['day__lte'] = endDate;
|
|
2761
|
-
}
|
|
2762
|
-
if (calendarIds && calendarIds.length) {
|
|
2763
|
-
params['calendar_id'] = calendarIds.join(',');
|
|
2764
|
-
}
|
|
2765
|
-
if (locationIds && locationIds.length) {
|
|
2766
|
-
params['location_id'] = locationIds.join(',');
|
|
2767
|
-
}
|
|
2768
|
-
if (tagIds && tagIds.length) {
|
|
2769
|
-
params['tag_id'] = tagIds.join(',');
|
|
2770
|
-
}
|
|
2771
|
-
if (teamIds && teamIds.length) {
|
|
2772
|
-
params['team_id'] = teamIds.join(',');
|
|
2773
|
-
}
|
|
2550
|
+
syncTeamBookingCalendarSlots(teamId, currentWeekStartDate, weekRelativeIndexes, bookingSlotFilter) {
|
|
2551
|
+
const params = bookingSlotFilter.toParams();
|
|
2774
2552
|
return this.apiService
|
|
2775
2553
|
.postResourceNoResponse(Role.TeamAdmin, TEAM_BOOKING_CALENDAR_SLOTS_SYNC_PATH, { teamId }, {
|
|
2776
2554
|
current_week_start_date: currentWeekStartDate,
|
|
@@ -4132,5 +3910,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImpo
|
|
|
4132
3910
|
* Generated bundle index. Do not edit.
|
|
4133
3911
|
*/
|
|
4134
3912
|
|
|
4135
|
-
export { APP, Activity, ActivityExtraMember, ActivityInvite, ActivityLocation, ActivityLocationGroup, ActivityLocationPart, ActivityLocationTag, ActivityService, ActivitySettings, ActivityType, Auth, AuthMember, AuthSection, AuthService, AuthTeam, AuthTeamSection, AuthenticatedGuard, Authentication, AuthenticationInterceptor, AuthenticationService, BookingCalendar, BookingCalendarApplicationTime, BookingCalendarService, BookingCalendarSlot, BookingCalendarSlotSession, BookingSettings, 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, OtherMember, OtherMemberField, 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 };
|
|
3913
|
+
export { APP, Activity, ActivityExtraMember, ActivityInvite, ActivityLocation, ActivityLocationGroup, ActivityLocationPart, ActivityLocationTag, ActivityService, ActivitySettings, ActivityType, Auth, AuthMember, AuthSection, AuthService, AuthTeam, AuthTeamSection, AuthenticatedGuard, Authentication, AuthenticationInterceptor, AuthenticationService, BookingCalendar, BookingCalendarApplicationTime, BookingCalendarService, BookingCalendarSlot, BookingCalendarSlotSession, BookingSettings, BookingSlotFilter, Calendar, CalendarEvent, Card, CardDeal, CardLogo, CardLogoUrls, CardMemberTicket, CardTheme, CardTicket, CardTicketLocation, Club, ClubImage, ClubSection, ClubService, Collection, ConstantService, Contact, CreditCard, DataAccessModule, Directory, Email, EmailService, Event, ExternalLink, ExternalLinkService, FileObject, FileService, GeneralImage, Giro, GroupRole, HandleGrantTokenGuard, HomeTeam, ImageUrls, InvoiceService, MaintenanceModeService, Member, MemberActivityInvite, MemberAttribute, MemberCard, MemberCardService, MemberContact, MemberFee, MemberFunction, MemberInvoice, MemberInvoiceRow, MemberPublicForm, MemberPublicFormField, MemberPublicFormFieldOption, MemberPublicFormService, MemberService, MemberTeam, MemberTeamThrough, MemberType, MemberValidationSettings, News, NewsService, OtherMember, OtherMemberField, 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 };
|
|
4136
3914
|
//# sourceMappingURL=myclub_se-data-access.mjs.map
|