@myclub_se/data-access 2.4.1 → 2.5.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.
@@ -692,6 +692,17 @@ class GeneralImage {
692
692
  }
693
693
  }
694
694
 
695
+ class GroupRole {
696
+ constructor(id, club_id, section_id, created, name, updated) {
697
+ this.id = id;
698
+ this.club_id = club_id;
699
+ this.section_id = section_id;
700
+ this.created = created;
701
+ this.name = name;
702
+ this.updated = updated;
703
+ }
704
+ }
705
+
695
706
  class ImageUrls {
696
707
  constructor(lg, md, raw, sm, xs) {
697
708
  this.lg = lg;
@@ -1062,7 +1073,7 @@ class MemberActivityInvite {
1062
1073
  }
1063
1074
 
1064
1075
  class MemberPublicForm {
1065
- constructor(id, active_form, active_to, userToken, comment, dataprotection_policy_choice, dataprotection_policy_url, fields, full_text, max_registered_in_form_total, member_types, name, num_registered, team_help_text, teams, url) {
1076
+ 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) {
1066
1077
  this.id = id;
1067
1078
  this.active_form = active_form;
1068
1079
  this.active_to = active_to;
@@ -1072,10 +1083,16 @@ class MemberPublicForm {
1072
1083
  this.dataprotection_policy_url = dataprotection_policy_url;
1073
1084
  this.fields = fields;
1074
1085
  this.full_text = full_text;
1086
+ this.has_nationality_field = has_nationality_field;
1087
+ this.max_members_per_team = max_members_per_team;
1075
1088
  this.max_registered_in_form_total = max_registered_in_form_total;
1076
1089
  this.member_types = member_types;
1090
+ this.member_type_help_text = member_type_help_text;
1077
1091
  this.name = name;
1092
+ this.num_chars_birth_date = num_chars_birth_date;
1078
1093
  this.num_registered = num_registered;
1094
+ this.role_help_text = role_help_text;
1095
+ this.roles = roles;
1079
1096
  this.team_help_text = team_help_text;
1080
1097
  this.teams = teams;
1081
1098
  this.url = url;
@@ -1319,6 +1336,9 @@ class ApiService {
1319
1336
  postResource(factory, role, path, pathParams = {}, data, options = {}) {
1320
1337
  return this.post(role, path, pathParams, data, options).pipe(map((apiResource) => factory(apiResource)));
1321
1338
  }
1339
+ postResourceNoResponse(role, path, pathParams = {}, data, options = {}) {
1340
+ return this.postEmptyResponse(role, path, pathParams, data, options).pipe(map((response) => response.status === 200));
1341
+ }
1322
1342
  updateResource(responseFactory, role, path, pathParams = {}, data, options = {}) {
1323
1343
  return this.patch(role, path, pathParams, data, options).pipe(map((apiResource) => responseFactory(apiResource)));
1324
1344
  }
@@ -1354,6 +1374,9 @@ class ApiService {
1354
1374
  post(role, path, pathParams, data, options) {
1355
1375
  return this.http.post(this.url(this.path(role, path, pathParams)), data, options);
1356
1376
  }
1377
+ postEmptyResponse(role, path, pathParams, data, options) {
1378
+ return this.http.post(this.url(this.path(role, path, pathParams)), data, { ...options, observe: 'response' });
1379
+ }
1357
1380
  url(path) {
1358
1381
  return this.domain + API_PATH + path;
1359
1382
  }
@@ -1412,6 +1435,14 @@ const authTeamFactory = (apiAuthTeam) => new AuthTeam(apiAuthTeam.id, apiAuthTea
1412
1435
 
1413
1436
  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);
1414
1437
 
1438
+ 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
+
1440
+ 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
+
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, apiBookingSlot.available_location_zones, 6, format(new Date(), 'yyyy-MM-dd'), 'repeat_until', apiBookingSlot.reserved_time, apiBookingSlot.reserved_time_type, apiBookingSlot.reserved_time_position);
1443
+
1444
+ 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
+
1415
1446
  const imageUrlsFactory = (apiImageUrls) => new ImageUrls(apiImageUrls.lg, apiImageUrls.md, apiImageUrls.raw, apiImageUrls.sm, apiImageUrls.xs);
1416
1447
 
1417
1448
  const generalImageFactory = (image) => image ? new GeneralImage(image.id, image.name, imageUrlsFactory(image.urls)) : null;
@@ -1454,6 +1485,8 @@ const externalLinkFactory = (apiExternalLink) => new ExternalLink(apiExternalLin
1454
1485
 
1455
1486
  const giroFactory = (apiGiro) => new Giro(apiGiro.club_id, apiGiro.section_id, apiGiro.giro_type, apiGiro.name, apiGiro.number, apiGiro.ocr);
1456
1487
 
1488
+ const groupRoleFactory = (apiGroupRole) => new GroupRole(apiGroupRole.id, apiGroupRole.club_id, apiGroupRole.section_id, apiGroupRole.created, apiGroupRole.name, apiGroupRole.updated);
1489
+
1457
1490
  const memberCardFactory = (apiMemberCard) => new MemberCard(apiMemberCard.id, cardFactory(apiMemberCard.card), apiMemberCard.header_2, apiMemberCard.member_name, apiMemberCard.membership_text, apiMemberCard.name, apiMemberCard.pdf_url);
1458
1491
 
1459
1492
  const memberFeeFactory = (apiMemberFee) => new MemberFee(apiMemberFee.id, apiMemberFee.club_id, apiMemberFee.section_id, apiMemberFee.name);
@@ -1485,8 +1518,9 @@ const memberPublicFormFactory = (apiMemberPublicForm) => {
1485
1518
  fields.set(key, memberPublicFormFieldFactory(field));
1486
1519
  });
1487
1520
  }
1488
- 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.max_registered_in_form_total, apiMemberPublicForm.member_types && apiMemberPublicForm.member_types.length ?
1489
- apiMemberPublicForm.member_types.map((memberType) => memberTypeFactory(memberType)) : [], apiMemberPublicForm.name, apiMemberPublicForm.num_registered, apiMemberPublicForm.team_help_text, apiMemberPublicForm.teams && apiMemberPublicForm.teams.length
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
1523
+ ? apiMemberPublicForm.roles.map((role) => groupRoleFactory(role)) : [], apiMemberPublicForm.team_help_text, apiMemberPublicForm.teams && apiMemberPublicForm.teams.length
1490
1524
  ? apiMemberPublicForm.teams.map((team) => searchTeamFactory(team)) : [], apiMemberPublicForm.url);
1491
1525
  };
1492
1526
 
@@ -1820,17 +1854,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImpo
1820
1854
  }]
1821
1855
  }], ctorParameters: function () { return [{ type: ApiService }]; } });
1822
1856
 
1823
- 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);
1824
-
1825
- 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);
1826
-
1827
- 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, apiBookingSlot.available_location_zones, 6, format(new Date(), 'yyyy-MM-dd'), 'repeat_until', apiBookingSlot.reserved_time, apiBookingSlot.reserved_time_type, apiBookingSlot.reserved_time_position);
1828
-
1829
- 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);
1830
-
1831
1857
  const CLUB_BOOKING_CALENDARS_PATH = ':clubId/activities/calendars/';
1832
1858
  const CLUB_BOOKING_CALENDAR_PATH = ':clubId/activities/calendars/:id/';
1833
1859
  const CLUB_BOOKING_CALENDAR_SLOTS_PATH = ':clubId/activities/slots/';
1860
+ const CLUB_BOOKING_CALENDAR_SLOTS_COPY_PATH = ':clubId/activities/slots/copy/';
1834
1861
  const CLUB_BOOKING_CALENDAR_SLOT_PATH = ':clubId/activities/slots/:id/';
1835
1862
  const CLUB_BOOKING_CALENDAR_REPEATABLE_SLOT_PATH = ':clubId/activities/slots/:id/all/';
1836
1863
  const CLUB_BOOKING_CALENDAR_SLOT_SESSIONS_PATH = ':clubId/activities/sessions/';
@@ -1910,6 +1937,33 @@ class BookingCalendarService {
1910
1937
  params
1911
1938
  });
1912
1939
  }
1940
+ copyClubBookingCalendarSlots(clubId, weekRelativeIndexes, startDate = null, endDate = null, calendarIds = null, locationIds = null, teamIds = null, hasOpenSessions = null) {
1941
+ const params = { limit: 'null' };
1942
+ if (startDate) {
1943
+ params['day__gte'] = startDate;
1944
+ }
1945
+ if (endDate) {
1946
+ params['day__lte'] = endDate;
1947
+ }
1948
+ if (calendarIds && calendarIds.length) {
1949
+ params['calendar_id'] = calendarIds.join(',');
1950
+ }
1951
+ if (locationIds && locationIds.length) {
1952
+ params['location_id'] = locationIds.join(',');
1953
+ }
1954
+ if (teamIds && teamIds.length) {
1955
+ params['team_id'] = teamIds.join(',');
1956
+ }
1957
+ if (typeof hasOpenSessions === 'boolean') {
1958
+ params['has_open_sessions'] = String(hasOpenSessions);
1959
+ }
1960
+ return this.apiService
1961
+ .postResourceNoResponse(Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOTS_COPY_PATH, { clubId }, {
1962
+ week_relative_indexes: weekRelativeIndexes,
1963
+ }, {
1964
+ params
1965
+ });
1966
+ }
1913
1967
  getClubBookingCalendarSlot(clubId, id) {
1914
1968
  return this.apiService
1915
1969
  .getResource(bookingCalendarSlotFactory, Role.ClubAdmin, CLUB_BOOKING_CALENDAR_SLOT_PATH, { clubId, id });
@@ -3046,5 +3100,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImpo
3046
3100
  * Generated bundle index. Do not edit.
3047
3101
  */
3048
3102
 
3049
- 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, 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 };
3103
+ 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 };
3050
3104
  //# sourceMappingURL=myclub_se-data-access.mjs.map