@myclub_se/data-access 2.1.0 → 2.2.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-activity-invite.mjs +1 -1
- package/esm2020/lib/api-models/api-booking-calendar-slot-session.mjs +1 -1
- package/esm2020/lib/api-models/api-booking-calendar-slot.mjs +1 -1
- package/esm2020/lib/authentication/authentication.interceptor.mjs +2 -2
- package/esm2020/lib/models/activity-invite.mjs +3 -2
- package/esm2020/lib/models/booking-calendar-slot-session.mjs +8 -4
- package/esm2020/lib/models/booking-calendar-slot.mjs +12 -3
- package/esm2020/lib/models/user.mjs +2 -2
- package/esm2020/lib/services/booking-calendar.service.mjs +1 -1
- package/esm2020/lib/services/factories/activity-invite-factory.mjs +2 -2
- package/esm2020/lib/services/factories/booking-calendar-slot-factory.mjs +2 -2
- package/esm2020/lib/services/factories/booking-calendar-slot-session-factory.mjs +2 -2
- package/esm2020/lib/services/user.service.mjs +2 -2
- package/esm2020/lib/types/booking-calendar-slot-reserved-time-position.mjs +2 -0
- package/esm2020/lib/types/booking-calendar-slot-reserved-time-type.mjs +2 -0
- package/fesm2015/myclub_se-data-access.mjs +26 -12
- package/fesm2015/myclub_se-data-access.mjs.map +1 -1
- package/fesm2020/myclub_se-data-access.mjs +26 -12
- package/fesm2020/myclub_se-data-access.mjs.map +1 -1
- package/lib/api-models/api-activity-invite.d.ts +1 -0
- package/lib/api-models/api-booking-calendar-slot-session.d.ts +2 -0
- package/lib/api-models/api-booking-calendar-slot.d.ts +7 -0
- package/lib/models/activity-invite.d.ts +2 -1
- package/lib/models/booking-calendar-slot-session.d.ts +5 -1
- package/lib/models/booking-calendar-slot.d.ts +12 -1
- package/lib/services/booking-calendar.service.d.ts +1 -3
- package/lib/types/booking-calendar-slot-reserved-time-position.d.ts +1 -0
- package/lib/types/booking-calendar-slot-reserved-time-type.d.ts +1 -0
- package/package.json +1 -1
|
@@ -108,13 +108,14 @@ class ActivityExtraMember {
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
class ActivityInvite {
|
|
111
|
-
constructor(id, activity, comment, created, has_unpaid_invoices, last_invite, member, next_invite, reminded, response_date, status, token, unpaid_invoices, updated) {
|
|
111
|
+
constructor(id, activity, comment, created, has_unpaid_invoices, last_invite, leader, member, next_invite, reminded, response_date, status, token, unpaid_invoices, updated) {
|
|
112
112
|
this.id = id;
|
|
113
113
|
this.activity = activity;
|
|
114
114
|
this.comment = comment;
|
|
115
115
|
this.created = created;
|
|
116
116
|
this.has_unpaid_invoices = has_unpaid_invoices;
|
|
117
117
|
this.last_invite = last_invite;
|
|
118
|
+
this.leader = leader;
|
|
118
119
|
this.member = member;
|
|
119
120
|
this.next_invite = next_invite;
|
|
120
121
|
this.reminded = reminded;
|
|
@@ -257,7 +258,7 @@ class BookingCalendar {
|
|
|
257
258
|
}
|
|
258
259
|
|
|
259
260
|
class BookingCalendarSlot {
|
|
260
|
-
constructor(id, calendar_id, location_id, color, day, end_time, group_id, location_name, number_of_available_sessions, sessions, start_time, type, repeat, update_repeating, repeat_num, repeat_to_day, repeat_type) {
|
|
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_type, reserved_time_position) {
|
|
261
262
|
this.id = id;
|
|
262
263
|
this.calendar_id = calendar_id;
|
|
263
264
|
this.location_id = location_id;
|
|
@@ -268,13 +269,18 @@ class BookingCalendarSlot {
|
|
|
268
269
|
this.location_name = location_name;
|
|
269
270
|
this.number_of_available_sessions = number_of_available_sessions;
|
|
270
271
|
this.sessions = sessions;
|
|
272
|
+
this.open_sessions = open_sessions;
|
|
271
273
|
this.start_time = start_time;
|
|
272
274
|
this.type = type;
|
|
273
275
|
this.repeat = repeat;
|
|
274
276
|
this.update_repeating = update_repeating;
|
|
277
|
+
this.reserved_time_enabled = reserved_time_enabled;
|
|
275
278
|
this.repeat_num = repeat_num;
|
|
276
279
|
this.repeat_to_day = repeat_to_day;
|
|
277
280
|
this.repeat_type = repeat_type;
|
|
281
|
+
this.reserved_time = reserved_time;
|
|
282
|
+
this.reserved_time_type = reserved_time_type;
|
|
283
|
+
this.reserved_time_position = reserved_time_position;
|
|
278
284
|
}
|
|
279
285
|
static asFormGroup(slot) {
|
|
280
286
|
return new FormGroup({
|
|
@@ -291,13 +297,17 @@ class BookingCalendarSlot {
|
|
|
291
297
|
repeat_num: new FormControl(slot?.repeat_num || 6, Validators.max(24)),
|
|
292
298
|
repeat_to_day: new FormControl(slot?.repeat_to_day || ''),
|
|
293
299
|
repeat_type: new FormControl(slot?.repeat_type || ''),
|
|
294
|
-
update_repeating: new FormControl(typeof slot?.update_repeating !== 'undefined' ? slot?.update_repeating : false)
|
|
300
|
+
update_repeating: new FormControl(typeof slot?.update_repeating !== 'undefined' ? slot?.update_repeating : false),
|
|
301
|
+
reserved_time_enabled: new FormControl(typeof slot?.reserved_time_enabled !== 'undefined' ? slot?.reserved_time_enabled : false),
|
|
302
|
+
reserved_time: new FormControl(slot?.reserved_time || '00:00'),
|
|
303
|
+
reserved_time_type: new FormControl(slot?.reserved_time_type || ''),
|
|
304
|
+
reserved_time_position: new FormControl(slot?.reserved_time_position || ''),
|
|
295
305
|
});
|
|
296
306
|
}
|
|
297
307
|
}
|
|
298
308
|
|
|
299
309
|
class BookingCalendarSlotSession {
|
|
300
|
-
constructor(id, section_id, slot_id, team_id, end_time, section_name, start_time, team_name) {
|
|
310
|
+
constructor(id, section_id, slot_id, team_id, end_time, section_name, start_time, team_name, is_overbooked, type) {
|
|
301
311
|
this.id = id;
|
|
302
312
|
this.section_id = section_id;
|
|
303
313
|
this.slot_id = slot_id;
|
|
@@ -306,17 +316,21 @@ class BookingCalendarSlotSession {
|
|
|
306
316
|
this.section_name = section_name;
|
|
307
317
|
this.start_time = start_time;
|
|
308
318
|
this.team_name = team_name;
|
|
319
|
+
this.is_overbooked = is_overbooked;
|
|
320
|
+
this.type = type;
|
|
309
321
|
}
|
|
310
322
|
static asFormGroup(session) {
|
|
311
323
|
return new FormGroup({
|
|
312
324
|
id: new FormControl(session?.id || ''),
|
|
313
325
|
section_id: new FormControl(session?.section_id || ''),
|
|
314
326
|
slot_id: new FormControl(session?.slot_id || '', Validators.required),
|
|
315
|
-
team_id: new FormControl(session?.team_id || ''),
|
|
327
|
+
team_id: new FormControl(session?.team_id || '', Validators.required),
|
|
316
328
|
end_time: new FormControl(session?.end_time || '', Validators.required),
|
|
317
329
|
section_name: new FormControl(session?.section_name || ''),
|
|
318
330
|
start_time: new FormControl(session?.start_time || '', Validators.required),
|
|
319
|
-
team_name: new FormControl(session?.team_name || '')
|
|
331
|
+
team_name: new FormControl(session?.team_name || ''),
|
|
332
|
+
is_overbooked: new FormControl(session?.is_overbooked || false),
|
|
333
|
+
type: new FormControl(session?.type || '')
|
|
320
334
|
});
|
|
321
335
|
}
|
|
322
336
|
}
|
|
@@ -1175,7 +1189,7 @@ class User {
|
|
|
1175
1189
|
firstName: new FormControl(user?.firstName || ''),
|
|
1176
1190
|
language: new FormControl(user?.language || 'sv'),
|
|
1177
1191
|
lastName: new FormControl(user?.lastName || ''),
|
|
1178
|
-
newEmail: new FormControl(user?.
|
|
1192
|
+
newEmail: new FormControl(user?.newEmail || ''),
|
|
1179
1193
|
newPassword: new FormControl(''),
|
|
1180
1194
|
verifyPassword: new FormControl(''),
|
|
1181
1195
|
password: new FormControl('')
|
|
@@ -1309,7 +1323,7 @@ const activityFactory = (apiActivity) => new Activity(apiActivity.id, apiActivit
|
|
|
1309
1323
|
|
|
1310
1324
|
const unpaidInvoiceFactory = (apiUnpaidInvoice) => new UnpaidMemberInvoice(apiUnpaidInvoice.id, apiUnpaidInvoice.club_bill_id, apiUnpaidInvoice.member_id, apiUnpaidInvoice.token);
|
|
1311
1325
|
|
|
1312
|
-
const activityInviteFactory = (apiActivityInvite) => new ActivityInvite(apiActivityInvite.id, activityFactory(apiActivityInvite.activity), apiActivityInvite.comment, apiActivityInvite.created, apiActivityInvite.has_unpaid_invoices, apiActivityInvite.last_invite, searchMemberFactory(apiActivityInvite.member), apiActivityInvite.next_invite, apiActivityInvite.reminded, apiActivityInvite.response_date, apiActivityInvite.status, apiActivityInvite.token, apiActivityInvite.unpaid_invoices && apiActivityInvite.unpaid_invoices.length ? apiActivityInvite.unpaid_invoices.map((apiUnpaidInvoice) => unpaidInvoiceFactory(apiUnpaidInvoice)) : [], apiActivityInvite.updated);
|
|
1326
|
+
const activityInviteFactory = (apiActivityInvite) => new ActivityInvite(apiActivityInvite.id, activityFactory(apiActivityInvite.activity), apiActivityInvite.comment, apiActivityInvite.created, apiActivityInvite.has_unpaid_invoices, apiActivityInvite.last_invite, apiActivityInvite.leader, searchMemberFactory(apiActivityInvite.member), apiActivityInvite.next_invite, apiActivityInvite.reminded, apiActivityInvite.response_date, apiActivityInvite.status, apiActivityInvite.token, apiActivityInvite.unpaid_invoices && apiActivityInvite.unpaid_invoices.length ? apiActivityInvite.unpaid_invoices.map((apiUnpaidInvoice) => unpaidInvoiceFactory(apiUnpaidInvoice)) : [], apiActivityInvite.updated);
|
|
1313
1327
|
|
|
1314
1328
|
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);
|
|
1315
1329
|
|
|
@@ -1717,9 +1731,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImpo
|
|
|
1717
1731
|
|
|
1718
1732
|
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);
|
|
1719
1733
|
|
|
1720
|
-
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);
|
|
1734
|
+
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);
|
|
1721
1735
|
|
|
1722
|
-
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.start_time, apiBookingSlot.type, 'none', false, 6, format(new Date(), 'yyyy-MM-dd'), 'repeat_until');
|
|
1736
|
+
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_type, apiBookingSlot.reserved_time_position);
|
|
1723
1737
|
|
|
1724
1738
|
const CLUB_BOOKING_CALENDARS_PATH = ':clubId/activities/calendars/';
|
|
1725
1739
|
const CLUB_BOOKING_CALENDAR_PATH = ':clubId/activities/calendars/:id/';
|
|
@@ -2680,7 +2694,7 @@ class UserService {
|
|
|
2680
2694
|
data['password'] = user.password;
|
|
2681
2695
|
}
|
|
2682
2696
|
if (user.newEmail) {
|
|
2683
|
-
data['
|
|
2697
|
+
data['new_email'] = user.newEmail;
|
|
2684
2698
|
}
|
|
2685
2699
|
if (user.language) {
|
|
2686
2700
|
data['language'] = user.language;
|
|
@@ -2793,7 +2807,7 @@ class AuthenticationInterceptor {
|
|
|
2793
2807
|
request = this.addAuthorizationHeader(request, authentication.accessToken);
|
|
2794
2808
|
}
|
|
2795
2809
|
return next.handle(request).pipe(catchError((requestError) => {
|
|
2796
|
-
if (requestError instanceof HttpErrorResponse && requestError.status === 401) {
|
|
2810
|
+
if (request.url.indexOf('accounts/token/') === -1 && requestError instanceof HttpErrorResponse && requestError.status === 401) {
|
|
2797
2811
|
return this.handle401Error(request, next);
|
|
2798
2812
|
}
|
|
2799
2813
|
return throwError(() => requestError);
|