@glissandoo/lib 1.40.1 → 1.41.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.
Files changed (43) hide show
  1. package/functions/customer.d.ts +71 -0
  2. package/functions/customer.js +2 -0
  3. package/functions/customerGroup.d.ts +21 -0
  4. package/functions/customerGroup.js +2 -0
  5. package/functions/index.d.ts +17 -9
  6. package/functions/index.js +17 -9
  7. package/functions/partnership.d.ts +0 -46
  8. package/functions/partnershipGroup copy.d.ts +21 -0
  9. package/functions/partnershipGroup copy.js +2 -0
  10. package/functions/partnershipGroup.d.ts +0 -9
  11. package/functions/regions.js +14 -6
  12. package/helpers/auth.d.ts +2 -0
  13. package/helpers/collections.d.ts +2 -0
  14. package/helpers/collections.js +2 -0
  15. package/helpers/errors.d.ts +3 -0
  16. package/helpers/errors.js +3 -0
  17. package/helpers/notifications/placeholders.js +4 -1
  18. package/helpers/notifications.d.ts +37 -0
  19. package/helpers/notifications.js +126 -0
  20. package/models/Customer/Group/index.d.ts +19 -0
  21. package/models/Customer/Group/index.js +48 -0
  22. package/models/Customer/Group/types.d.ts +15 -0
  23. package/models/Customer/Group/types.js +2 -0
  24. package/models/Customer/basic.d.ts +14 -0
  25. package/models/Customer/basic.js +46 -0
  26. package/models/Customer/index.d.ts +24 -0
  27. package/models/Customer/index.js +56 -0
  28. package/models/Customer/types.d.ts +28 -0
  29. package/models/Customer/types.js +7 -0
  30. package/models/Group/index.d.ts +1 -0
  31. package/models/Group/index.js +3 -0
  32. package/models/Group/types.d.ts +1 -0
  33. package/models/Metrics/types.d.ts +1 -1
  34. package/models/Partnership/Group/index.d.ts +8 -0
  35. package/models/Partnership/Group/index.js +8 -0
  36. package/models/Partnership/Group/types.d.ts +8 -0
  37. package/models/Partnership/index.d.ts +6 -1
  38. package/models/Partnership/index.js +7 -0
  39. package/models/Partnership/types.d.ts +4 -0
  40. package/models/User/index.d.ts +1 -0
  41. package/models/User/index.js +3 -0
  42. package/models/User/types.d.ts +1 -9
  43. package/package.json +1 -1
@@ -0,0 +1,71 @@
1
+ import { PlanPeriod, PlansGroup } from '../helpers/plans';
2
+ export declare namespace CustomerFbFunctionsTypes {
3
+ interface PublishParams {
4
+ customerId: string;
5
+ country: string;
6
+ displayName: string;
7
+ howDidYouHearAboutUs: string;
8
+ CIF: string | null;
9
+ }
10
+ type PublishResult = void;
11
+ interface CreateParams {
12
+ customerId: string;
13
+ displayName: string;
14
+ }
15
+ type CreateResult = void;
16
+ interface EditParams {
17
+ customerId: string;
18
+ howDidYouHearAboutUs: string;
19
+ gocardlessCustomerId: string;
20
+ }
21
+ type EditResult = void;
22
+ interface RemoveParams {
23
+ customerId: string;
24
+ }
25
+ type RemoveResult = void;
26
+ interface AddConfirmedAdminParams {
27
+ customerId: string;
28
+ userId: string;
29
+ }
30
+ type AddConfirmedAdminResult = void;
31
+ interface RemoveAdminParams {
32
+ customerId: string;
33
+ email: string;
34
+ }
35
+ type RemoveAdminResult = void;
36
+ interface GetGocardlessMandateParams {
37
+ customerId: string;
38
+ }
39
+ interface GetGocardlessMandateResult {
40
+ url: string;
41
+ }
42
+ interface StripeSessionParams {
43
+ customerId: string;
44
+ groupId: string;
45
+ planId: PlansGroup;
46
+ planPeriod: PlanPeriod;
47
+ }
48
+ interface StripeSessionResult {
49
+ url: string;
50
+ }
51
+ interface StripeBillingPortalParams {
52
+ customerId: string;
53
+ }
54
+ interface StripeBillingPortalResult {
55
+ url: string;
56
+ }
57
+ interface GetInvoicesParams {
58
+ customerId: string;
59
+ }
60
+ interface InvoiceItem {
61
+ id: string;
62
+ amount: number;
63
+ currency: string;
64
+ created: number;
65
+ number: string;
66
+ link: string | null;
67
+ }
68
+ interface GetInvoicesResult {
69
+ invoices: InvoiceItem[];
70
+ }
71
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,21 @@
1
+ import { PlanPeriod, PlansGroup } from '../helpers/plans';
2
+ export declare namespace CustomerGroupFbFunctionsTypes {
3
+ interface AddParams {
4
+ customerId: string;
5
+ groupId: string;
6
+ }
7
+ type AddResult = void;
8
+ interface SetPlanParams {
9
+ customerId: string;
10
+ groupId: string;
11
+ planId: PlansGroup;
12
+ planPeriod: PlanPeriod;
13
+ planDiscount: string | null;
14
+ }
15
+ type SetPlanResult = void;
16
+ interface RemoveParams {
17
+ customerId: string;
18
+ groupId: string;
19
+ }
20
+ type RemoveResult = void;
21
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +1,19 @@
1
1
  export declare enum FbFunctionName {
2
2
  Auth = "auth",
3
- FederationGetConfederation = "federation-getConfederation",
3
+ CustomerAddConfirmedAdmin = "customer-addConfirmedAdmin",
4
+ CustomerPublish = "customer-publish",
5
+ CustomerCreate = "customer-create",
6
+ CustomerRemove = "customer-remove",
7
+ CustomerEdit = "customer-edit",
8
+ CustomerGetInvoices = "customer-getInvoices",
9
+ CustomerGetGocardlessMandate = "customer-getGocardlessMandate",
10
+ CustomerOnUpdate = "customer-onUpdate",
11
+ CustomerRemoveAdmin = "customer-removeAdmin",
12
+ CustomerStripeSession = "customer-stripeSession",
13
+ CustomerStripeBillingPortal = "customer-stripeBillingPortal",
14
+ CustomerGroupAdd = "customerGroup-add",
15
+ CustomerGroupSetPlan = "customerGroup-setPlan",
16
+ CustomerGroupRemove = "customerGroup-remove",
4
17
  CommunicationCommentPublish = "communicationComment-publish",
5
18
  CommunicationEdit = "communication-edit",
6
19
  CommunicationPublish = "communication-publish",
@@ -23,6 +36,7 @@ export declare enum FbFunctionName {
23
36
  EventSetRollcall = "event-setRollCall",
24
37
  FederationAddConfirmedAdmin = "federation-addConfirmedAdmin",
25
38
  FederationAddPendingAdmin = "federation-addPendingAdmin",
39
+ FederationGetConfederation = "federation-getConfederation",
26
40
  FederationConfirmAdmin = "federation-confirmAdmin",
27
41
  FederationCreate = "federation-create",
28
42
  FederationEdit = "federation-edit",
@@ -74,19 +88,13 @@ export declare enum FbFunctionName {
74
88
  MiscValidateUsername = "misc-validateUsername",
75
89
  NotificationMarkAllAsReaded = "notification-markAllAsReaded",
76
90
  PartnershipAddConfirmedAdmin = "partnership-addConfirmedAdmin",
77
- PartnershipPublish = "partnership-publish",
78
91
  PartnershipCreate = "partnership-create",
79
92
  PartnershipRemove = "partnership-remove",
80
93
  PartnershipEdit = "partnership-edit",
81
- PartnershipGetInvoices = "partnership-getInvoices",
82
- PartnershipGetGocardlessMandate = "partnership-getGocardlessMandate",
83
- PartnershipGroupAdd = "partnershipGroup-add",
84
- PartnershipGroupSetPlan = "partnershipGroup-setPlan",
85
- PartnershipGroupRemove = "partnershipGroup-remove",
86
94
  PartnershipOnUpdate = "partnership-onUpdate",
87
95
  PartnershipRemoveAdmin = "partnership-removeAdmin",
88
- PartnershipStripeSession = "partnership-stripeSession",
89
- PartnershipStripeBillingPortal = "partnership-stripeBillingPortal",
96
+ PartnershipGroupAdd = "partnershipGroup-add",
97
+ PartnershipGroupRemove = "partnershipGroup-remove",
90
98
  ReminderEvening = "reminder-evening",
91
99
  ReminderMorning = "reminder-morning",
92
100
  ReminderRollCall = "reminder-rollCall",
@@ -4,7 +4,20 @@ exports.FbFunctionName = void 0;
4
4
  var FbFunctionName;
5
5
  (function (FbFunctionName) {
6
6
  FbFunctionName["Auth"] = "auth";
7
- FbFunctionName["FederationGetConfederation"] = "federation-getConfederation";
7
+ FbFunctionName["CustomerAddConfirmedAdmin"] = "customer-addConfirmedAdmin";
8
+ FbFunctionName["CustomerPublish"] = "customer-publish";
9
+ FbFunctionName["CustomerCreate"] = "customer-create";
10
+ FbFunctionName["CustomerRemove"] = "customer-remove";
11
+ FbFunctionName["CustomerEdit"] = "customer-edit";
12
+ FbFunctionName["CustomerGetInvoices"] = "customer-getInvoices";
13
+ FbFunctionName["CustomerGetGocardlessMandate"] = "customer-getGocardlessMandate";
14
+ FbFunctionName["CustomerOnUpdate"] = "customer-onUpdate";
15
+ FbFunctionName["CustomerRemoveAdmin"] = "customer-removeAdmin";
16
+ FbFunctionName["CustomerStripeSession"] = "customer-stripeSession";
17
+ FbFunctionName["CustomerStripeBillingPortal"] = "customer-stripeBillingPortal";
18
+ FbFunctionName["CustomerGroupAdd"] = "customerGroup-add";
19
+ FbFunctionName["CustomerGroupSetPlan"] = "customerGroup-setPlan";
20
+ FbFunctionName["CustomerGroupRemove"] = "customerGroup-remove";
8
21
  FbFunctionName["CommunicationCommentPublish"] = "communicationComment-publish";
9
22
  FbFunctionName["CommunicationEdit"] = "communication-edit";
10
23
  FbFunctionName["CommunicationPublish"] = "communication-publish";
@@ -27,6 +40,7 @@ var FbFunctionName;
27
40
  FbFunctionName["EventSetRollcall"] = "event-setRollCall";
28
41
  FbFunctionName["FederationAddConfirmedAdmin"] = "federation-addConfirmedAdmin";
29
42
  FbFunctionName["FederationAddPendingAdmin"] = "federation-addPendingAdmin";
43
+ FbFunctionName["FederationGetConfederation"] = "federation-getConfederation";
30
44
  FbFunctionName["FederationConfirmAdmin"] = "federation-confirmAdmin";
31
45
  FbFunctionName["FederationCreate"] = "federation-create";
32
46
  FbFunctionName["FederationEdit"] = "federation-edit";
@@ -78,19 +92,13 @@ var FbFunctionName;
78
92
  FbFunctionName["MiscValidateUsername"] = "misc-validateUsername";
79
93
  FbFunctionName["NotificationMarkAllAsReaded"] = "notification-markAllAsReaded";
80
94
  FbFunctionName["PartnershipAddConfirmedAdmin"] = "partnership-addConfirmedAdmin";
81
- FbFunctionName["PartnershipPublish"] = "partnership-publish";
82
95
  FbFunctionName["PartnershipCreate"] = "partnership-create";
83
96
  FbFunctionName["PartnershipRemove"] = "partnership-remove";
84
97
  FbFunctionName["PartnershipEdit"] = "partnership-edit";
85
- FbFunctionName["PartnershipGetInvoices"] = "partnership-getInvoices";
86
- FbFunctionName["PartnershipGetGocardlessMandate"] = "partnership-getGocardlessMandate";
87
- FbFunctionName["PartnershipGroupAdd"] = "partnershipGroup-add";
88
- FbFunctionName["PartnershipGroupSetPlan"] = "partnershipGroup-setPlan";
89
- FbFunctionName["PartnershipGroupRemove"] = "partnershipGroup-remove";
90
98
  FbFunctionName["PartnershipOnUpdate"] = "partnership-onUpdate";
91
99
  FbFunctionName["PartnershipRemoveAdmin"] = "partnership-removeAdmin";
92
- FbFunctionName["PartnershipStripeSession"] = "partnership-stripeSession";
93
- FbFunctionName["PartnershipStripeBillingPortal"] = "partnership-stripeBillingPortal";
100
+ FbFunctionName["PartnershipGroupAdd"] = "partnershipGroup-add";
101
+ FbFunctionName["PartnershipGroupRemove"] = "partnershipGroup-remove";
94
102
  FbFunctionName["ReminderEvening"] = "reminder-evening";
95
103
  FbFunctionName["ReminderMorning"] = "reminder-morning";
96
104
  FbFunctionName["ReminderRollCall"] = "reminder-rollCall";
@@ -1,13 +1,4 @@
1
- import { PlanPeriod, PlansGroup } from '../helpers/plans';
2
1
  export declare namespace PartnershipFbFunctionsTypes {
3
- interface PublishParams {
4
- partnershipId: string;
5
- country: string;
6
- displayName: string;
7
- howDidYouHearAboutUs: string;
8
- CIF: string | null;
9
- }
10
- type PublishResult = void;
11
2
  interface CreateParams {
12
3
  partnershipId: string;
13
4
  displayName: string;
@@ -15,8 +6,6 @@ export declare namespace PartnershipFbFunctionsTypes {
15
6
  type CreateResult = void;
16
7
  interface EditParams {
17
8
  partnershipId: string;
18
- howDidYouHearAboutUs: string;
19
- gocardlessCustomerId: string;
20
9
  }
21
10
  type EditResult = void;
22
11
  interface RemoveParams {
@@ -33,39 +22,4 @@ export declare namespace PartnershipFbFunctionsTypes {
33
22
  email: string;
34
23
  }
35
24
  type RemoveAdminResult = void;
36
- interface GetGocardlessMandateParams {
37
- partnershipId: string;
38
- }
39
- interface GetGocardlessMandateResult {
40
- url: string;
41
- }
42
- interface StripeSessionParams {
43
- partnershipId: string;
44
- groupId: string;
45
- planId: PlansGroup;
46
- planPeriod: PlanPeriod;
47
- }
48
- interface StripeSessionResult {
49
- url: string;
50
- }
51
- interface StripeBillingPortalParams {
52
- partnershipId: string;
53
- }
54
- interface StripeBillingPortalResult {
55
- url: string;
56
- }
57
- interface GetInvoicesParams {
58
- partnershipId: string;
59
- }
60
- interface InvoiceItem {
61
- id: string;
62
- amount: number;
63
- currency: string;
64
- created: number;
65
- number: string;
66
- link: string | null;
67
- }
68
- interface GetInvoicesResult {
69
- invoices: InvoiceItem[];
70
- }
71
25
  }
@@ -0,0 +1,21 @@
1
+ import { PlanPeriod, PlansGroup } from '../helpers/plans';
2
+ export declare namespace PartnershipGroupFbFunctionsTypes {
3
+ interface AddParams {
4
+ partnershipId: string;
5
+ groupId: string;
6
+ }
7
+ type AddResult = void;
8
+ interface SetPlanParams {
9
+ partnershipId: string;
10
+ groupId: string;
11
+ planId: PlansGroup;
12
+ planPeriod: PlanPeriod;
13
+ planDiscount: string | null;
14
+ }
15
+ type SetPlanResult = void;
16
+ interface RemoveParams {
17
+ partnershipId: string;
18
+ groupId: string;
19
+ }
20
+ type RemoveResult = void;
21
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,18 +1,9 @@
1
- import { PlanPeriod, PlansGroup } from '../helpers/plans';
2
1
  export declare namespace PartnershipGroupFbFunctionsTypes {
3
2
  interface AddParams {
4
3
  partnershipId: string;
5
4
  groupId: string;
6
5
  }
7
6
  type AddResult = void;
8
- interface SetPlanParams {
9
- partnershipId: string;
10
- groupId: string;
11
- planId: PlansGroup;
12
- planPeriod: PlanPeriod;
13
- planDiscount: string | null;
14
- }
15
- type SetPlanResult = void;
16
7
  interface RemoveParams {
17
8
  partnershipId: string;
18
9
  groupId: string;
@@ -16,6 +16,20 @@ const regionByFunctions = {
16
16
  [index_1.FbFunctionName.UserRemove]: GCloudRegions.EuropeWest6,
17
17
  [index_1.FbFunctionName.UserOnLogin]: GCloudRegions.EuropeWest6,
18
18
  [index_1.FbFunctionName.UserOnSignUp]: GCloudRegions.EuropeWest6,
19
+ [index_1.FbFunctionName.CustomerAddConfirmedAdmin]: GCloudRegions.EuropeWest6,
20
+ [index_1.FbFunctionName.CustomerPublish]: GCloudRegions.EuropeWest6,
21
+ [index_1.FbFunctionName.CustomerCreate]: GCloudRegions.EuropeWest6,
22
+ [index_1.FbFunctionName.CustomerRemove]: GCloudRegions.EuropeWest6,
23
+ [index_1.FbFunctionName.CustomerEdit]: GCloudRegions.EuropeWest6,
24
+ [index_1.FbFunctionName.CustomerGetInvoices]: GCloudRegions.EuropeWest6,
25
+ [index_1.FbFunctionName.CustomerGetGocardlessMandate]: GCloudRegions.EuropeWest6,
26
+ [index_1.FbFunctionName.CustomerOnUpdate]: GCloudRegions.EuropeWest6,
27
+ [index_1.FbFunctionName.CustomerRemoveAdmin]: GCloudRegions.EuropeWest6,
28
+ [index_1.FbFunctionName.CustomerStripeSession]: GCloudRegions.EuropeWest6,
29
+ [index_1.FbFunctionName.CustomerStripeBillingPortal]: GCloudRegions.EuropeWest6,
30
+ [index_1.FbFunctionName.CustomerGroupAdd]: GCloudRegions.EuropeWest6,
31
+ [index_1.FbFunctionName.CustomerGroupSetPlan]: GCloudRegions.EuropeWest6,
32
+ [index_1.FbFunctionName.CustomerGroupRemove]: GCloudRegions.EuropeWest6,
19
33
  [index_1.FbFunctionName.JWTGenerate]: GCloudRegions.EuropeWest6,
20
34
  [index_1.FbFunctionName.GroupPublish]: GCloudRegions.EuropeWest6,
21
35
  [index_1.FbFunctionName.GroupEdit]: GCloudRegions.EuropeWest6,
@@ -84,19 +98,13 @@ const regionByFunctions = {
84
98
  [index_1.FbFunctionName.FederationGetConfederation]: GCloudRegions.EuropeWest6,
85
99
  [index_1.FbFunctionName.MiscValidateUsername]: GCloudRegions.UsCentral1,
86
100
  [index_1.FbFunctionName.NotificationMarkAllAsReaded]: GCloudRegions.UsCentral1,
87
- [index_1.FbFunctionName.PartnershipPublish]: GCloudRegions.EuropeWest6,
88
101
  [index_1.FbFunctionName.PartnershipCreate]: GCloudRegions.EuropeWest6,
89
102
  [index_1.FbFunctionName.PartnershipEdit]: GCloudRegions.EuropeWest6,
90
103
  [index_1.FbFunctionName.PartnershipRemove]: GCloudRegions.EuropeWest6,
91
104
  [index_1.FbFunctionName.PartnershipOnUpdate]: GCloudRegions.EuropeWest6,
92
105
  [index_1.FbFunctionName.PartnershipAddConfirmedAdmin]: GCloudRegions.EuropeWest6,
93
106
  [index_1.FbFunctionName.PartnershipRemoveAdmin]: GCloudRegions.EuropeWest6,
94
- [index_1.FbFunctionName.PartnershipStripeSession]: GCloudRegions.EuropeWest6,
95
- [index_1.FbFunctionName.PartnershipStripeBillingPortal]: GCloudRegions.EuropeWest6,
96
- [index_1.FbFunctionName.PartnershipGetInvoices]: GCloudRegions.EuropeWest6,
97
- [index_1.FbFunctionName.PartnershipGetGocardlessMandate]: GCloudRegions.EuropeWest6,
98
107
  [index_1.FbFunctionName.PartnershipGroupAdd]: GCloudRegions.EuropeWest6,
99
- [index_1.FbFunctionName.PartnershipGroupSetPlan]: GCloudRegions.EuropeWest6,
100
108
  [index_1.FbFunctionName.PartnershipGroupRemove]: GCloudRegions.EuropeWest6,
101
109
  [index_1.FbFunctionName.MiscAddSubscriber]: GCloudRegions.EuropeWest6,
102
110
  [index_1.FbFunctionName.Auth]: GCloudRegions.UsCentral1,
package/helpers/auth.d.ts CHANGED
@@ -1,11 +1,13 @@
1
1
  import { FbFunctionName } from '../functions';
2
2
  import { LanguagesTypes } from '../lang';
3
+ import { CustomerRoles } from '../models/Customer/types';
3
4
  import { GroupPlayerRole } from '../models/Group/Player/types';
4
5
  import { PartnershipRoles } from '../models/Partnership/types';
5
6
  export interface AuthUserClaims {
6
7
  groups?: Record<string, GroupPlayerRole>;
7
8
  federation?: string;
8
9
  partnerships?: Record<string, PartnershipRoles>;
10
+ customers?: Record<string, CustomerRoles>;
9
11
  superAdmin?: boolean;
10
12
  besm?: boolean;
11
13
  }
@@ -1,6 +1,8 @@
1
1
  export declare enum CollectionNames {
2
2
  Communication = "communication",
3
3
  CommunicationComments = "comments",
4
+ Customer = "customer",
5
+ CustomerGroups = "groups",
4
6
  Notification = "notification",
5
7
  User = "user",
6
8
  UserGroups = "groups",
@@ -5,6 +5,8 @@ var CollectionNames;
5
5
  (function (CollectionNames) {
6
6
  CollectionNames["Communication"] = "communication";
7
7
  CollectionNames["CommunicationComments"] = "comments";
8
+ CollectionNames["Customer"] = "customer";
9
+ CollectionNames["CustomerGroups"] = "groups";
8
10
  CollectionNames["Notification"] = "notification";
9
11
  CollectionNames["User"] = "user";
10
12
  CollectionNames["UserGroups"] = "groups";
@@ -27,6 +27,9 @@ export declare enum HttpsErrorMessages {
27
27
  InvalidAdminFederation = "error.federation.noAdmin",
28
28
  InvalidFederation = "error.federation.noActive",
29
29
  InvalidInstrument = "error.instrument.noValid",
30
+ InvalidCustomer = "error.customer.noValid",
31
+ InvalidCustomerGroup = "error.customerGroup.noValid",
32
+ InvalidCustomerAdmin = "error.customer.noAdmin",
30
33
  AdminAlreadyExists = "error.admin.alreadyExists",
31
34
  AdminDoesNotExists = "error.admin.notExists",
32
35
  FederationErrorMailerSend = "error.federation.mailNotSent",
package/helpers/errors.js CHANGED
@@ -31,6 +31,9 @@ var HttpsErrorMessages;
31
31
  HttpsErrorMessages["InvalidAdminFederation"] = "error.federation.noAdmin";
32
32
  HttpsErrorMessages["InvalidFederation"] = "error.federation.noActive";
33
33
  HttpsErrorMessages["InvalidInstrument"] = "error.instrument.noValid";
34
+ HttpsErrorMessages["InvalidCustomer"] = "error.customer.noValid";
35
+ HttpsErrorMessages["InvalidCustomerGroup"] = "error.customerGroup.noValid";
36
+ HttpsErrorMessages["InvalidCustomerAdmin"] = "error.customer.noAdmin";
34
37
  HttpsErrorMessages["AdminAlreadyExists"] = "error.admin.alreadyExists";
35
38
  HttpsErrorMessages["AdminDoesNotExists"] = "error.admin.notExists";
36
39
  HttpsErrorMessages["FederationErrorMailerSend"] = "error.federation.mailNotSent";
@@ -58,7 +58,10 @@ const replaceKeysNotification = (text, values, lang) => {
58
58
  return text.replace(placeholder, instrument.name.toLowerCase());
59
59
  }
60
60
  case PlaceholderType.Date: {
61
- const [datetimeProp, timezoneProp] = path.pop()?.slice(1, -1).replace(' ', '').split(',') || [];
61
+ const lastPath = path.pop();
62
+ const [datetimeProp, timezoneProp] = lastPath
63
+ ? lastPath.slice(1, -1).replace(' ', '').split(',')
64
+ : [];
62
65
  const datetime = (0, lodash_1.get)(newValues, [...path, datetimeProp]);
63
66
  if (!datetime)
64
67
  return text.replace(placeholder, '');
@@ -0,0 +1,37 @@
1
+ import { EventoFbFunctionsTypes } from '../functions/event';
2
+ import { NotificationActions } from '../models/Notification/types';
3
+ import { UserNotificationSettings } from '../models/User/types';
4
+ import { BadgesTypes } from './badges';
5
+ export declare const notificationActionsBadges: Record<BadgesTypes, {
6
+ firstLevel: NotificationActions;
7
+ upLevel: NotificationActions;
8
+ }>;
9
+ export declare enum NotificationEventActions {
10
+ Create = "create",
11
+ Cancel = "cancel",
12
+ EditAttendance = "editAttendance",
13
+ EditComments = "editComments",
14
+ EditDatetime = "editDatetime",
15
+ EditLocality = "editLocality",
16
+ EditRepertory = "editRepertory",
17
+ EditStage = "editStage",
18
+ EditTitle = "editTitle",
19
+ AddPlayers = "addPlayers",
20
+ RemovePlayer = "removePlayers",
21
+ ConfirmAssistance = "confirmAssistance",
22
+ DeclineAssistance = "declineAssistance",
23
+ Reminder = "reminder",
24
+ ReminderEveningConfirm = "reminderEveningConfirm",
25
+ ReminderEveningPending = "reminderEveningPending",
26
+ ReminderMorningConfirm = "reminderMorningConfirm",
27
+ ReminderMorningPending = "reminderMorningPending",
28
+ ReminderRollcall = "reminderRollcall"
29
+ }
30
+ type RealtionScopeToNotification = Record<EventoFbFunctionsTypes.EditScope, NotificationEventActions>;
31
+ export declare const editScopeToAction: RealtionScopeToNotification;
32
+ type RelationActionNotification = Record<NotificationEventActions, NotificationActions>;
33
+ export declare const notificationPerformance: RelationActionNotification;
34
+ export declare const notificationSinglePractice: RelationActionNotification;
35
+ export declare const notificationMultiplePractice: RelationActionNotification;
36
+ export declare const userNotificationSettings: Record<UserNotificationSettings, NotificationActions[]>;
37
+ export {};
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.userNotificationSettings = exports.notificationMultiplePractice = exports.notificationSinglePractice = exports.notificationPerformance = exports.editScopeToAction = exports.NotificationEventActions = exports.notificationActionsBadges = void 0;
4
+ const types_1 = require("../models/Notification/types");
5
+ const types_2 = require("../models/User/types");
6
+ const badges_1 = require("./badges");
7
+ exports.notificationActionsBadges = {
8
+ [badges_1.BadgesTypes.AccPerformances]: {
9
+ firstLevel: types_1.NotificationActions.BadgeAccPerformancesFirstLevel,
10
+ upLevel: types_1.NotificationActions.BadgeAccPerformancesUpLevel,
11
+ },
12
+ [badges_1.BadgesTypes.AccPractices]: {
13
+ firstLevel: types_1.NotificationActions.BadgeAccPracticesFirstLevel,
14
+ upLevel: types_1.NotificationActions.BadgeAccPracticesUpLevel,
15
+ },
16
+ [badges_1.BadgesTypes.AnswerEvents]: {
17
+ firstLevel: types_1.NotificationActions.BadgeAnswerEventsFirstLevel,
18
+ upLevel: types_1.NotificationActions.BadgeAnswerEventsUpLevel,
19
+ },
20
+ [badges_1.BadgesTypes.StrikePractices]: {
21
+ firstLevel: types_1.NotificationActions.BadgeStrikePracticesFirstLevel,
22
+ upLevel: types_1.NotificationActions.BadgeStrikePracticesUpLevel,
23
+ },
24
+ };
25
+ var NotificationEventActions;
26
+ (function (NotificationEventActions) {
27
+ NotificationEventActions["Create"] = "create";
28
+ NotificationEventActions["Cancel"] = "cancel";
29
+ NotificationEventActions["EditAttendance"] = "editAttendance";
30
+ NotificationEventActions["EditComments"] = "editComments";
31
+ NotificationEventActions["EditDatetime"] = "editDatetime";
32
+ NotificationEventActions["EditLocality"] = "editLocality";
33
+ NotificationEventActions["EditRepertory"] = "editRepertory";
34
+ NotificationEventActions["EditStage"] = "editStage";
35
+ NotificationEventActions["EditTitle"] = "editTitle";
36
+ NotificationEventActions["AddPlayers"] = "addPlayers";
37
+ NotificationEventActions["RemovePlayer"] = "removePlayers";
38
+ NotificationEventActions["ConfirmAssistance"] = "confirmAssistance";
39
+ NotificationEventActions["DeclineAssistance"] = "declineAssistance";
40
+ NotificationEventActions["Reminder"] = "reminder";
41
+ NotificationEventActions["ReminderEveningConfirm"] = "reminderEveningConfirm";
42
+ NotificationEventActions["ReminderEveningPending"] = "reminderEveningPending";
43
+ NotificationEventActions["ReminderMorningConfirm"] = "reminderMorningConfirm";
44
+ NotificationEventActions["ReminderMorningPending"] = "reminderMorningPending";
45
+ NotificationEventActions["ReminderRollcall"] = "reminderRollcall";
46
+ })(NotificationEventActions = exports.NotificationEventActions || (exports.NotificationEventActions = {}));
47
+ exports.editScopeToAction = {
48
+ title: NotificationEventActions.EditTitle,
49
+ locality: NotificationEventActions.EditLocality,
50
+ comments: NotificationEventActions.EditComments,
51
+ attendance: NotificationEventActions.EditAttendance,
52
+ stage: NotificationEventActions.EditStage,
53
+ };
54
+ exports.notificationPerformance = {
55
+ cancel: types_1.NotificationActions.PerformanceCancel,
56
+ create: types_1.NotificationActions.PerformanceCreate,
57
+ editAttendance: types_1.NotificationActions.PerformanceEditAttendance,
58
+ editComments: types_1.NotificationActions.PerformanceEditComments,
59
+ editDatetime: types_1.NotificationActions.PerformanceEditDatetime,
60
+ editLocality: types_1.NotificationActions.PerformanceEditLocality,
61
+ editRepertory: types_1.NotificationActions.PerformanceEditRepertory,
62
+ editTitle: types_1.NotificationActions.PerformanceEditTitle,
63
+ editStage: types_1.NotificationActions.PerformanceEditStage,
64
+ addPlayers: types_1.NotificationActions.PerformancePlayersAdd,
65
+ removePlayers: types_1.NotificationActions.PerformancePlayersRemove,
66
+ confirmAssistance: types_1.NotificationActions.PerformanceAssistanceConfirm,
67
+ declineAssistance: types_1.NotificationActions.PerformanceAssistanceDecline,
68
+ reminder: types_1.NotificationActions.PerformanceReminder,
69
+ reminderEveningConfirm: types_1.NotificationActions.PerformanceEveningReminderConfirm,
70
+ reminderEveningPending: types_1.NotificationActions.PerformanceEveningReminderPending,
71
+ reminderMorningConfirm: types_1.NotificationActions.PerformanceMorningReminderConfirm,
72
+ reminderMorningPending: types_1.NotificationActions.PerformanceMorningReminderPending,
73
+ reminderRollcall: types_1.NotificationActions.PerformanceRollCallReminder,
74
+ };
75
+ exports.notificationSinglePractice = {
76
+ cancel: types_1.NotificationActions.PracticeCancel,
77
+ create: types_1.NotificationActions.PracticeCreate,
78
+ editAttendance: types_1.NotificationActions.PracticeEditAttendance,
79
+ editComments: types_1.NotificationActions.PracticeEditComments,
80
+ editDatetime: types_1.NotificationActions.PracticeEditDatetime,
81
+ editLocality: types_1.NotificationActions.PracticeEditLocality,
82
+ editRepertory: types_1.NotificationActions.PracticeEditRepertory,
83
+ editTitle: types_1.NotificationActions.PracticeEditTitle,
84
+ editStage: types_1.NotificationActions.PracticeEditStage,
85
+ addPlayers: types_1.NotificationActions.PracticePlayersAdd,
86
+ removePlayers: types_1.NotificationActions.PracticePlayersRemove,
87
+ confirmAssistance: types_1.NotificationActions.PracticeAssistanceConfirm,
88
+ declineAssistance: types_1.NotificationActions.PracticeAssistanceDecline,
89
+ reminder: types_1.NotificationActions.PracticeReminder,
90
+ reminderEveningConfirm: types_1.NotificationActions.PracticeEveningReminderConfirm,
91
+ reminderEveningPending: types_1.NotificationActions.PracticeEveningReminderPending,
92
+ reminderMorningConfirm: types_1.NotificationActions.PracticeMorningReminderConfirm,
93
+ reminderMorningPending: types_1.NotificationActions.PracticeMorningReminderPending,
94
+ reminderRollcall: types_1.NotificationActions.PracticeRollCallReminder,
95
+ };
96
+ exports.notificationMultiplePractice = {
97
+ cancel: types_1.NotificationActions.PracticesCancel,
98
+ create: types_1.NotificationActions.PracticesCreate,
99
+ editAttendance: types_1.NotificationActions.PracticesEditAttendance,
100
+ editComments: types_1.NotificationActions.PracticesEditComments,
101
+ editDatetime: types_1.NotificationActions.PracticesEditDatetime,
102
+ editLocality: types_1.NotificationActions.PracticesEditLocality,
103
+ editRepertory: types_1.NotificationActions.PracticesEditRepertory,
104
+ editTitle: types_1.NotificationActions.PracticesEditTitle,
105
+ editStage: types_1.NotificationActions.PracticesEditStage,
106
+ addPlayers: types_1.NotificationActions.PracticesPlayersAdd,
107
+ removePlayers: types_1.NotificationActions.PracticesPlayersRemove,
108
+ confirmAssistance: types_1.NotificationActions.PracticeAssistanceConfirm,
109
+ declineAssistance: types_1.NotificationActions.PracticeAssistanceDecline,
110
+ reminder: types_1.NotificationActions.PracticeReminder,
111
+ reminderEveningConfirm: types_1.NotificationActions.PracticeEveningReminderConfirm,
112
+ reminderEveningPending: types_1.NotificationActions.PracticeEveningReminderPending,
113
+ reminderMorningConfirm: types_1.NotificationActions.PracticeMorningReminderConfirm,
114
+ reminderMorningPending: types_1.NotificationActions.PracticeMorningReminderPending,
115
+ reminderRollcall: types_1.NotificationActions.PracticeRollCallReminder,
116
+ };
117
+ exports.userNotificationSettings = {
118
+ [types_2.UserNotificationSettings.AttendanceConfirmed]: [
119
+ types_1.NotificationActions.PerformanceAssistanceConfirm,
120
+ types_1.NotificationActions.PracticeAssistanceConfirm,
121
+ ],
122
+ [types_2.UserNotificationSettings.AttendanceDeclined]: [
123
+ types_1.NotificationActions.PerformanceAssistanceDecline,
124
+ types_1.NotificationActions.PracticeAssistanceDecline,
125
+ ],
126
+ };
@@ -0,0 +1,19 @@
1
+ import { PlansGroup } from '../../../helpers/plans';
2
+ import { LanguagesTypes } from '../../../lang';
3
+ import { DocumentSnapshot } from '../../../types/firestore';
4
+ import GroupBasic from '../../Group/basic';
5
+ import { CustomerGroupData } from './types';
6
+ export default class CustomerGroup extends GroupBasic<CustomerGroupData> {
7
+ constructor(doc: DocumentSnapshot, lang?: LanguagesTypes);
8
+ get linkedAt(): import("../../../types/firestore").Timestamp;
9
+ get linkedBy(): import("../../../types/firestore").DocumentReference<import("../../../types/firestore").DocumentData>;
10
+ get upgradedAt(): import("../../../types/firestore").Timestamp | null;
11
+ get upgradedBy(): import("../../../types/firestore").DocumentReference<import("../../../types/firestore").DocumentData> | null;
12
+ get upgradedMethod(): string | null;
13
+ get planId(): PlansGroup;
14
+ get planPeriod(): import("../../../helpers/plans").PlanPeriod | null;
15
+ get planDiscount(): string | null;
16
+ get planStripeId(): string | null;
17
+ get subscriptionStripeId(): string | null;
18
+ get customerId(): string;
19
+ }
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const get_1 = __importDefault(require("lodash/get"));
7
+ const plans_1 = require("../../../helpers/plans");
8
+ const lang_1 = require("../../../lang");
9
+ const basic_1 = __importDefault(require("../../Group/basic"));
10
+ class CustomerGroup extends basic_1.default {
11
+ constructor(doc, lang = lang_1.defaultLocale) {
12
+ super(doc, lang);
13
+ }
14
+ get linkedAt() {
15
+ return this.data.linkedAt;
16
+ }
17
+ get linkedBy() {
18
+ return this.data.linkedBy;
19
+ }
20
+ get upgradedAt() {
21
+ return this.data.upgradedAt || null;
22
+ }
23
+ get upgradedBy() {
24
+ return this.data.upgradedBy || null;
25
+ }
26
+ get upgradedMethod() {
27
+ return this.data.upgradedMethod || null;
28
+ }
29
+ get planId() {
30
+ return this.data.planId || plans_1.PlansGroup.Piano;
31
+ }
32
+ get planPeriod() {
33
+ return this.data.planPeriod || null;
34
+ }
35
+ get planDiscount() {
36
+ return this.data.planDiscount || null;
37
+ }
38
+ get planStripeId() {
39
+ return this.data.planStripeId || null;
40
+ }
41
+ get subscriptionStripeId() {
42
+ return this.data.subscriptionStripeId || null;
43
+ }
44
+ get customerId() {
45
+ return (0, get_1.default)(this.ref, ['parent', 'parent', 'id']);
46
+ }
47
+ }
48
+ exports.default = CustomerGroup;
@@ -0,0 +1,15 @@
1
+ import { PlanPeriod, PlansGroup } from '../../../helpers/plans';
2
+ import { DocumentReference, Timestamp } from '../../../types/firestore';
3
+ import { GroupBasicData } from '../../Group/types';
4
+ export interface CustomerGroupData extends GroupBasicData {
5
+ upgradedAt: Timestamp | null;
6
+ upgradedBy: DocumentReference | null;
7
+ upgradedMethod: string | null;
8
+ planId: PlansGroup;
9
+ planPeriod: PlanPeriod | null;
10
+ planDiscount: string | null;
11
+ planStripeId: string | null;
12
+ subscriptionStripeId: string | null;
13
+ readonly linkedBy: DocumentReference;
14
+ readonly linkedAt: Timestamp;
15
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,14 @@
1
+ import { DocumentSnapshot } from '../../types/firestore';
2
+ import Model from '../Model';
3
+ import { CustomerBasicData } from './types';
4
+ export default class CustomerBasic<D> extends Model<D & CustomerBasicData> {
5
+ constructor(doc: DocumentSnapshot);
6
+ get basicInfo(): CustomerBasicData;
7
+ get displayName(): string;
8
+ get email(): string;
9
+ get address(): import("../Partner/types").BasicAddressData;
10
+ get displayAddress(): string;
11
+ get phone(): string | null;
12
+ get groupIds(): string[];
13
+ get CIF(): string | null;
14
+ }
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const lodash_1 = require("lodash");
7
+ const Model_1 = __importDefault(require("../Model"));
8
+ class CustomerBasic extends Model_1.default {
9
+ constructor(doc) {
10
+ super(doc);
11
+ }
12
+ get basicInfo() {
13
+ return {
14
+ displayName: this.displayName,
15
+ email: this.email,
16
+ phone: this.phone,
17
+ address: this.address,
18
+ CIF: this.CIF,
19
+ groupIds: this.groupIds,
20
+ };
21
+ }
22
+ get displayName() {
23
+ return this.data.displayName;
24
+ }
25
+ get email() {
26
+ return this.data.email;
27
+ }
28
+ get address() {
29
+ return this.data.address || {};
30
+ }
31
+ get displayAddress() {
32
+ const { street, city, postalCode, province, country } = this.address;
33
+ const fields = [street, postalCode, city, province, country];
34
+ return fields.filter((field) => (0, lodash_1.isString)(field)).join(', ');
35
+ }
36
+ get phone() {
37
+ return this.data.phone;
38
+ }
39
+ get groupIds() {
40
+ return this.data.groupIds || [];
41
+ }
42
+ get CIF() {
43
+ return this.data.CIF || null;
44
+ }
45
+ }
46
+ exports.default = CustomerBasic;
@@ -0,0 +1,24 @@
1
+ import { AdminItemStatus } from '../../helpers/types';
2
+ import { DocumentSnapshot } from '../../types/firestore';
3
+ import CustomerBasic from './basic';
4
+ import { CustomerData } from './types';
5
+ export default class Customer extends CustomerBasic<CustomerData> {
6
+ constructor(doc: DocumentSnapshot);
7
+ get admins(): string[];
8
+ get adminList(): import("../../helpers/types").AdminItem[];
9
+ adminListByStatus(status: AdminItemStatus): import("../../helpers/types").AdminItem[];
10
+ isAdmin(userId: string): boolean;
11
+ get createdAt(): import("../../types/firestore").Timestamp;
12
+ private get deletedAt();
13
+ get isDeleted(): boolean;
14
+ get isActive(): boolean;
15
+ get gocardlessId(): string | null;
16
+ get stripeId(): string | null;
17
+ get stripeTaxIds(): {
18
+ type: string;
19
+ value: string;
20
+ }[];
21
+ get howDidYouHearAboutUs(): string | null;
22
+ get groupIds(): string[];
23
+ get glissandooAdminUrl(): string;
24
+ }
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const collections_1 = require("../../helpers/collections");
7
+ const glissandooAdmin_1 = require("../../helpers/glissandooAdmin");
8
+ const basic_1 = __importDefault(require("./basic"));
9
+ class Customer extends basic_1.default {
10
+ constructor(doc) {
11
+ super(doc);
12
+ }
13
+ get admins() {
14
+ return this.data.administrators || [];
15
+ }
16
+ get adminList() {
17
+ return this.data.administratorsList || [];
18
+ }
19
+ adminListByStatus(status) {
20
+ return this.adminList.filter((item) => item.status === status);
21
+ }
22
+ isAdmin(userId) {
23
+ return this.admins.includes(userId);
24
+ }
25
+ get createdAt() {
26
+ return this.data.createdAt;
27
+ }
28
+ get deletedAt() {
29
+ return this.data.deletedAt || null;
30
+ }
31
+ get isDeleted() {
32
+ return this.deletedAt !== null;
33
+ }
34
+ get isActive() {
35
+ return this.exists && !this.deletedAt;
36
+ }
37
+ get gocardlessId() {
38
+ return this.data.gocardlessId || null;
39
+ }
40
+ get stripeId() {
41
+ return this.data.stripeId || null;
42
+ }
43
+ get stripeTaxIds() {
44
+ return this.data.stripeTaxIds || [];
45
+ }
46
+ get howDidYouHearAboutUs() {
47
+ return this.data.howDidYouHearAboutUs || null;
48
+ }
49
+ get groupIds() {
50
+ return this.data.groupIds || [];
51
+ }
52
+ get glissandooAdminUrl() {
53
+ return (0, glissandooAdmin_1.getGlissandooAdminEntityURL)(collections_1.CollectionNames.Partnership, this.id);
54
+ }
55
+ }
56
+ exports.default = Customer;
@@ -0,0 +1,28 @@
1
+ import { AdminItem } from '../../helpers/types';
2
+ import { DocumentReference, Timestamp } from '../../types/firestore';
3
+ import { BasicAddressData } from '../Partner/types';
4
+ export declare enum CustomerRoles {
5
+ Admin = "admin"
6
+ }
7
+ export interface CustomerBasicData {
8
+ displayName: string;
9
+ email: string;
10
+ phone: string | null;
11
+ address: BasicAddressData;
12
+ CIF: string | null;
13
+ groupIds: string[];
14
+ }
15
+ export interface CustomerData extends CustomerBasicData {
16
+ administrators: string[];
17
+ administratorsList: AdminItem[];
18
+ deletedAt: Timestamp | null;
19
+ gocardlessId: string | null;
20
+ stripeId: string | null;
21
+ stripeTaxIds: {
22
+ type: string;
23
+ value: string;
24
+ }[];
25
+ howDidYouHearAboutUs: string | null;
26
+ readonly createdAt: Timestamp;
27
+ readonly createdBy: DocumentReference;
28
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CustomerRoles = void 0;
4
+ var CustomerRoles;
5
+ (function (CustomerRoles) {
6
+ CustomerRoles["Admin"] = "admin";
7
+ })(CustomerRoles = exports.CustomerRoles || (exports.CustomerRoles = {}));
@@ -38,6 +38,7 @@ export default class Group extends GroupBasic<GroupData> {
38
38
  get isDeleted(): boolean;
39
39
  get intercomId(): string | null;
40
40
  get partnershipId(): string | null;
41
+ get customerId(): string | null;
41
42
  get socialNetworks(): Record<SocialNetwork, string | null>;
42
43
  getSocialNetworkUrl(id: SocialNetwork): string | null;
43
44
  get config(): Record<import("./types").GroupConfig, boolean>;
@@ -111,6 +111,9 @@ class Group extends basic_1.default {
111
111
  get partnershipId() {
112
112
  return this.data.partnershipId || null;
113
113
  }
114
+ get customerId() {
115
+ return this.data.customerId || null;
116
+ }
114
117
  get socialNetworks() {
115
118
  if (this.data.socialNetworks) {
116
119
  return this.data.socialNetworks;
@@ -107,6 +107,7 @@ export interface GroupData extends GroupBasicData {
107
107
  status: GroupStatus;
108
108
  planId: PlansGroup;
109
109
  partnershipId: string | null;
110
+ customerId: string | null;
110
111
  repertoryCount: number;
111
112
  eventCount: Record<EventType, number>;
112
113
  communicationCount: number;
@@ -1,6 +1,6 @@
1
1
  import { CollectionNames } from '../../helpers/collections';
2
2
  import { Timestamp } from '../../types/firestore';
3
- export type AllowCollections = CollectionNames.User | CollectionNames.Group | CollectionNames.Event | CollectionNames.Communication | CollectionNames.GroupRepertory | CollectionNames.Partner | CollectionNames.Partnership;
3
+ export type AllowCollections = CollectionNames.User | CollectionNames.Group | CollectionNames.Event | CollectionNames.Communication | CollectionNames.GroupRepertory | CollectionNames.Partner | CollectionNames.Partnership | CollectionNames.Customer;
4
4
  export interface EntityTypes {
5
5
  total: number;
6
6
  acc: number;
@@ -7,13 +7,21 @@ export default class PartnershipGroup extends GroupBasic<PartnershipGroupData> {
7
7
  constructor(doc: DocumentSnapshot, lang?: LanguagesTypes);
8
8
  get linkedAt(): import("../../../types/firestore").Timestamp;
9
9
  get linkedBy(): import("../../../types/firestore").DocumentReference<import("../../../types/firestore").DocumentData>;
10
+ /** @deprecated use customer */
10
11
  get upgradedAt(): import("../../../types/firestore").Timestamp | null;
12
+ /** @deprecated use customer */
11
13
  get upgradedBy(): import("../../../types/firestore").DocumentReference<import("../../../types/firestore").DocumentData> | null;
14
+ /** @deprecated use customer */
12
15
  get upgradedMethod(): string | null;
16
+ /** @deprecated use customer */
13
17
  get planId(): PlansGroup;
18
+ /** @deprecated use customer */
14
19
  get planPeriod(): import("../../../helpers/plans").PlanPeriod | null;
20
+ /** @deprecated use customer */
15
21
  get planDiscount(): string | null;
22
+ /** @deprecated use customer */
16
23
  get planStripeId(): string | null;
24
+ /** @deprecated use customer */
17
25
  get subscriptionStripeId(): string | null;
18
26
  get partnershipId(): string;
19
27
  }
@@ -17,27 +17,35 @@ class PartnershipGroup extends basic_1.default {
17
17
  get linkedBy() {
18
18
  return this.data.linkedBy;
19
19
  }
20
+ /** @deprecated use customer */
20
21
  get upgradedAt() {
21
22
  return this.data.upgradedAt || null;
22
23
  }
24
+ /** @deprecated use customer */
23
25
  get upgradedBy() {
24
26
  return this.data.upgradedBy || null;
25
27
  }
28
+ /** @deprecated use customer */
26
29
  get upgradedMethod() {
27
30
  return this.data.upgradedMethod || null;
28
31
  }
32
+ /** @deprecated use customer */
29
33
  get planId() {
30
34
  return this.data.planId || plans_1.PlansGroup.Piano;
31
35
  }
36
+ /** @deprecated use customer */
32
37
  get planPeriod() {
33
38
  return this.data.planPeriod || null;
34
39
  }
40
+ /** @deprecated use customer */
35
41
  get planDiscount() {
36
42
  return this.data.planDiscount || null;
37
43
  }
44
+ /** @deprecated use customer */
38
45
  get planStripeId() {
39
46
  return this.data.planStripeId || null;
40
47
  }
48
+ /** @deprecated use customer */
41
49
  get subscriptionStripeId() {
42
50
  return this.data.subscriptionStripeId || null;
43
51
  }
@@ -2,13 +2,21 @@ import { PlanPeriod, PlansGroup } from '../../../helpers/plans';
2
2
  import { DocumentReference, Timestamp } from '../../../types/firestore';
3
3
  import { GroupBasicData } from '../../Group/types';
4
4
  export interface PartnershipGroupData extends GroupBasicData {
5
+ /** @deprecated use customer */
5
6
  upgradedAt: Timestamp | null;
7
+ /** @deprecated use customer */
6
8
  upgradedBy: DocumentReference | null;
9
+ /** @deprecated use customer */
7
10
  upgradedMethod: string | null;
11
+ /** @deprecated use customer */
8
12
  planId: PlansGroup;
13
+ /** @deprecated use customer */
9
14
  planPeriod: PlanPeriod | null;
15
+ /** @deprecated use customer */
10
16
  planDiscount: string | null;
17
+ /** @deprecated use customer */
11
18
  planStripeId: string | null;
19
+ /** @deprecated use customer */
12
20
  subscriptionStripeId: string | null;
13
21
  readonly linkedBy: DocumentReference;
14
22
  readonly linkedAt: Timestamp;
@@ -10,16 +10,21 @@ export default class Partnership extends PartnershipBasic<PartnershipData> {
10
10
  adminListByStatus(status: AdminItemStatus): import("../../helpers/types").AdminItem[];
11
11
  isAdmin(userId: string): boolean;
12
12
  get createdAt(): import("../../types/firestore").Timestamp;
13
- private get deletedAt();
13
+ get createdBy(): import("../../types/firestore").DocumentReference<import("../../types/firestore").DocumentData>;
14
+ get deletedAt(): import("../../types/firestore").Timestamp | null;
14
15
  get isDeleted(): boolean;
15
16
  get isActive(): boolean;
16
17
  get federationIds(): string[];
18
+ /** @deprecated use customer */
17
19
  get gocardlessCustomerId(): string | null;
20
+ /** @deprecated use customer */
18
21
  get stripeCustomerId(): string | null;
22
+ /** @deprecated use customer */
19
23
  get stripeTaxIds(): {
20
24
  type: string;
21
25
  value: string;
22
26
  }[];
27
+ /** @deprecated use customer */
23
28
  get howDidYouHearAboutUs(): string | null;
24
29
  get groupIds(): string[];
25
30
  get glissandooAdminUrl(): string;
@@ -28,6 +28,9 @@ class Partnership extends basic_1.default {
28
28
  get createdAt() {
29
29
  return this.data.createdAt;
30
30
  }
31
+ get createdBy() {
32
+ return this.data.createdBy;
33
+ }
31
34
  get deletedAt() {
32
35
  return this.data.deletedAt || null;
33
36
  }
@@ -40,15 +43,19 @@ class Partnership extends basic_1.default {
40
43
  get federationIds() {
41
44
  return this.data.federationIds || [];
42
45
  }
46
+ /** @deprecated use customer */
43
47
  get gocardlessCustomerId() {
44
48
  return this.data.gocardlessCustomerId || null;
45
49
  }
50
+ /** @deprecated use customer */
46
51
  get stripeCustomerId() {
47
52
  return this.data.stripeCustomerId || null;
48
53
  }
54
+ /** @deprecated use customer */
49
55
  get stripeTaxIds() {
50
56
  return this.data.stripeTaxIds || [];
51
57
  }
58
+ /** @deprecated use customer */
52
59
  get howDidYouHearAboutUs() {
53
60
  return this.data.howDidYouHearAboutUs || null;
54
61
  }
@@ -35,12 +35,16 @@ export interface PartnershipData extends PartnershipBasicData {
35
35
  administratorsList: AdminItem[];
36
36
  deletedAt: Timestamp | null;
37
37
  federationIds: string[];
38
+ /** @deprecated use customer */
38
39
  gocardlessCustomerId: string | null;
40
+ /** @deprecated use customer */
39
41
  stripeCustomerId: string | null;
42
+ /** @deprecated use customer */
40
43
  stripeTaxIds: {
41
44
  type: string;
42
45
  value: string;
43
46
  }[];
47
+ /** @deprecated use customer */
44
48
  howDidYouHearAboutUs: string | null;
45
49
  readonly createdAt: Timestamp;
46
50
  readonly createdBy: DocumentReference;
@@ -41,4 +41,5 @@ export default class User extends UserBasic<UserData> {
41
41
  get registerVia(): import("./types").UserRegisterVia;
42
42
  get lastAppLoginAt(): import("../../types/firestore").Timestamp | null;
43
43
  get glissandooAdminUrl(): string;
44
+ get customerIds(): string[];
44
45
  }
@@ -116,5 +116,8 @@ class User extends basic_1.default {
116
116
  get glissandooAdminUrl() {
117
117
  return (0, glissandooAdmin_1.getGlissandooAdminEntityURL)(collections_1.CollectionNames.User, this.id);
118
118
  }
119
+ get customerIds() {
120
+ return this.data.customerIds || [];
121
+ }
119
122
  }
120
123
  exports.default = User;
@@ -26,15 +26,6 @@ export declare enum UserEventsFilter {
26
26
  Annual = 12,
27
27
  Always = 1000
28
28
  }
29
- export interface DeviceInfo {
30
- app_name: string | null;
31
- app_version: string | null;
32
- device: string | null;
33
- os_name: string | null;
34
- os_version: string | null;
35
- is_tablet: boolean;
36
- last_seen_at: Timestamp;
37
- }
38
29
  export interface UserTinyData {
39
30
  displayName: string;
40
31
  photoURL: string;
@@ -61,6 +52,7 @@ export interface UserData extends UserBasicData {
61
52
  deletedAt: Timestamp | null;
62
53
  partnershipIds: string[];
63
54
  federationId: string | null;
55
+ customerIds: string[];
64
56
  groups: string[];
65
57
  groups_admin: string[];
66
58
  birthDate: Timestamp | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glissandoo/lib",
3
- "version": "1.40.1",
3
+ "version": "1.41.0",
4
4
  "description": "Glissandoo library js",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",