@glissandoo/lib 1.108.12 → 1.108.14

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.
@@ -147,6 +147,8 @@ export declare enum FbFunctionName {
147
147
  PartnershipPartnerRemove = "partnershipPartner-remove",
148
148
  PartnershipPartnerRequest = "partnershipPartner-request",
149
149
  PartnershipPartnerAccept = "partnershipPartner-accept",
150
+ PartnershipPartnerPortalGetData = "partnershipPartner-portalGetData",
151
+ PartnershipPartnerPortalEdit = "partnershipPartner-portalEdit",
150
152
  PartnershipPaymentCreateOneTime = "partnershipPayment-createOneTime",
151
153
  PartnershipPaymentGenerateRecurringBySubscriptions = "partnershipPayment-generateRecurringBySubscriptions",
152
154
  PartnershipPaymentEdit = "partnershipPayment-edit",
@@ -151,6 +151,8 @@ var FbFunctionName;
151
151
  FbFunctionName["PartnershipPartnerRemove"] = "partnershipPartner-remove";
152
152
  FbFunctionName["PartnershipPartnerRequest"] = "partnershipPartner-request";
153
153
  FbFunctionName["PartnershipPartnerAccept"] = "partnershipPartner-accept";
154
+ FbFunctionName["PartnershipPartnerPortalGetData"] = "partnershipPartner-portalGetData";
155
+ FbFunctionName["PartnershipPartnerPortalEdit"] = "partnershipPartner-portalEdit";
154
156
  FbFunctionName["PartnershipPaymentCreateOneTime"] = "partnershipPayment-createOneTime";
155
157
  FbFunctionName["PartnershipPaymentGenerateRecurringBySubscriptions"] = "partnershipPayment-generateRecurringBySubscriptions";
156
158
  FbFunctionName["PartnershipPaymentEdit"] = "partnershipPayment-edit";
@@ -1,4 +1,4 @@
1
- import { BasicAddressData } from '../helpers/types';
1
+ import { BasicAddressData, BoardMemberItem } from '../helpers/types';
2
2
  import { GroupCustomFieldOption, GroupCustomFieldType } from '../models/Group/types';
3
3
  import { PartnershipPaymentMethodsConfig, PartnershipSepaCreditorInfo } from '../models/Partnership/types';
4
4
  export declare namespace PartnershipFbFunctionsTypes {
@@ -13,7 +13,9 @@ export declare namespace PartnershipFbFunctionsTypes {
13
13
  interface PublishParams extends CreateData {
14
14
  groupIds: string[];
15
15
  }
16
- type PublishResult = void;
16
+ type PublishResult = {
17
+ id: string;
18
+ };
17
19
  interface CreateParams extends CreateData {
18
20
  partnershipId: string;
19
21
  }
@@ -85,4 +87,101 @@ export declare namespace PartnershipFbFunctionsTypes {
85
87
  paymentMethodsConfig: PartnershipPaymentMethodsConfig | null;
86
88
  customFields: GetPublicInfoCustomField[];
87
89
  }
90
+ interface PortalGetDataParams {
91
+ partnershipId: string;
92
+ }
93
+ interface PortalPartnershipInfo {
94
+ displayName: string;
95
+ photoURL: string;
96
+ email: string;
97
+ phone: string | null;
98
+ address: BasicAddressData;
99
+ CIF: string | null;
100
+ website: string | null;
101
+ description: string | null;
102
+ groupIds: string[];
103
+ }
104
+ interface PortalPartnerInfo {
105
+ id: string;
106
+ name: string;
107
+ lastname: string;
108
+ email: string | null;
109
+ phone: string | null;
110
+ NIF: string | null;
111
+ address: BasicAddressData | null;
112
+ birthDate: number | null;
113
+ paymentMethod: string | null;
114
+ sepaMandate: {
115
+ mandateId: string;
116
+ iban: string;
117
+ holderFullName: string;
118
+ holderAddress: BasicAddressData | null;
119
+ swiftbic: string | null;
120
+ } | null;
121
+ photoURL: string;
122
+ groupIds: string[];
123
+ subscriptions: Record<string, {
124
+ name: string;
125
+ price: number;
126
+ }>;
127
+ customFields: Record<string, string | number | boolean | null>;
128
+ status: string;
129
+ }
130
+ interface PortalCommunication {
131
+ id: string;
132
+ title: string;
133
+ messageHtml: string;
134
+ imageURL: string | null;
135
+ createdAt: number;
136
+ }
137
+ interface PortalEvent {
138
+ id: string;
139
+ displayName: string | null;
140
+ datetime: number;
141
+ datetimeEnd: number;
142
+ locality: string | null;
143
+ type: string;
144
+ groupName: string;
145
+ groupPhotoURL: string;
146
+ groupId: string;
147
+ coverURL: string | null;
148
+ }
149
+ interface PortalGroup {
150
+ id: string;
151
+ displayName: string;
152
+ photoURL: string;
153
+ locality: string;
154
+ description: string | null;
155
+ memberCount: number;
156
+ musicStyle: string;
157
+ }
158
+ interface PortalSubscription {
159
+ id: string;
160
+ planName: string;
161
+ price: number;
162
+ periodInMonths: number;
163
+ nextPaymentDate: number | null;
164
+ }
165
+ interface PortalPayment {
166
+ id: string;
167
+ title: string;
168
+ amount: number;
169
+ status: string;
170
+ paymentMethod: string | null;
171
+ dueDate: number;
172
+ receiptFilePath: string | null;
173
+ }
174
+ interface PortalGetDataResult {
175
+ partnership: PortalPartnershipInfo;
176
+ partner: PortalPartnerInfo;
177
+ communications: PortalCommunication[];
178
+ events: PortalEvent[];
179
+ groups: PortalGroup[];
180
+ boardMembers: BoardMemberItem[];
181
+ subscriptions: PortalSubscription[];
182
+ payments: PortalPayment[];
183
+ customFields: GetPublicInfoCustomField[];
184
+ paymentMethodsConfig: PartnershipPaymentMethodsConfig | null;
185
+ isAdmin: boolean;
186
+ }
88
187
  }
@@ -5,6 +5,7 @@ export declare namespace PartnershipCommunicationFbFunctionsTypes {
5
5
  title: string;
6
6
  message: Descendant[];
7
7
  messageHtml: string;
8
+ imageURL: string | null;
8
9
  recipients: string[];
9
10
  imagesPath: string[];
10
11
  scheduledAt?: string | null;
@@ -21,6 +22,7 @@ export declare namespace PartnershipCommunicationFbFunctionsTypes {
21
22
  partnershipId: string;
22
23
  title: string;
23
24
  messageHtml: string;
25
+ imageURL: string | null;
24
26
  email: string;
25
27
  }
26
28
  type SendTestResult = void;
@@ -30,6 +32,7 @@ export declare namespace PartnershipCommunicationFbFunctionsTypes {
30
32
  title: string;
31
33
  message: Descendant[];
32
34
  messageHtml: string;
35
+ imageURL: string | null;
33
36
  recipients: string[];
34
37
  imagesPath: string[];
35
38
  scheduledAt?: string | null;
@@ -7,7 +7,7 @@ export declare namespace PartnershipPartnerFbFunctionsTypes {
7
7
  NIF: string | null;
8
8
  name: string;
9
9
  lastname: string;
10
- email: string;
10
+ email: string | null;
11
11
  phone: string | null;
12
12
  birthdate: number | null;
13
13
  address: BasicAddressData | null;
@@ -47,5 +47,19 @@ export declare namespace PartnershipPartnerFbFunctionsTypes {
47
47
  partnerId: string;
48
48
  }
49
49
  export type AcceptResult = void;
50
+ export interface PortalEditParams {
51
+ partnershipId: string;
52
+ NIF?: string | null;
53
+ name?: string;
54
+ lastname?: string;
55
+ email?: string;
56
+ phone?: string | null;
57
+ birthdate?: number | null;
58
+ address?: BasicAddressData | null;
59
+ paymentMethod?: PaymentMethod | null;
60
+ sepaMandate?: PartnershipPartnerSepaMandate | null;
61
+ customFieldValues?: Record<string, string | number | null>;
62
+ }
63
+ export type PortalEditResult = void;
50
64
  export {};
51
65
  }
@@ -1,6 +1,7 @@
1
1
  export declare namespace PartnershipSepaPaymentGroupFbFunctionsTypes {
2
2
  interface CreateData {
3
3
  paymentsIds: string[];
4
+ markAsPaid?: boolean;
4
5
  }
5
6
  interface CreateParams extends CreateData {
6
7
  partnershipId: string;
@@ -156,6 +156,8 @@ const regionByFunctions = {
156
156
  [index_1.FbFunctionName.PartnershipPartnerRemove]: GCloudRegions.EuropeWest6,
157
157
  [index_1.FbFunctionName.PartnershipPartnerRequest]: GCloudRegions.EuropeWest6,
158
158
  [index_1.FbFunctionName.PartnershipPartnerAccept]: GCloudRegions.EuropeWest6,
159
+ [index_1.FbFunctionName.PartnershipPartnerPortalGetData]: GCloudRegions.EuropeWest6,
160
+ [index_1.FbFunctionName.PartnershipPartnerPortalEdit]: GCloudRegions.EuropeWest6,
159
161
  [index_1.FbFunctionName.PartnershipPaymentCreateOneTime]: GCloudRegions.EuropeWest6,
160
162
  [index_1.FbFunctionName.PartnershipPaymentGenerateRecurringBySubscriptions]: GCloudRegions.EuropeWest6,
161
163
  [index_1.FbFunctionName.PartnershipPaymentEdit]: GCloudRegions.EuropeWest6,
@@ -6,6 +6,7 @@ export declare enum CollectionNames {
6
6
  Notification = "notification",
7
7
  User = "user",
8
8
  UserGroups = "groups",
9
+ UserPartnerships = "partnerships",
9
10
  UserNotifications = "notifications",
10
11
  UserOfferAlarms = "offerAlarms",
11
12
  Counters = "database",
@@ -10,6 +10,7 @@ var CollectionNames;
10
10
  CollectionNames["Notification"] = "notification";
11
11
  CollectionNames["User"] = "user";
12
12
  CollectionNames["UserGroups"] = "groups";
13
+ CollectionNames["UserPartnerships"] = "partnerships";
13
14
  CollectionNames["UserNotifications"] = "notifications";
14
15
  CollectionNames["UserOfferAlarms"] = "offerAlarms";
15
16
  CollectionNames["Counters"] = "database";
@@ -28,6 +28,7 @@ export declare enum HttpsErrorMessages {
28
28
  InvalidOffer = "error.offer.noValid",
29
29
  InvalidPartnership = "error.partnership.noValid",
30
30
  InvalidAdminPartnership = "error.partnership.noAdmin",
31
+ InvalidPartnershipLastAdmin = "error.partnership.lastAdmin",
31
32
  PartnershipSepaCreditorInfoMissing = "error.partnership.sepaCreditorInfoMissing",
32
33
  InvalidPartnershipPartner = "error.partnershipPartner.noValid",
33
34
  PartnershipPartnerNotSelf = "error.partnershipPartner.notSelf",
package/helpers/errors.js CHANGED
@@ -29,6 +29,7 @@ var HttpsErrorMessages;
29
29
  HttpsErrorMessages["InvalidOffer"] = "error.offer.noValid";
30
30
  HttpsErrorMessages["InvalidPartnership"] = "error.partnership.noValid";
31
31
  HttpsErrorMessages["InvalidAdminPartnership"] = "error.partnership.noAdmin";
32
+ HttpsErrorMessages["InvalidPartnershipLastAdmin"] = "error.partnership.lastAdmin";
32
33
  HttpsErrorMessages["PartnershipSepaCreditorInfoMissing"] = "error.partnership.sepaCreditorInfoMissing";
33
34
  HttpsErrorMessages["InvalidPartnershipPartner"] = "error.partnershipPartner.noValid";
34
35
  HttpsErrorMessages["PartnershipPartnerNotSelf"] = "error.partnershipPartner.notSelf";
@@ -5,6 +5,7 @@ export default class PartnershipCommunication extends ModelWithLang<PartnershipC
5
5
  get title(): string;
6
6
  get message(): import("../../../helpers/slate").Descendant[];
7
7
  get messageHtml(): string;
8
+ get imageURL(): string | null;
8
9
  get messagePlainText(): string;
9
10
  get ownerName(): string;
10
11
  get ownerId(): string;
@@ -19,6 +19,9 @@ class PartnershipCommunication extends lang_1.default {
19
19
  get messageHtml() {
20
20
  return this.data.messageHtml;
21
21
  }
22
+ get imageURL() {
23
+ return this.data.imageURL || null;
24
+ }
22
25
  get messagePlainText() {
23
26
  return (0, slate_1.serializeSlateBlock)(this.message);
24
27
  }
@@ -4,6 +4,7 @@ export interface PartnershipCommunicationData {
4
4
  title: string;
5
5
  message: Descendant[];
6
6
  messageHtml: string;
7
+ imageURL: string | null;
7
8
  ownerName: string;
8
9
  ownerId: string;
9
10
  recipients: string[];
@@ -11,7 +11,7 @@ export default class PartnershipPartner extends ModelWithLang<PartnershipPartner
11
11
  get photoURL(): string;
12
12
  get displayName(): string;
13
13
  get NIF(): string | null;
14
- get email(): string;
14
+ get email(): string | null;
15
15
  get phone(): string | null;
16
16
  get birthdate(): FirebaseFirestore.Timestamp | null;
17
17
  get sepaMandate(): {
@@ -18,7 +18,7 @@ export interface PartnershipPartnerSepaMandate {
18
18
  }
19
19
  export interface PartnershipPartnerData {
20
20
  userId: string | null;
21
- email: string;
21
+ email: string | null;
22
22
  name: string;
23
23
  lastname: string;
24
24
  photoURL: string;
@@ -21,5 +21,6 @@ export default class PartnershipPayment extends ModelWithLang<PartnershipPayment
21
21
  get createdBy(): string | null;
22
22
  get editedAt(): FirebaseFirestore.Timestamp | null;
23
23
  get editedBy(): string | null;
24
+ get receiptFilePath(): string | null;
24
25
  get isActive(): boolean;
25
26
  }
@@ -67,6 +67,9 @@ class PartnershipPayment extends lang_1.default {
67
67
  get editedBy() {
68
68
  return this.data.editedBy || null;
69
69
  }
70
+ get receiptFilePath() {
71
+ return this.data.receiptFilePath || null;
72
+ }
70
73
  get isActive() {
71
74
  return this.exists;
72
75
  }
@@ -28,4 +28,5 @@ export interface PartnershipPaymentData {
28
28
  createdBy: string | null;
29
29
  editedAt: Timestamp | null;
30
30
  editedBy: string | null;
31
+ receiptFilePath: string | null;
31
32
  }
@@ -23,6 +23,7 @@ export default class Partnership extends PartnershipBasic<PartnershipData> {
23
23
  get boardRoles(): string[];
24
24
  get boardMembers(): import("../../helpers/types").BoardMemberItem[];
25
25
  get boardDocuments(): import("../../helpers/types").BoardDocumentItem[];
26
+ get language(): import("../../lang").LanguagesTypes;
26
27
  get customFields(): Record<string, import("../Group/types").GroupCustomField>;
27
28
  get customFieldsList(): APartnershipCustomField[];
28
29
  }
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const collections_1 = require("../../helpers/collections");
7
7
  const glissandooAdmin_1 = require("../../helpers/glissandooAdmin");
8
+ const lang_1 = require("../../lang");
8
9
  const basic_1 = __importDefault(require("./basic"));
9
10
  class Partnership extends basic_1.default {
10
11
  get description() {
@@ -70,6 +71,9 @@ class Partnership extends basic_1.default {
70
71
  get boardDocuments() {
71
72
  return this.data.boardDocuments || [];
72
73
  }
74
+ get language() {
75
+ return this.data.language || lang_1.defaultLocale;
76
+ }
73
77
  get customFields() {
74
78
  return this.data.customFields || {};
75
79
  }
@@ -1,5 +1,6 @@
1
1
  import { DocumentReference, Timestamp } from '@google-cloud/firestore';
2
2
  import { AdminItem, BasicAddressData, BoardDocumentItem, BoardMemberItem } from '../../helpers/types';
3
+ import { LanguagesTypes } from '../../lang';
3
4
  import { AGroupCustomField, GroupCustomField } from '../Group/types';
4
5
  export type PartnershipCustomField = GroupCustomField;
5
6
  export type APartnershipCustomField = AGroupCustomField;
@@ -14,6 +15,8 @@ export interface PartnershipSepaCreditorInfo {
14
15
  creditorId: string;
15
16
  iban: string;
16
17
  swiftbic: string;
18
+ accountName?: string;
19
+ cif?: string;
17
20
  }
18
21
  export interface PartnershipTransferInfo {
19
22
  iban: string;
@@ -48,6 +51,7 @@ export interface PartnershipData extends PartnershipBasicData {
48
51
  boardRoles: string[];
49
52
  boardMembers: BoardMemberItem[];
50
53
  boardDocuments: BoardDocumentItem[];
54
+ language: LanguagesTypes;
51
55
  createdAt: Timestamp;
52
56
  createdBy: DocumentReference;
53
57
  editedAt: Timestamp | null;
@@ -9,4 +9,5 @@ export interface UserGroupData extends GroupBasicData {
9
9
  joinedAt: Timestamp;
10
10
  permissions: AdminPermissions[];
11
11
  order: number;
12
+ partnershipId: string | null;
12
13
  }
@@ -0,0 +1,9 @@
1
+ import { DocumentModel } from '../../Model';
2
+ import PartnershipBasic from '../../Partnership/basic';
3
+ import { PartnershipRoles } from '../../Partnership/types';
4
+ import { UserPartnershipData } from './types';
5
+ export default class UserPartnership extends PartnershipBasic<UserPartnershipData> {
6
+ constructor(doc: DocumentModel);
7
+ get role(): PartnershipRoles;
8
+ get isAdmin(): boolean;
9
+ }
@@ -0,0 +1,19 @@
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 basic_1 = __importDefault(require("../../Partnership/basic"));
7
+ const types_1 = require("../../Partnership/types");
8
+ class UserPartnership extends basic_1.default {
9
+ constructor(doc) {
10
+ super(doc);
11
+ }
12
+ get role() {
13
+ return this.data.role;
14
+ }
15
+ get isAdmin() {
16
+ return this.data.role === types_1.PartnershipRoles.Admin;
17
+ }
18
+ }
19
+ exports.default = UserPartnership;
@@ -0,0 +1,4 @@
1
+ import { PartnershipBasicData, PartnershipRoles } from '../../Partnership/types';
2
+ export interface UserPartnershipData extends PartnershipBasicData {
3
+ role: PartnershipRoles;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glissandoo/lib",
3
- "version": "1.108.12",
3
+ "version": "1.108.14",
4
4
  "description": "Glissandoo library js",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",