@myclub_se/data-access 1.7.1 → 1.9.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.
@@ -738,15 +738,19 @@ class Giro {
738
738
  }
739
739
 
740
740
  class Swish {
741
- constructor(clubId, sectionId, certificateValidUntil, defaultActivated, name, status, swishPayeeAlias, testAccount, usesMyClubCertificate) {
741
+ constructor(clubId, sectionId, certificateValidUntil, defaultActivated, name, paymentTermsName, paymentTermsOrganisationId, paymentTermsUrl, status, swishPayeeAlias, testAccount, usePaymentTerms, usesMyClubCertificate) {
742
742
  this.clubId = clubId;
743
743
  this.sectionId = sectionId;
744
744
  this.certificateValidUntil = certificateValidUntil;
745
745
  this.defaultActivated = defaultActivated;
746
746
  this.name = name;
747
+ this.paymentTermsName = paymentTermsName;
748
+ this.paymentTermsOrganisationId = paymentTermsOrganisationId;
749
+ this.paymentTermsUrl = paymentTermsUrl;
747
750
  this.status = status;
748
751
  this.swishPayeeAlias = swishPayeeAlias;
749
752
  this.testAccount = testAccount;
753
+ this.usePaymentTerms = usePaymentTerms;
750
754
  this.usesMyClubCertificate = usesMyClubCertificate;
751
755
  }
752
756
  }
@@ -1002,10 +1006,11 @@ class MemberActivityInvite {
1002
1006
  }
1003
1007
 
1004
1008
  class MemberPublicForm {
1005
- constructor(id, active_form, active_to, name, url) {
1009
+ constructor(id, active_form, active_to, userToken, name, url) {
1006
1010
  this.id = id;
1007
1011
  this.active_form = active_form;
1008
1012
  this.active_to = active_to;
1013
+ this.userToken = userToken;
1009
1014
  this.name = name;
1010
1015
  this.url = url;
1011
1016
  }
@@ -1038,7 +1043,7 @@ class MemberTeamThrough {
1038
1043
  }
1039
1044
 
1040
1045
  class News {
1041
- constructor(id, club_id, created, created_by_id, section_id, team_id, active_to, author, ingress, news_image, news_image_text, published_date, read, show_on_my_pages, text, title, updated, urls) {
1046
+ constructor(id, club_id, created, created_by_id, section_id, team_id, active_to, author, ingress, news_image, news_image_text, published_date, read, show_on_my_pages, show_on_webpage, text, title, updated, urls) {
1042
1047
  this.id = id;
1043
1048
  this.club_id = club_id;
1044
1049
  this.created = created;
@@ -1053,16 +1058,21 @@ class News {
1053
1058
  this.published_date = published_date;
1054
1059
  this.read = read;
1055
1060
  this.show_on_my_pages = show_on_my_pages;
1061
+ this.show_on_webpage = show_on_webpage;
1056
1062
  this.text = text;
1057
1063
  this.title = title;
1058
1064
  this.updated = updated;
1059
1065
  this.urls = urls;
1060
1066
  }
1061
1067
  static asFormGroup(news = null) {
1062
- let show_on_my_pages = true;
1068
+ let show_on_my_pages = false;
1069
+ let show_on_webpage = false;
1063
1070
  if (typeof news?.show_on_my_pages !== 'undefined') {
1064
1071
  show_on_my_pages = news.show_on_my_pages;
1065
1072
  }
1073
+ if (typeof news?.show_on_webpage !== 'undefined') {
1074
+ show_on_webpage = news.show_on_webpage;
1075
+ }
1066
1076
  return new FormGroup({
1067
1077
  id: new FormControl(news?.id || ''),
1068
1078
  active_to: new FormControl(news?.active_to || ''),
@@ -1071,6 +1081,7 @@ class News {
1071
1081
  news_image_text: new FormControl(news?.news_image_text || ''),
1072
1082
  published_date: new FormControl(news?.published_date || ''),
1073
1083
  show_on_my_pages: new FormControl(show_on_my_pages),
1084
+ show_on_webpage: new FormControl(show_on_webpage),
1074
1085
  text: new FormControl(news?.text || '', [Validators.required, Validators.minLength(1)]),
1075
1086
  title: new FormControl(news?.title || '', [Validators.required, Validators.minLength(1)])
1076
1087
  });
@@ -1346,7 +1357,7 @@ const memberCardFactory = (apiMemberCard) => new MemberCard(apiMemberCard.id, ca
1346
1357
 
1347
1358
  const memberFeeFactory = (apiMemberFee) => new MemberFee(apiMemberFee.id, apiMemberFee.club_id, apiMemberFee.section_id, apiMemberFee.name);
1348
1359
 
1349
- const swishFactory = (apiSwish) => new Swish(apiSwish.club_id, apiSwish.section_id, apiSwish.certificate_valid_until, apiSwish.default_activated, apiSwish.name, apiSwish.status, apiSwish.swish_payee_alias, apiSwish.test_account, apiSwish.uses_myclub_certificate);
1360
+ const swishFactory = (apiSwish) => new Swish(apiSwish.club_id, apiSwish.section_id, apiSwish.certificate_valid_until, apiSwish.default_activated, apiSwish.name, apiSwish.payment_terms_name, apiSwish.payment_terms_organisation_id, apiSwish.payment_terms_url, apiSwish.status, apiSwish.swish_payee_alias, apiSwish.test_account, apiSwish.use_payment_terms, apiSwish.uses_myclub_certificate);
1350
1361
 
1351
1362
  const zimplerFactory = (apiZimpler) => new Zimpler(apiZimpler.club_id, apiZimpler.section_id, apiZimpler.default_activated, apiZimpler.merchant_id, apiZimpler.name, apiZimpler.status, apiZimpler.test_account);
1352
1363
 
@@ -1354,7 +1365,7 @@ const memberInvoiceRowFactory = (apiMemberInvoiceRow) => new MemberInvoiceRow(ap
1354
1365
 
1355
1366
  const memberInvoiceFactory = (apiMemberInvoice) => new MemberInvoice(apiMemberInvoice.id, apiMemberInvoice.amount, apiMemberInvoice.amount_paid, apiMemberInvoice.balance, apiMemberInvoice.club_bill_id, apiMemberInvoice.club_name, apiMemberInvoice.credit_card ? creditCardFactory(apiMemberInvoice.credit_card) : null, apiMemberInvoice.date_paid, apiMemberInvoice.due_date, apiMemberInvoice.giro ? giroFactory(apiMemberInvoice.giro) : null, apiMemberInvoice.invoice_rows.map((row) => memberInvoiceRowFactory(row)), apiMemberInvoice.invoice_text, apiMemberInvoice.is_paid, apiMemberInvoice.member_id, apiMemberInvoice.payee, apiMemberInvoice.payment_url, apiMemberInvoice.reference, apiMemberInvoice.swish ? swishFactory(apiMemberInvoice.swish) : null, apiMemberInvoice.zimpler ? zimplerFactory(apiMemberInvoice.zimpler) : null);
1356
1367
 
1357
- const memberPublicFormFactory = (apiMemberPublicForm) => new MemberPublicForm(apiMemberPublicForm.id, apiMemberPublicForm.active_from, apiMemberPublicForm.active_to, apiMemberPublicForm.name, apiMemberPublicForm.url);
1368
+ const memberPublicFormFactory = (apiMemberPublicForm) => new MemberPublicForm(apiMemberPublicForm.id, apiMemberPublicForm.active_from, apiMemberPublicForm.active_to, apiMemberPublicForm.user_token, apiMemberPublicForm.name, apiMemberPublicForm.url);
1358
1369
 
1359
1370
  const sectionFactory = (apiSection) => new Section(apiSection.id, apiSection.name);
1360
1371
 
@@ -1362,7 +1373,7 @@ const memberTeamFactory = (apiMemberTeam) => new MemberTeam(clubFactory(apiMembe
1362
1373
 
1363
1374
  const memberTeamThroughFactory = (apiMemberTeamThrough) => new MemberTeamThrough(apiMemberTeamThrough.id, apiMemberTeamThrough.created, apiMemberTeamThrough.date_hidden, apiMemberTeamThrough.image, apiMemberTeamThrough.leader, memberFactory(apiMemberTeamThrough.member), apiMemberTeamThrough.role_id, apiMemberTeamThrough.show_on_web, apiMemberTeamThrough.updated);
1364
1375
 
1365
- const newsFactory = (apiNews) => new News(apiNews.id, apiNews.club_id, apiNews.created, apiNews.created_by_id, apiNews.section_id, apiNews.team_id, apiNews.active_to, apiNews.author, apiNews.ingress, apiNews.news_image, apiNews.news_image_text, apiNews.published_date, apiNews.read, apiNews.show_on_my_pages, apiNews.text, apiNews.title, apiNews.updated, apiNews.urls ? imageUrlsFactory(apiNews.urls) : null);
1376
+ const newsFactory = (apiNews) => new News(apiNews.id, apiNews.club_id, apiNews.created, apiNews.created_by_id, apiNews.section_id, apiNews.team_id, apiNews.active_to, apiNews.author, apiNews.ingress, apiNews.news_image, apiNews.news_image_text, apiNews.published_date, apiNews.read, apiNews.show_on_my_pages, apiNews.show_on_webpage, apiNews.text, apiNews.title, apiNews.updated, apiNews.urls ? imageUrlsFactory(apiNews.urls) : null);
1366
1377
 
1367
1378
  const paymentAttemptFactory = (apiPaymentAttempt) => {
1368
1379
  let paymentAttemptData = null;
@@ -2301,6 +2312,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImpo
2301
2312
  }]
2302
2313
  }], ctorParameters: function () { return [{ type: ApiService }]; } });
2303
2314
 
2315
+ const MEMBER_MEMBER_PUBLIC_FORM_PATH = ':memberId/myclub-forms/:id/';
2304
2316
  const MEMBER_MEMBER_PUBLIC_FORMS_PATH = ':memberId/myclub-forms/';
2305
2317
  class MemberPublicFormService {
2306
2318
  constructor(apiService) {
@@ -2310,6 +2322,13 @@ class MemberPublicFormService {
2310
2322
  return this.apiService
2311
2323
  .getCollection(memberPublicFormFactory, Role.MemberAdmin, MEMBER_MEMBER_PUBLIC_FORMS_PATH, { memberId });
2312
2324
  }
2325
+ getMemberMemberPublicForm(memberId, id) {
2326
+ return this.apiService
2327
+ .getResource(memberPublicFormFactory, Role.MemberAdmin, MEMBER_MEMBER_PUBLIC_FORM_PATH, {
2328
+ memberId,
2329
+ id
2330
+ });
2331
+ }
2313
2332
  }
2314
2333
  MemberPublicFormService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: MemberPublicFormService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
2315
2334
  MemberPublicFormService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: MemberPublicFormService, providedIn: 'root' });
@@ -2404,6 +2423,7 @@ class NewsService {
2404
2423
  formData.append('published_date', news?.published_date ? news?.published_date : '');
2405
2424
  formData.append('active_to', news?.active_to ? news?.active_to : '');
2406
2425
  formData.append('show_on_my_pages', `${news?.show_on_my_pages || false}`);
2426
+ formData.append('show_on_webpage', `${news?.show_on_webpage || false}`);
2407
2427
  return formData;
2408
2428
  }
2409
2429
  }