@myclub_se/data-access 2.9.5 → 2.10.0
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.mjs +1 -1
- package/esm2020/lib/api-models/api-search-club.mjs +1 -1
- package/esm2020/lib/authentication/authentication.service.mjs +4 -1
- package/esm2020/lib/interfaces/index.mjs +2 -1
- package/esm2020/lib/interfaces/open-activity-search-params.interface.mjs +2 -0
- package/esm2020/lib/models/booking-calendar.mjs +4 -4
- package/esm2020/lib/models/search-club.mjs +4 -3
- package/esm2020/lib/services/activity.service.mjs +63 -15
- package/esm2020/lib/services/auth.service.mjs +6 -1
- package/esm2020/lib/services/club.service.mjs +6 -1
- package/esm2020/lib/services/factories/booking-calendar-factory.mjs +2 -2
- package/esm2020/lib/services/factories/search-club-factory.mjs +2 -2
- package/fesm2015/myclub_se-data-access.mjs +83 -21
- package/fesm2015/myclub_se-data-access.mjs.map +1 -1
- package/fesm2020/myclub_se-data-access.mjs +83 -21
- package/fesm2020/myclub_se-data-access.mjs.map +1 -1
- package/lib/api-models/api-booking-calendar.d.ts +1 -1
- package/lib/api-models/api-search-club.d.ts +2 -1
- package/lib/authentication/authentication.service.d.ts +1 -0
- package/lib/interfaces/index.d.ts +1 -0
- package/lib/interfaces/open-activity-search-params.interface.d.ts +6 -0
- package/lib/models/booking-calendar.d.ts +3 -3
- package/lib/models/search-club.d.ts +3 -2
- package/lib/services/activity.service.d.ts +9 -2
- package/lib/services/auth.service.d.ts +1 -0
- package/lib/services/club.service.d.ts +1 -0
- package/package.json +1 -1
|
@@ -306,7 +306,7 @@ class Authentication {
|
|
|
306
306
|
}
|
|
307
307
|
|
|
308
308
|
class BookingCalendar {
|
|
309
|
-
constructor(id, club_id, section_id, team_id, club_name, name, section_name, team_name, status, max_application_number,
|
|
309
|
+
constructor(id, club_id, section_id, team_id, club_name, name, section_name, team_name, status, max_application_number, allow_team_export, location_groups) {
|
|
310
310
|
this.id = id;
|
|
311
311
|
this.club_id = club_id;
|
|
312
312
|
this.section_id = section_id;
|
|
@@ -317,7 +317,7 @@ class BookingCalendar {
|
|
|
317
317
|
this.team_name = team_name;
|
|
318
318
|
this.status = status;
|
|
319
319
|
this.max_application_number = max_application_number;
|
|
320
|
-
this.
|
|
320
|
+
this.allow_team_export = allow_team_export;
|
|
321
321
|
this.location_groups = location_groups;
|
|
322
322
|
}
|
|
323
323
|
static asFormGroup(calendar) {
|
|
@@ -339,7 +339,7 @@ class BookingCalendar {
|
|
|
339
339
|
status: new FormControl((calendar === null || calendar === void 0 ? void 0 : calendar.status) || 'preliminary'),
|
|
340
340
|
location_groups: new FormArray(locationGroups),
|
|
341
341
|
max_application_number: new FormControl((calendar === null || calendar === void 0 ? void 0 : calendar.max_application_number) || 0),
|
|
342
|
-
|
|
342
|
+
allow_team_export: new FormControl((calendar === null || calendar === void 0 ? void 0 : calendar.allow_team_export) || false)
|
|
343
343
|
});
|
|
344
344
|
}
|
|
345
345
|
}
|
|
@@ -1468,14 +1468,15 @@ var Role;
|
|
|
1468
1468
|
})(Role || (Role = {}));
|
|
1469
1469
|
|
|
1470
1470
|
class SearchClub {
|
|
1471
|
-
constructor(id, leader_member_search, member_search, member_view, open_activities, open_activities_name,
|
|
1471
|
+
constructor(id, leader_member_search, member_search, member_view, name, open_activities, open_activities_name, open_activities_search_type) {
|
|
1472
1472
|
this.id = id;
|
|
1473
1473
|
this.leader_member_search = leader_member_search;
|
|
1474
1474
|
this.member_search = member_search;
|
|
1475
1475
|
this.member_view = member_view;
|
|
1476
|
+
this.name = name;
|
|
1476
1477
|
this.open_activities = open_activities;
|
|
1477
1478
|
this.open_activities_name = open_activities_name;
|
|
1478
|
-
this.
|
|
1479
|
+
this.open_activities_search_type = open_activities_search_type;
|
|
1479
1480
|
}
|
|
1480
1481
|
}
|
|
1481
1482
|
|
|
@@ -1602,7 +1603,7 @@ const authTeamFactory = (apiAuthTeam) => new AuthTeam(apiAuthTeam.id, apiAuthTea
|
|
|
1602
1603
|
|
|
1603
1604
|
const authFactory = (apiAuth) => new Auth(apiAuth.id, apiAuth.name, apiAuth.club_admin, apiAuth.is_section_club, apiAuth.members.map((apiAuthMember) => authMemberFactory(apiAuthMember)), apiAuth.registration_enabled, apiAuth.sections.map((apiAuthSection) => authSectionFactory(apiAuthSection)), apiAuth.site_enabled, apiAuth.teams.map((apiAuthTeam) => authTeamFactory(apiAuthTeam)), apiAuth.user_name);
|
|
1604
1605
|
|
|
1605
|
-
const bookingCalendarFactory = (apiBookingCalendar) => new BookingCalendar(apiBookingCalendar.id, apiBookingCalendar.club_id, apiBookingCalendar.section_id, apiBookingCalendar.team_id, apiBookingCalendar.club_name, apiBookingCalendar.name, apiBookingCalendar.section_name, apiBookingCalendar.team_name, apiBookingCalendar.status, apiBookingCalendar.max_application_number, apiBookingCalendar.
|
|
1606
|
+
const bookingCalendarFactory = (apiBookingCalendar) => new BookingCalendar(apiBookingCalendar.id, apiBookingCalendar.club_id, apiBookingCalendar.section_id, apiBookingCalendar.team_id, apiBookingCalendar.club_name, apiBookingCalendar.name, apiBookingCalendar.section_name, apiBookingCalendar.team_name, apiBookingCalendar.status, apiBookingCalendar.max_application_number, apiBookingCalendar.allow_team_export, apiBookingCalendar.location_groups && apiBookingCalendar.location_groups.length ? apiBookingCalendar.location_groups.map((apiActivityLocationGroup) => activityLocationGroupFactory(apiActivityLocationGroup)) : []);
|
|
1606
1607
|
|
|
1607
1608
|
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, apiBookingApplicationTime.location_part_id, apiBookingApplicationTime.location_part_name, apiBookingApplicationTime.location_id, apiBookingApplicationTime.repeat, apiBookingApplicationTime.activity_type_id, apiBookingApplicationTime.color, apiBookingApplicationTime.slot_start_time, apiBookingApplicationTime.slot_end_time, apiBookingApplicationTime.slot_day, apiBookingApplicationTime.slot_number_of_available_sessions, apiBookingApplicationTime.slot_last_repeating_date, apiBookingApplicationTime.created, apiBookingApplicationTime.location_name);
|
|
1608
1609
|
|
|
@@ -1750,7 +1751,7 @@ const paymentAttemptFactory = (apiPaymentAttempt) => {
|
|
|
1750
1751
|
|
|
1751
1752
|
const publicAuthenticationFactory = (publicToken) => new PublicAuthentication(publicToken.token, publicToken.token_expires);
|
|
1752
1753
|
|
|
1753
|
-
const searchClubFactory = (apiSearchClub) => new SearchClub(apiSearchClub.id, apiSearchClub.leader_member_search, apiSearchClub.member_search, apiSearchClub.member_view, apiSearchClub.open_activities, apiSearchClub.open_activities_name, apiSearchClub.
|
|
1754
|
+
const searchClubFactory = (apiSearchClub) => new SearchClub(apiSearchClub.id, apiSearchClub.leader_member_search, apiSearchClub.member_search, apiSearchClub.member_view, apiSearchClub.name, apiSearchClub.open_activities, apiSearchClub.open_activities_name, apiSearchClub.open_activities_search_type);
|
|
1754
1755
|
|
|
1755
1756
|
const searchMemberCardFactory = (apiSearchMemberCard) => new SearchMemberCard(apiSearchMemberCard.id, apiSearchMemberCard.name, apiSearchMemberCard.notification_count, apiSearchMemberCard.pdf_url);
|
|
1756
1757
|
|
|
@@ -1869,6 +1870,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImpo
|
|
|
1869
1870
|
|
|
1870
1871
|
const AUTHS_PATH = 'every-admin/auths/';
|
|
1871
1872
|
const REMOVE_AUTH_PATH = 'accounts/remove-auth/:authId/:authType/:id/';
|
|
1873
|
+
const UPDATE_MEMBERS_PATH = 'every-admin/auths/update-members/';
|
|
1872
1874
|
class AuthService {
|
|
1873
1875
|
constructor(apiService) {
|
|
1874
1876
|
this.apiService = apiService;
|
|
@@ -1898,6 +1900,10 @@ class AuthService {
|
|
|
1898
1900
|
removeTeamAuth(authId, teamId) {
|
|
1899
1901
|
return this.removeAuth(authId, teamId, 'team');
|
|
1900
1902
|
}
|
|
1903
|
+
updateMembers() {
|
|
1904
|
+
return this.apiService.updateResourceNoResponse(Role.None, UPDATE_MEMBERS_PATH, {}, {})
|
|
1905
|
+
.pipe(map(() => true), catchError(() => of(false)));
|
|
1906
|
+
}
|
|
1901
1907
|
removeAuth(authId, authTypeId, authType) {
|
|
1902
1908
|
return this.apiService.postResource(() => { }, Role.None, REMOVE_AUTH_PATH, {
|
|
1903
1909
|
authId,
|
|
@@ -1920,10 +1926,14 @@ const MEMBER_ACTIVITY_INVITE_PATH = ':memberId/activities/:activityInviteId/';
|
|
|
1920
1926
|
const MEMBER_ACTIVITY_INVITES_PATH = ':memberId/activities/';
|
|
1921
1927
|
const MEMBER_CALENDAR_PATH = ':memberId/activities/calendar/';
|
|
1922
1928
|
const MEMBER_OPEN_ACTIVITIES_PATH = ':memberId/open-activities/';
|
|
1929
|
+
const MEMBER_OPEN_ACTIVITIES_ACTIVITY_TYPES_PATH = ':memberId/open-activities/types/';
|
|
1930
|
+
const MEMBER_OPEN_ACTIVITIES_ACTIVITY_LOCATIONS_PATH = ':memberId/open-activities/locations/';
|
|
1923
1931
|
const MEMBER_OPEN_ACTIVITY_PATH = ':memberId/open-activities/:activityId/';
|
|
1924
1932
|
const MEMBER_OPEN_ACTIVITY_RESPOND_PATH = ':memberId/open-activities/:activityId/respond/';
|
|
1925
1933
|
const PUBLIC_ACTIVITY_INVITE_PATH = 'activities/:id/:token/';
|
|
1926
1934
|
const PUBLIC_OPEN_ACTIVITIES_PATH = 'open-activities/';
|
|
1935
|
+
const PUBLIC_OPEN_ACTIVITIES_ACTIVITY_TYPES_PATH = 'open-activities/types/';
|
|
1936
|
+
const PUBLIC_OPEN_ACTIVITIES_ACTIVITY_LOCATIONS_PATH = 'open-activities/locations/';
|
|
1927
1937
|
const PUBLIC_OPEN_ACTIVITY_PATH = 'open-activities/:activityId/';
|
|
1928
1938
|
const PUBLIC_OPEN_ACTIVITY_RESPOND_PATH = 'open-activities/:activityId/respond/';
|
|
1929
1939
|
const PUBLIC_OPEN_ACTIVITY_INVITE_PATH = 'open-activities/invites/:activityId/';
|
|
@@ -2022,15 +2032,10 @@ class ActivityService {
|
|
|
2022
2032
|
params
|
|
2023
2033
|
});
|
|
2024
2034
|
}
|
|
2025
|
-
getMemberOpenActivities(memberId,
|
|
2026
|
-
const params = {
|
|
2027
|
-
end_date: endDate,
|
|
2028
|
-
limit: 'null',
|
|
2029
|
-
start_date: startDate
|
|
2030
|
-
};
|
|
2035
|
+
getMemberOpenActivities(memberId, openActivitySearchParams) {
|
|
2031
2036
|
return this.apiService
|
|
2032
2037
|
.getCollection(openActivityFactory, Role.MemberAdmin, MEMBER_OPEN_ACTIVITIES_PATH, { memberId }, {
|
|
2033
|
-
params
|
|
2038
|
+
params: this.getOpenActivitySearchParams(openActivitySearchParams)
|
|
2034
2039
|
});
|
|
2035
2040
|
}
|
|
2036
2041
|
getMemberOpenActivity(memberId, activityId) {
|
|
@@ -2040,6 +2045,22 @@ class ActivityService {
|
|
|
2040
2045
|
activityId
|
|
2041
2046
|
});
|
|
2042
2047
|
}
|
|
2048
|
+
getMemberOpenActivityActivityTypes(memberId, startDate = null, endDate = null, all = false) {
|
|
2049
|
+
return this.apiService
|
|
2050
|
+
.getCollection(activityTypeFactory, Role.MemberAdmin, MEMBER_OPEN_ACTIVITIES_ACTIVITY_TYPES_PATH, {
|
|
2051
|
+
memberId
|
|
2052
|
+
}, {
|
|
2053
|
+
params: this.getOpenActivityDateParams(startDate, endDate, all)
|
|
2054
|
+
});
|
|
2055
|
+
}
|
|
2056
|
+
getMemberOpenActivityLocations(memberId, startDate = null, endDate = null, all = false) {
|
|
2057
|
+
return this.apiService
|
|
2058
|
+
.getCollection(activityLocationFactory, Role.MemberAdmin, MEMBER_OPEN_ACTIVITIES_ACTIVITY_LOCATIONS_PATH, {
|
|
2059
|
+
memberId
|
|
2060
|
+
}, {
|
|
2061
|
+
params: this.getOpenActivityDateParams(startDate, endDate, all)
|
|
2062
|
+
});
|
|
2063
|
+
}
|
|
2043
2064
|
getPublicActivityInvite(id, token) {
|
|
2044
2065
|
return this.apiService
|
|
2045
2066
|
.getResource(activityInviteFactory, Role.Public, PUBLIC_ACTIVITY_INVITE_PATH, {
|
|
@@ -2047,19 +2068,26 @@ class ActivityService {
|
|
|
2047
2068
|
token
|
|
2048
2069
|
});
|
|
2049
2070
|
}
|
|
2050
|
-
getPublicOpenActivities(
|
|
2051
|
-
const params = {
|
|
2052
|
-
end_date: endDate,
|
|
2053
|
-
limit: 'null',
|
|
2054
|
-
start_date: startDate
|
|
2055
|
-
};
|
|
2071
|
+
getPublicOpenActivities(openActivitySearchParams) {
|
|
2056
2072
|
return this.apiService
|
|
2057
|
-
.getCollection(openActivityFactory, Role.Public, PUBLIC_OPEN_ACTIVITIES_PATH, {}, { params });
|
|
2073
|
+
.getCollection(openActivityFactory, Role.Public, PUBLIC_OPEN_ACTIVITIES_PATH, {}, { params: this.getOpenActivitySearchParams(openActivitySearchParams) });
|
|
2058
2074
|
}
|
|
2059
2075
|
getPublicOpenActivity(activityId) {
|
|
2060
2076
|
return this.apiService
|
|
2061
2077
|
.getResource(openActivityFactory, Role.Public, PUBLIC_OPEN_ACTIVITY_PATH, { activityId });
|
|
2062
2078
|
}
|
|
2079
|
+
getPublicOpenActivityActivityTypes(startDate = null, endDate = null, all = false) {
|
|
2080
|
+
return this.apiService
|
|
2081
|
+
.getCollection(activityTypeFactory, Role.Public, PUBLIC_OPEN_ACTIVITIES_ACTIVITY_TYPES_PATH, {}, {
|
|
2082
|
+
params: this.getOpenActivityDateParams(startDate, endDate, all)
|
|
2083
|
+
});
|
|
2084
|
+
}
|
|
2085
|
+
getPublicOpenActivityLocations(startDate = null, endDate = null, all = false) {
|
|
2086
|
+
return this.apiService
|
|
2087
|
+
.getCollection(activityLocationFactory, Role.Public, PUBLIC_OPEN_ACTIVITIES_ACTIVITY_LOCATIONS_PATH, {}, {
|
|
2088
|
+
params: this.getOpenActivityDateParams(startDate, endDate, all)
|
|
2089
|
+
});
|
|
2090
|
+
}
|
|
2063
2091
|
getTeamActivity(teamId, id) {
|
|
2064
2092
|
return this.apiService
|
|
2065
2093
|
.getResource(activityFactory, Role.TeamAdmin, TEAM_ACTIVITY_PATH, { teamId, id });
|
|
@@ -2473,6 +2501,32 @@ class ActivityService {
|
|
|
2473
2501
|
members
|
|
2474
2502
|
});
|
|
2475
2503
|
}
|
|
2504
|
+
getOpenActivityDateParams(startDate, endDate, all = false) {
|
|
2505
|
+
let params = {
|
|
2506
|
+
'all': all ? 'true' : 'false'
|
|
2507
|
+
};
|
|
2508
|
+
if (startDate) {
|
|
2509
|
+
params['start_date'] = startDate;
|
|
2510
|
+
}
|
|
2511
|
+
if (endDate) {
|
|
2512
|
+
params['end_date'] = endDate;
|
|
2513
|
+
}
|
|
2514
|
+
return params;
|
|
2515
|
+
}
|
|
2516
|
+
getOpenActivitySearchParams(openActivitySearchParams) {
|
|
2517
|
+
const params = {
|
|
2518
|
+
end_date: openActivitySearchParams.endDate,
|
|
2519
|
+
limit: 'null',
|
|
2520
|
+
start_date: openActivitySearchParams.startDate
|
|
2521
|
+
};
|
|
2522
|
+
if (openActivitySearchParams.activityTypeId) {
|
|
2523
|
+
params['activity_type_id'] = openActivitySearchParams.activityTypeId;
|
|
2524
|
+
}
|
|
2525
|
+
if (openActivitySearchParams.locationId) {
|
|
2526
|
+
params['location_id'] = openActivitySearchParams.locationId;
|
|
2527
|
+
}
|
|
2528
|
+
return params;
|
|
2529
|
+
}
|
|
2476
2530
|
removeUnusedActivityFields(activity) {
|
|
2477
2531
|
if (typeof activity.id !== 'undefined') {
|
|
2478
2532
|
delete activity.id;
|
|
@@ -3229,6 +3283,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImpo
|
|
|
3229
3283
|
}], ctorParameters: function () { return [{ type: ApiService }]; } });
|
|
3230
3284
|
|
|
3231
3285
|
const MEMBER_CLUB_INFO = ':memberId/club-info/';
|
|
3286
|
+
const PUBLIC_CLUB_INFO = 'club-info/';
|
|
3232
3287
|
const TEAM_CLUB_INFO = ':teamId/club-info/';
|
|
3233
3288
|
class ClubService {
|
|
3234
3289
|
constructor(apiService) {
|
|
@@ -3238,6 +3293,10 @@ class ClubService {
|
|
|
3238
3293
|
return this.apiService
|
|
3239
3294
|
.getResource(searchClubFactory, Role.MemberAdmin, MEMBER_CLUB_INFO, { memberId });
|
|
3240
3295
|
}
|
|
3296
|
+
getPublicClubInfo() {
|
|
3297
|
+
return this.apiService
|
|
3298
|
+
.getResource(searchClubFactory, Role.Public, PUBLIC_CLUB_INFO);
|
|
3299
|
+
}
|
|
3241
3300
|
getTeamClubInfo(teamId) {
|
|
3242
3301
|
return this.apiService
|
|
3243
3302
|
.getResource(searchClubFactory, Role.TeamAdmin, TEAM_CLUB_INFO, { teamId });
|
|
@@ -4120,6 +4179,9 @@ class AuthenticationService {
|
|
|
4120
4179
|
this.publicAuthentication = null;
|
|
4121
4180
|
this.currentTokenSubject.next(null);
|
|
4122
4181
|
}
|
|
4182
|
+
clearPublicAuthentication() {
|
|
4183
|
+
this.publicAuthentication = null;
|
|
4184
|
+
}
|
|
4123
4185
|
getLoginCode(email, clubId) {
|
|
4124
4186
|
const params = { email };
|
|
4125
4187
|
if (clubId) {
|