@myclub_se/data-access 2.5.0 → 2.5.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-calendar-slot.mjs +1 -1
- package/esm2020/lib/models/booking-calendar-slot.mjs +4 -8
- package/esm2020/lib/services/booking-calendar.service.mjs +3 -2
- package/esm2020/lib/services/factories/booking-calendar-slot-factory.mjs +2 -2
- package/esm2020/lib/types/booking-calendar-slot-type.mjs +1 -1
- package/fesm2015/myclub_se-data-access.mjs +6 -9
- package/fesm2015/myclub_se-data-access.mjs.map +1 -1
- package/fesm2020/myclub_se-data-access.mjs +6 -9
- package/fesm2020/myclub_se-data-access.mjs.map +1 -1
- package/lib/api-models/api-booking-calendar-slot.d.ts +0 -3
- package/lib/models/booking-calendar-slot.d.ts +1 -6
- package/lib/services/booking-calendar.service.d.ts +1 -1
- package/lib/types/booking-calendar-slot-type.d.ts +1 -1
- package/package.json +1 -1
|
@@ -258,7 +258,7 @@ class BookingCalendar {
|
|
|
258
258
|
}
|
|
259
259
|
|
|
260
260
|
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,
|
|
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) {
|
|
262
262
|
this.id = id;
|
|
263
263
|
this.calendar_id = calendar_id;
|
|
264
264
|
this.location_id = location_id;
|
|
@@ -275,23 +275,21 @@ class BookingCalendarSlot {
|
|
|
275
275
|
this.repeat = repeat;
|
|
276
276
|
this.update_repeating = update_repeating;
|
|
277
277
|
this.reserved_time_enabled = reserved_time_enabled;
|
|
278
|
-
this.available_location_zones = available_location_zones;
|
|
279
278
|
this.repeat_num = repeat_num;
|
|
280
279
|
this.repeat_to_day = repeat_to_day;
|
|
281
280
|
this.repeat_type = repeat_type;
|
|
282
281
|
this.reserved_time = reserved_time;
|
|
283
|
-
this.reserved_time_type = reserved_time_type;
|
|
284
282
|
this.reserved_time_position = reserved_time_position;
|
|
285
283
|
}
|
|
286
284
|
static asFormGroup(slot) {
|
|
287
285
|
return new FormGroup({
|
|
288
286
|
id: new FormControl(slot?.id || ''),
|
|
289
|
-
calendar_id: new FormControl(slot?.calendar_id || ''),
|
|
287
|
+
calendar_id: new FormControl(slot?.calendar_id || '', Validators.required),
|
|
290
288
|
location_id: new FormControl(slot?.location_id || '', Validators.required),
|
|
291
289
|
day: new FormControl(slot?.day || '', Validators.required),
|
|
292
290
|
end_time: new FormControl(slot?.end_time || '', Validators.required),
|
|
293
291
|
group_id: new FormControl(slot?.group_id || null, { nonNullable: false }),
|
|
294
|
-
number_of_available_sessions: new FormControl(slot?.number_of_available_sessions ||
|
|
292
|
+
number_of_available_sessions: new FormControl(slot?.number_of_available_sessions || 1, [Validators.required, Validators.min(1)]),
|
|
295
293
|
start_time: new FormControl(slot?.start_time || '', Validators.required),
|
|
296
294
|
type: new FormControl(slot?.type || '', Validators.required),
|
|
297
295
|
repeat: new FormControl(slot?.repeat || 'none'),
|
|
@@ -301,9 +299,7 @@ class BookingCalendarSlot {
|
|
|
301
299
|
update_repeating: new FormControl(typeof slot?.update_repeating !== 'undefined' ? slot?.update_repeating : false),
|
|
302
300
|
reserved_time_enabled: new FormControl(typeof slot?.reserved_time_enabled !== 'undefined' ? slot?.reserved_time_enabled : false),
|
|
303
301
|
reserved_time: new FormControl(slot?.reserved_time || '00:00'),
|
|
304
|
-
reserved_time_type: new FormControl(slot?.reserved_time_type || ''),
|
|
305
302
|
reserved_time_position: new FormControl(slot?.reserved_time_position || ''),
|
|
306
|
-
available_location_zones: new FormControl(slot?.available_location_zones || 1, [Validators.min(1), Validators.required]),
|
|
307
303
|
});
|
|
308
304
|
}
|
|
309
305
|
}
|
|
@@ -1439,7 +1435,7 @@ const bookingCalendarFactory = (apiBookingCalendar) => new BookingCalendar(apiBo
|
|
|
1439
1435
|
|
|
1440
1436
|
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);
|
|
1441
1437
|
|
|
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,
|
|
1438
|
+
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);
|
|
1443
1439
|
|
|
1444
1440
|
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
1441
|
|
|
@@ -1937,7 +1933,7 @@ class BookingCalendarService {
|
|
|
1937
1933
|
params
|
|
1938
1934
|
});
|
|
1939
1935
|
}
|
|
1940
|
-
copyClubBookingCalendarSlots(clubId, weekRelativeIndexes, startDate = null, endDate = null, calendarIds = null, locationIds = null, teamIds = null, hasOpenSessions = null) {
|
|
1936
|
+
copyClubBookingCalendarSlots(clubId, weekRelativeIndexes, onlyCopySlots = false, startDate = null, endDate = null, calendarIds = null, locationIds = null, teamIds = null, hasOpenSessions = null) {
|
|
1941
1937
|
const params = { limit: 'null' };
|
|
1942
1938
|
if (startDate) {
|
|
1943
1939
|
params['day__gte'] = startDate;
|
|
@@ -1960,6 +1956,7 @@ class BookingCalendarService {
|
|
|
1960
1956
|
return this.apiService
|
|
1961
1957
|
.postResourceNoResponse(Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOTS_COPY_PATH, { clubId }, {
|
|
1962
1958
|
week_relative_indexes: weekRelativeIndexes,
|
|
1959
|
+
only_copy_slots: onlyCopySlots,
|
|
1963
1960
|
}, {
|
|
1964
1961
|
params
|
|
1965
1962
|
});
|