@glissandoo/lib 1.108.10 → 1.108.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/functions/index.d.ts +11 -0
- package/functions/index.js +11 -0
- package/functions/partnership.d.ts +52 -2
- package/functions/partnershipCommunication.d.ts +38 -0
- package/functions/partnershipCommunication.js +2 -0
- package/functions/partnershipPartner.d.ts +4 -0
- package/functions/regions.js +11 -0
- package/helpers/collections.d.ts +1 -0
- package/helpers/collections.js +1 -0
- package/helpers/types.d.ts +14 -0
- package/models/Partnership/Communication/index.d.ts +21 -0
- package/models/Partnership/Communication/index.js +62 -0
- package/models/Partnership/Communication/types.d.ts +16 -0
- package/models/Partnership/Communication/types.js +2 -0
- package/models/Partnership/Partner/index.d.ts +3 -2
- package/models/Partnership/Partner/index.js +3 -0
- package/models/Partnership/Partner/types.d.ts +3 -1
- package/models/Partnership/basic.d.ts +1 -0
- package/models/Partnership/basic.js +4 -0
- package/models/Partnership/index.d.ts +6 -9
- package/models/Partnership/index.js +13 -7
- package/models/Partnership/types.d.ts +17 -4
- package/models/Partnership/types.js +1 -0
- package/package.json +1 -1
package/functions/index.d.ts
CHANGED
|
@@ -133,6 +133,12 @@ export declare enum FbFunctionName {
|
|
|
133
133
|
PartnershipOnDelete = "partnership-onDelete",
|
|
134
134
|
PartnershipAddConfirmedAdmin = "partnership-addConfirmedAdmin",
|
|
135
135
|
PartnershipRemoveAdmin = "partnership-removeAdmin",
|
|
136
|
+
PartnershipUpdateBoardRole = "partnership-updateBoardRole",
|
|
137
|
+
PartnershipUpdateBoardRoles = "partnership-updateBoardRoles",
|
|
138
|
+
PartnershipAddPendingAdmin = "partnership-addPendingAdmin",
|
|
139
|
+
PartnershipConfirmAdmin = "partnership-confirmAdmin",
|
|
140
|
+
PartnershipGetStatusAdmin = "partnership-getStatusAdmin",
|
|
141
|
+
PartnershipGetPublicInfo = "partnership-getPublicInfo",
|
|
136
142
|
PartnershipGroupAdd = "partnershipGroup-add",
|
|
137
143
|
PartnershipGroupRemove = "partnershipGroup-remove",
|
|
138
144
|
PartnershipPartnerCreate = "partnershipPartner-create",
|
|
@@ -159,6 +165,11 @@ export declare enum FbFunctionName {
|
|
|
159
165
|
PartnershipSubscriptionOnUpdate = "partnershipSubscription-onUpdate",
|
|
160
166
|
PartnershipSubscriptionOnWrite = "partnershipSubscription-onWrite",
|
|
161
167
|
PartnershipSubscriptionRemove = "partnershipSubscription-remove",
|
|
168
|
+
PartnershipCommunicationPublish = "partnershipCommunication-publish",
|
|
169
|
+
PartnershipCommunicationRemove = "partnershipCommunication-remove",
|
|
170
|
+
PartnershipCommunicationSendScheduled = "partnershipCommunication-sendScheduled",
|
|
171
|
+
PartnershipCommunicationSendTest = "partnershipCommunication-sendTest",
|
|
172
|
+
PartnershipCommunicationUpdate = "partnershipCommunication-update",
|
|
162
173
|
ReminderBiweeklyEventsEmail = "reminder-biweeklyEventsEmail",
|
|
163
174
|
ReminderDatetime = "reminder-datetime",
|
|
164
175
|
ReminderResponseDeadlineEnded = "reminder-responseDeadlineEnded",
|
package/functions/index.js
CHANGED
|
@@ -137,6 +137,12 @@ var FbFunctionName;
|
|
|
137
137
|
FbFunctionName["PartnershipOnDelete"] = "partnership-onDelete";
|
|
138
138
|
FbFunctionName["PartnershipAddConfirmedAdmin"] = "partnership-addConfirmedAdmin";
|
|
139
139
|
FbFunctionName["PartnershipRemoveAdmin"] = "partnership-removeAdmin";
|
|
140
|
+
FbFunctionName["PartnershipUpdateBoardRole"] = "partnership-updateBoardRole";
|
|
141
|
+
FbFunctionName["PartnershipUpdateBoardRoles"] = "partnership-updateBoardRoles";
|
|
142
|
+
FbFunctionName["PartnershipAddPendingAdmin"] = "partnership-addPendingAdmin";
|
|
143
|
+
FbFunctionName["PartnershipConfirmAdmin"] = "partnership-confirmAdmin";
|
|
144
|
+
FbFunctionName["PartnershipGetStatusAdmin"] = "partnership-getStatusAdmin";
|
|
145
|
+
FbFunctionName["PartnershipGetPublicInfo"] = "partnership-getPublicInfo";
|
|
140
146
|
FbFunctionName["PartnershipGroupAdd"] = "partnershipGroup-add";
|
|
141
147
|
FbFunctionName["PartnershipGroupRemove"] = "partnershipGroup-remove";
|
|
142
148
|
FbFunctionName["PartnershipPartnerCreate"] = "partnershipPartner-create";
|
|
@@ -163,6 +169,11 @@ var FbFunctionName;
|
|
|
163
169
|
FbFunctionName["PartnershipSubscriptionOnUpdate"] = "partnershipSubscription-onUpdate";
|
|
164
170
|
FbFunctionName["PartnershipSubscriptionOnWrite"] = "partnershipSubscription-onWrite";
|
|
165
171
|
FbFunctionName["PartnershipSubscriptionRemove"] = "partnershipSubscription-remove";
|
|
172
|
+
FbFunctionName["PartnershipCommunicationPublish"] = "partnershipCommunication-publish";
|
|
173
|
+
FbFunctionName["PartnershipCommunicationRemove"] = "partnershipCommunication-remove";
|
|
174
|
+
FbFunctionName["PartnershipCommunicationSendScheduled"] = "partnershipCommunication-sendScheduled";
|
|
175
|
+
FbFunctionName["PartnershipCommunicationSendTest"] = "partnershipCommunication-sendTest";
|
|
176
|
+
FbFunctionName["PartnershipCommunicationUpdate"] = "partnershipCommunication-update";
|
|
166
177
|
FbFunctionName["ReminderBiweeklyEventsEmail"] = "reminder-biweeklyEventsEmail";
|
|
167
178
|
FbFunctionName["ReminderDatetime"] = "reminder-datetime";
|
|
168
179
|
FbFunctionName["ReminderResponseDeadlineEnded"] = "reminder-responseDeadlineEnded";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BasicAddressData } from '../helpers/types';
|
|
2
|
-
import {
|
|
2
|
+
import { GroupCustomFieldOption, GroupCustomFieldType } from '../models/Group/types';
|
|
3
|
+
import { PartnershipPaymentMethodsConfig, PartnershipSepaCreditorInfo } from '../models/Partnership/types';
|
|
3
4
|
export declare namespace PartnershipFbFunctionsTypes {
|
|
4
5
|
interface CreateData {
|
|
5
6
|
displayName: string;
|
|
@@ -19,6 +20,7 @@ export declare namespace PartnershipFbFunctionsTypes {
|
|
|
19
20
|
type CreateResult = void;
|
|
20
21
|
interface EditParams extends CreateData {
|
|
21
22
|
partnershipId: string;
|
|
23
|
+
photoURL?: string;
|
|
22
24
|
}
|
|
23
25
|
type EditResult = void;
|
|
24
26
|
interface RemoveParams {
|
|
@@ -27,7 +29,7 @@ export declare namespace PartnershipFbFunctionsTypes {
|
|
|
27
29
|
type RemoveResult = void;
|
|
28
30
|
interface AddConfirmedAdminParams {
|
|
29
31
|
partnershipId: string;
|
|
30
|
-
|
|
32
|
+
partnerId: string;
|
|
31
33
|
}
|
|
32
34
|
type AddConfirmedAdminResult = void;
|
|
33
35
|
interface RemoveAdminParams {
|
|
@@ -35,4 +37,52 @@ export declare namespace PartnershipFbFunctionsTypes {
|
|
|
35
37
|
email: string;
|
|
36
38
|
}
|
|
37
39
|
type RemoveAdminResult = void;
|
|
40
|
+
interface UpdateBoardRoleParams {
|
|
41
|
+
partnershipId: string;
|
|
42
|
+
partnerId: string | null;
|
|
43
|
+
role: string;
|
|
44
|
+
}
|
|
45
|
+
type UpdateBoardRoleResult = void;
|
|
46
|
+
interface UpdateBoardRolesParams {
|
|
47
|
+
partnershipId: string;
|
|
48
|
+
boardRoles: string[];
|
|
49
|
+
}
|
|
50
|
+
type UpdateBoardRolesResult = void;
|
|
51
|
+
interface AddPendingAdminParams {
|
|
52
|
+
partnershipId: string;
|
|
53
|
+
email: string;
|
|
54
|
+
lang?: string;
|
|
55
|
+
}
|
|
56
|
+
type AddPendingAdminResult = void;
|
|
57
|
+
interface ConfirmAdminParams {
|
|
58
|
+
partnershipId: string;
|
|
59
|
+
}
|
|
60
|
+
type ConfirmAdminResult = void;
|
|
61
|
+
interface GetStatusAdminParams {
|
|
62
|
+
partnershipId: string;
|
|
63
|
+
}
|
|
64
|
+
interface GetStatusAdminResult {
|
|
65
|
+
partnershipName: string;
|
|
66
|
+
photoURL: string;
|
|
67
|
+
}
|
|
68
|
+
interface GetPublicInfoParams {
|
|
69
|
+
partnershipId?: string;
|
|
70
|
+
username?: string;
|
|
71
|
+
}
|
|
72
|
+
interface GetPublicInfoCustomField {
|
|
73
|
+
id: string;
|
|
74
|
+
label: string;
|
|
75
|
+
type: GroupCustomFieldType;
|
|
76
|
+
required: boolean;
|
|
77
|
+
placeholder: string | null;
|
|
78
|
+
options: GroupCustomFieldOption[];
|
|
79
|
+
order: number;
|
|
80
|
+
}
|
|
81
|
+
interface GetPublicInfoResult {
|
|
82
|
+
partnershipId: string;
|
|
83
|
+
displayName: string;
|
|
84
|
+
photoURL: string;
|
|
85
|
+
paymentMethodsConfig: PartnershipPaymentMethodsConfig | null;
|
|
86
|
+
customFields: GetPublicInfoCustomField[];
|
|
87
|
+
}
|
|
38
88
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Descendant } from '../helpers/slate';
|
|
2
|
+
export declare namespace PartnershipCommunicationFbFunctionsTypes {
|
|
3
|
+
interface PublishParams {
|
|
4
|
+
partnershipId: string;
|
|
5
|
+
title: string;
|
|
6
|
+
message: Descendant[];
|
|
7
|
+
messageHtml: string;
|
|
8
|
+
recipients: string[];
|
|
9
|
+
imagesPath: string[];
|
|
10
|
+
scheduledAt?: string | null;
|
|
11
|
+
}
|
|
12
|
+
type PublishResult = {
|
|
13
|
+
id: string;
|
|
14
|
+
};
|
|
15
|
+
interface RemoveParams {
|
|
16
|
+
partnershipId: string;
|
|
17
|
+
communicationId: string;
|
|
18
|
+
}
|
|
19
|
+
type RemoveResult = void;
|
|
20
|
+
interface SendTestParams {
|
|
21
|
+
partnershipId: string;
|
|
22
|
+
title: string;
|
|
23
|
+
messageHtml: string;
|
|
24
|
+
email: string;
|
|
25
|
+
}
|
|
26
|
+
type SendTestResult = void;
|
|
27
|
+
interface UpdateParams {
|
|
28
|
+
partnershipId: string;
|
|
29
|
+
communicationId: string;
|
|
30
|
+
title: string;
|
|
31
|
+
message: Descendant[];
|
|
32
|
+
messageHtml: string;
|
|
33
|
+
recipients: string[];
|
|
34
|
+
imagesPath: string[];
|
|
35
|
+
scheduledAt?: string | null;
|
|
36
|
+
}
|
|
37
|
+
type UpdateResult = void;
|
|
38
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SetOptional } from 'type-fest';
|
|
2
2
|
import { BasicAddressData, CreatedOn } from '../helpers/types';
|
|
3
3
|
import { PartnershipPartnerSepaMandate } from '../models/Partnership/Partner/types';
|
|
4
|
+
import { PaymentMethod } from '../models/Partnership/Payment/types';
|
|
4
5
|
export declare namespace PartnershipPartnerFbFunctionsTypes {
|
|
5
6
|
interface BaseCreateData {
|
|
6
7
|
NIF: string | null;
|
|
@@ -11,6 +12,7 @@ export declare namespace PartnershipPartnerFbFunctionsTypes {
|
|
|
11
12
|
birthdate: number | null;
|
|
12
13
|
address: BasicAddressData | null;
|
|
13
14
|
userId: string | null;
|
|
15
|
+
paymentMethod: PaymentMethod | null;
|
|
14
16
|
}
|
|
15
17
|
export interface CreateData extends BaseCreateData {
|
|
16
18
|
sepaMandate: SetOptional<PartnershipPartnerSepaMandate, 'mandateId'> | null;
|
|
@@ -23,6 +25,7 @@ export declare namespace PartnershipPartnerFbFunctionsTypes {
|
|
|
23
25
|
export type CreateResult = void;
|
|
24
26
|
export interface EditData extends Partial<BaseCreateData> {
|
|
25
27
|
sepaMandate: PartnershipPartnerSepaMandate | null;
|
|
28
|
+
paymentMethod?: PaymentMethod | null;
|
|
26
29
|
}
|
|
27
30
|
export interface EditParams extends EditData {
|
|
28
31
|
partnershipId: string;
|
|
@@ -36,6 +39,7 @@ export declare namespace PartnershipPartnerFbFunctionsTypes {
|
|
|
36
39
|
export type RemoveResult = void;
|
|
37
40
|
export interface RequestParams extends CreateData {
|
|
38
41
|
partnershipId: string;
|
|
42
|
+
customFieldValues?: Record<string, string | number | null>;
|
|
39
43
|
}
|
|
40
44
|
export type RequestResult = void;
|
|
41
45
|
export interface AcceptParams {
|
package/functions/regions.js
CHANGED
|
@@ -142,6 +142,12 @@ const regionByFunctions = {
|
|
|
142
142
|
[index_1.FbFunctionName.PartnershipOnDelete]: GCloudRegions.EuropeWest6,
|
|
143
143
|
[index_1.FbFunctionName.PartnershipAddConfirmedAdmin]: GCloudRegions.EuropeWest6,
|
|
144
144
|
[index_1.FbFunctionName.PartnershipRemoveAdmin]: GCloudRegions.EuropeWest6,
|
|
145
|
+
[index_1.FbFunctionName.PartnershipUpdateBoardRole]: GCloudRegions.EuropeWest6,
|
|
146
|
+
[index_1.FbFunctionName.PartnershipUpdateBoardRoles]: GCloudRegions.EuropeWest6,
|
|
147
|
+
[index_1.FbFunctionName.PartnershipAddPendingAdmin]: GCloudRegions.EuropeWest6,
|
|
148
|
+
[index_1.FbFunctionName.PartnershipConfirmAdmin]: GCloudRegions.EuropeWest6,
|
|
149
|
+
[index_1.FbFunctionName.PartnershipGetStatusAdmin]: GCloudRegions.EuropeWest6,
|
|
150
|
+
[index_1.FbFunctionName.PartnershipGetPublicInfo]: GCloudRegions.EuropeWest6,
|
|
145
151
|
[index_1.FbFunctionName.PartnershipGroupAdd]: GCloudRegions.EuropeWest6,
|
|
146
152
|
[index_1.FbFunctionName.PartnershipGroupRemove]: GCloudRegions.EuropeWest6,
|
|
147
153
|
[index_1.FbFunctionName.PartnershipPartnerCreate]: GCloudRegions.EuropeWest6,
|
|
@@ -168,6 +174,11 @@ const regionByFunctions = {
|
|
|
168
174
|
[index_1.FbFunctionName.PartnershipSubscriptionOnUpdate]: GCloudRegions.EuropeWest6,
|
|
169
175
|
[index_1.FbFunctionName.PartnershipSubscriptionOnWrite]: GCloudRegions.EuropeWest6,
|
|
170
176
|
[index_1.FbFunctionName.PartnershipSubscriptionRemove]: GCloudRegions.EuropeWest6,
|
|
177
|
+
[index_1.FbFunctionName.PartnershipCommunicationPublish]: GCloudRegions.EuropeWest6,
|
|
178
|
+
[index_1.FbFunctionName.PartnershipCommunicationRemove]: GCloudRegions.EuropeWest6,
|
|
179
|
+
[index_1.FbFunctionName.PartnershipCommunicationSendScheduled]: GCloudRegions.EuropeWest6,
|
|
180
|
+
[index_1.FbFunctionName.PartnershipCommunicationSendTest]: GCloudRegions.EuropeWest6,
|
|
181
|
+
[index_1.FbFunctionName.PartnershipCommunicationUpdate]: GCloudRegions.EuropeWest6,
|
|
171
182
|
[index_1.FbFunctionName.ReminderBiweeklyEventsEmail]: GCloudRegions.EuropeWest6,
|
|
172
183
|
[index_1.FbFunctionName.ReminderDatetime]: GCloudRegions.EuropeWest6,
|
|
173
184
|
[index_1.FbFunctionName.ReminderResponseDeadlineEnded]: GCloudRegions.EuropeWest6,
|
package/helpers/collections.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export declare enum CollectionNames {
|
|
|
28
28
|
PartnershipSubscription = "partnershipSubscription",
|
|
29
29
|
PartnershipPayment = "partnershipPayment",
|
|
30
30
|
PartnershipSepaPaymentGroup = "partnershipSepaPaymentGroup",
|
|
31
|
+
PartnershipCommunication = "partnershipCommunication",
|
|
31
32
|
Federation = "federation",
|
|
32
33
|
FederationPartnerships = "partnerships",
|
|
33
34
|
Offer = "offer",
|
package/helpers/collections.js
CHANGED
|
@@ -32,6 +32,7 @@ var CollectionNames;
|
|
|
32
32
|
CollectionNames["PartnershipSubscription"] = "partnershipSubscription";
|
|
33
33
|
CollectionNames["PartnershipPayment"] = "partnershipPayment";
|
|
34
34
|
CollectionNames["PartnershipSepaPaymentGroup"] = "partnershipSepaPaymentGroup";
|
|
35
|
+
CollectionNames["PartnershipCommunication"] = "partnershipCommunication";
|
|
35
36
|
CollectionNames["Federation"] = "federation";
|
|
36
37
|
CollectionNames["FederationPartnerships"] = "partnerships";
|
|
37
38
|
CollectionNames["Offer"] = "offer";
|
package/helpers/types.d.ts
CHANGED
|
@@ -9,6 +9,20 @@ export interface AdminItem {
|
|
|
9
9
|
photoURL: string | null;
|
|
10
10
|
status: AdminItemStatus;
|
|
11
11
|
}
|
|
12
|
+
export interface BoardMemberItem {
|
|
13
|
+
partnerId: string;
|
|
14
|
+
role: string;
|
|
15
|
+
name: string;
|
|
16
|
+
photoURL: string;
|
|
17
|
+
}
|
|
18
|
+
export interface BoardDocumentItem {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
url: string;
|
|
22
|
+
type: string;
|
|
23
|
+
size: number;
|
|
24
|
+
uploadedAt: number;
|
|
25
|
+
}
|
|
12
26
|
export declare enum CreatedOn {
|
|
13
27
|
Auth = "auth",
|
|
14
28
|
Web = "web",
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import ModelWithLang from '../../Model/lang';
|
|
2
|
+
import { PartnershipCommunicationData } from './types';
|
|
3
|
+
export default class PartnershipCommunication extends ModelWithLang<PartnershipCommunicationData> {
|
|
4
|
+
get partnershipId(): string;
|
|
5
|
+
get title(): string;
|
|
6
|
+
get message(): import("../../../helpers/slate").Descendant[];
|
|
7
|
+
get messageHtml(): string;
|
|
8
|
+
get messagePlainText(): string;
|
|
9
|
+
get ownerName(): string;
|
|
10
|
+
get ownerId(): string;
|
|
11
|
+
get recipients(): string[];
|
|
12
|
+
get recipientsCount(): number;
|
|
13
|
+
get imagesPath(): string[];
|
|
14
|
+
get createdAt(): FirebaseFirestore.Timestamp;
|
|
15
|
+
get status(): "sent" | "scheduled";
|
|
16
|
+
get scheduledAt(): FirebaseFirestore.Timestamp | null;
|
|
17
|
+
get isScheduled(): boolean;
|
|
18
|
+
get deletedAt(): FirebaseFirestore.Timestamp | null;
|
|
19
|
+
get isDeleted(): boolean;
|
|
20
|
+
get isActive(): boolean;
|
|
21
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
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 slate_1 = require("../../../helpers/slate");
|
|
7
|
+
const utils_1 = require("../../../helpers/utils");
|
|
8
|
+
const lang_1 = __importDefault(require("../../Model/lang"));
|
|
9
|
+
class PartnershipCommunication extends lang_1.default {
|
|
10
|
+
get partnershipId() {
|
|
11
|
+
return (0, utils_1.at)(this.ref.path.split('/'), 1) || '';
|
|
12
|
+
}
|
|
13
|
+
get title() {
|
|
14
|
+
return this.data.title;
|
|
15
|
+
}
|
|
16
|
+
get message() {
|
|
17
|
+
return this.data.message;
|
|
18
|
+
}
|
|
19
|
+
get messageHtml() {
|
|
20
|
+
return this.data.messageHtml;
|
|
21
|
+
}
|
|
22
|
+
get messagePlainText() {
|
|
23
|
+
return (0, slate_1.serializeSlateBlock)(this.message);
|
|
24
|
+
}
|
|
25
|
+
get ownerName() {
|
|
26
|
+
return this.data.ownerName;
|
|
27
|
+
}
|
|
28
|
+
get ownerId() {
|
|
29
|
+
return this.data.ownerId;
|
|
30
|
+
}
|
|
31
|
+
get recipients() {
|
|
32
|
+
return this.data.recipients || [];
|
|
33
|
+
}
|
|
34
|
+
get recipientsCount() {
|
|
35
|
+
return this.data.recipientsCount || 0;
|
|
36
|
+
}
|
|
37
|
+
get imagesPath() {
|
|
38
|
+
return this.data.imagesPath || [];
|
|
39
|
+
}
|
|
40
|
+
get createdAt() {
|
|
41
|
+
return this.data.createdAt;
|
|
42
|
+
}
|
|
43
|
+
get status() {
|
|
44
|
+
return this.data.status || 'sent';
|
|
45
|
+
}
|
|
46
|
+
get scheduledAt() {
|
|
47
|
+
return this.data.scheduledAt || null;
|
|
48
|
+
}
|
|
49
|
+
get isScheduled() {
|
|
50
|
+
return this.status === 'scheduled';
|
|
51
|
+
}
|
|
52
|
+
get deletedAt() {
|
|
53
|
+
return this.data.deletedAt || null;
|
|
54
|
+
}
|
|
55
|
+
get isDeleted() {
|
|
56
|
+
return !!this.deletedAt;
|
|
57
|
+
}
|
|
58
|
+
get isActive() {
|
|
59
|
+
return this.exists && !this.isDeleted;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.default = PartnershipCommunication;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Timestamp } from '@google-cloud/firestore';
|
|
2
|
+
import { Descendant } from '../../../helpers/slate';
|
|
3
|
+
export interface PartnershipCommunicationData {
|
|
4
|
+
title: string;
|
|
5
|
+
message: Descendant[];
|
|
6
|
+
messageHtml: string;
|
|
7
|
+
ownerName: string;
|
|
8
|
+
ownerId: string;
|
|
9
|
+
recipients: string[];
|
|
10
|
+
recipientsCount: number;
|
|
11
|
+
imagesPath: string[];
|
|
12
|
+
status: 'sent' | 'scheduled';
|
|
13
|
+
scheduledAt: Timestamp | null;
|
|
14
|
+
createdAt: Timestamp;
|
|
15
|
+
deletedAt: Timestamp | null;
|
|
16
|
+
}
|
|
@@ -15,14 +15,15 @@ export default class PartnershipPartner extends ModelWithLang<PartnershipPartner
|
|
|
15
15
|
get phone(): string | null;
|
|
16
16
|
get birthdate(): FirebaseFirestore.Timestamp | null;
|
|
17
17
|
get sepaMandate(): {
|
|
18
|
-
holderDisplayAddress: string;
|
|
18
|
+
holderDisplayAddress: string | null;
|
|
19
19
|
mandateId: string;
|
|
20
20
|
iban: string;
|
|
21
21
|
holderFullName: string;
|
|
22
|
-
holderAddress: import("../../../helpers/types").BasicAddressData;
|
|
22
|
+
holderAddress: import("../../../helpers/types").BasicAddressData | null;
|
|
23
23
|
swiftbic: string | null;
|
|
24
24
|
} | null;
|
|
25
25
|
get address(): import("../../../helpers/types").BasicAddressData | null;
|
|
26
|
+
get paymentMethod(): import("../Payment/types").PaymentMethod | null;
|
|
26
27
|
get displayAddress(): string | null;
|
|
27
28
|
get createdAt(): FirebaseFirestore.Timestamp;
|
|
28
29
|
get createdBy(): import("../../../types/firestore").DocumentReference<import("../../../types/firestore").DocumentData>;
|
|
@@ -52,6 +52,9 @@ class PartnershipPartner extends lang_1.default {
|
|
|
52
52
|
get address() {
|
|
53
53
|
return this.data.address;
|
|
54
54
|
}
|
|
55
|
+
get paymentMethod() {
|
|
56
|
+
return this.data.paymentMethod || null;
|
|
57
|
+
}
|
|
55
58
|
get displayAddress() {
|
|
56
59
|
return (0, types_1.displayBasicAddress)(this.address);
|
|
57
60
|
}
|
|
@@ -2,6 +2,7 @@ import { Timestamp } from '@google-cloud/firestore';
|
|
|
2
2
|
import { BasicAddressData } from '../../../helpers/types';
|
|
3
3
|
import { DocumentReference } from '../../../types/firestore';
|
|
4
4
|
import { GroupPlayerCustomFieldValue } from '../../Group/Player/types';
|
|
5
|
+
import { PaymentMethod } from '../Payment/types';
|
|
5
6
|
import { PartnershipPlanBasicData } from '../Plan/types';
|
|
6
7
|
export declare enum PartnerStatus {
|
|
7
8
|
Active = "active",
|
|
@@ -12,7 +13,7 @@ export interface PartnershipPartnerSepaMandate {
|
|
|
12
13
|
mandateId: string;
|
|
13
14
|
iban: string;
|
|
14
15
|
holderFullName: string;
|
|
15
|
-
holderAddress: BasicAddressData;
|
|
16
|
+
holderAddress: BasicAddressData | null;
|
|
16
17
|
swiftbic: string | null;
|
|
17
18
|
}
|
|
18
19
|
export interface PartnershipPartnerData {
|
|
@@ -26,6 +27,7 @@ export interface PartnershipPartnerData {
|
|
|
26
27
|
phone: string | null;
|
|
27
28
|
NIF: string | null;
|
|
28
29
|
sepaMandate: PartnershipPartnerSepaMandate | null;
|
|
30
|
+
paymentMethod: PaymentMethod | null;
|
|
29
31
|
groupIds: string[];
|
|
30
32
|
subscriptionIds: string[];
|
|
31
33
|
subscriptions: Record<string, PartnershipPlanBasicData>;
|
|
@@ -3,6 +3,7 @@ import { PartnershipBasicData } from './types';
|
|
|
3
3
|
export default class PartnershipBasic<D> extends Model<D & PartnershipBasicData> {
|
|
4
4
|
get basicInfo(): PartnershipBasicData;
|
|
5
5
|
get displayName(): string;
|
|
6
|
+
get username(): string;
|
|
6
7
|
get photoURL(): string;
|
|
7
8
|
get email(): string;
|
|
8
9
|
get website(): string | null;
|
|
@@ -18,11 +18,15 @@ class PartnershipBasic extends Model_1.default {
|
|
|
18
18
|
partnerCount: this.partnerCount,
|
|
19
19
|
memberCount: this.memberCount,
|
|
20
20
|
website: this.website,
|
|
21
|
+
username: this.username,
|
|
21
22
|
};
|
|
22
23
|
}
|
|
23
24
|
get displayName() {
|
|
24
25
|
return this.data.displayName;
|
|
25
26
|
}
|
|
27
|
+
get username() {
|
|
28
|
+
return this.data.username || '';
|
|
29
|
+
}
|
|
26
30
|
get photoURL() {
|
|
27
31
|
return this.data.photoURL;
|
|
28
32
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AdminItemStatus } from '../../helpers/types';
|
|
2
2
|
import PartnershipBasic from './basic';
|
|
3
|
-
import { APartnershipCustomField, PartnershipData } from './types';
|
|
3
|
+
import { APartnershipCustomField, PartnershipData, PartnershipPaymentMethodsConfig } from './types';
|
|
4
4
|
export default class Partnership extends PartnershipBasic<PartnershipData> {
|
|
5
5
|
get description(): string | null;
|
|
6
6
|
get admins(): string[];
|
|
@@ -9,14 +9,8 @@ export default class Partnership extends PartnershipBasic<PartnershipData> {
|
|
|
9
9
|
isAdmin(userId: string): boolean;
|
|
10
10
|
get federationIds(): string[];
|
|
11
11
|
get groupIds(): string[];
|
|
12
|
-
get sepaCreditorInfo():
|
|
13
|
-
|
|
14
|
-
creditorId: string;
|
|
15
|
-
legalName: string;
|
|
16
|
-
address: import("../../helpers/types").BasicAddressData;
|
|
17
|
-
iban: string;
|
|
18
|
-
swiftbic: string;
|
|
19
|
-
} | null;
|
|
12
|
+
get sepaCreditorInfo(): import("./types").PartnershipSepaCreditorInfo | null;
|
|
13
|
+
get paymentMethodsConfig(): PartnershipPaymentMethodsConfig | null;
|
|
20
14
|
get glissandooAdminUrl(): string;
|
|
21
15
|
get createdAt(): FirebaseFirestore.Timestamp;
|
|
22
16
|
get createdBy(): FirebaseFirestore.DocumentReference<FirebaseFirestore.DocumentData, FirebaseFirestore.DocumentData>;
|
|
@@ -26,6 +20,9 @@ export default class Partnership extends PartnershipBasic<PartnershipData> {
|
|
|
26
20
|
get deletedBy(): string | null;
|
|
27
21
|
get isDeleted(): boolean;
|
|
28
22
|
get isActive(): boolean;
|
|
23
|
+
get boardRoles(): string[];
|
|
24
|
+
get boardMembers(): import("../../helpers/types").BoardMemberItem[];
|
|
25
|
+
get boardDocuments(): import("../../helpers/types").BoardDocumentItem[];
|
|
29
26
|
get customFields(): Record<string, import("../Group/types").GroupCustomField>;
|
|
30
27
|
get customFieldsList(): APartnershipCustomField[];
|
|
31
28
|
}
|
|
@@ -5,7 +5,6 @@ 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 types_1 = require("../../helpers/types");
|
|
9
8
|
const basic_1 = __importDefault(require("./basic"));
|
|
10
9
|
class Partnership extends basic_1.default {
|
|
11
10
|
get description() {
|
|
@@ -30,12 +29,10 @@ class Partnership extends basic_1.default {
|
|
|
30
29
|
return this.data.groupIds || [];
|
|
31
30
|
}
|
|
32
31
|
get sepaCreditorInfo() {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
displayAddress: (0, types_1.displayBasicAddress)(this.data.sepaCreditorInfo.address),
|
|
38
|
-
};
|
|
32
|
+
return this.data.sepaCreditorInfo || null;
|
|
33
|
+
}
|
|
34
|
+
get paymentMethodsConfig() {
|
|
35
|
+
return this.data.paymentMethodsConfig || null;
|
|
39
36
|
}
|
|
40
37
|
get glissandooAdminUrl() {
|
|
41
38
|
return (0, glissandooAdmin_1.getGlissandooAdminEntityURL)(collections_1.CollectionNames.Partnership, this.id);
|
|
@@ -64,6 +61,15 @@ class Partnership extends basic_1.default {
|
|
|
64
61
|
get isActive() {
|
|
65
62
|
return this.exists && !this.deletedAt;
|
|
66
63
|
}
|
|
64
|
+
get boardRoles() {
|
|
65
|
+
return this.data.boardRoles || [];
|
|
66
|
+
}
|
|
67
|
+
get boardMembers() {
|
|
68
|
+
return this.data.boardMembers || [];
|
|
69
|
+
}
|
|
70
|
+
get boardDocuments() {
|
|
71
|
+
return this.data.boardDocuments || [];
|
|
72
|
+
}
|
|
67
73
|
get customFields() {
|
|
68
74
|
return this.data.customFields || {};
|
|
69
75
|
}
|
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
import { DocumentReference, Timestamp } from '@google-cloud/firestore';
|
|
2
|
-
import { AdminItem, BasicAddressData } from '../../helpers/types';
|
|
2
|
+
import { AdminItem, BasicAddressData, BoardDocumentItem, BoardMemberItem } from '../../helpers/types';
|
|
3
3
|
import { AGroupCustomField, GroupCustomField } from '../Group/types';
|
|
4
4
|
export type PartnershipCustomField = GroupCustomField;
|
|
5
5
|
export type APartnershipCustomField = AGroupCustomField;
|
|
6
6
|
export declare enum PartnershipRoles {
|
|
7
|
-
Admin = "admin"
|
|
7
|
+
Admin = "admin",
|
|
8
|
+
Partner = "partner"
|
|
8
9
|
}
|
|
9
10
|
export interface PartnershipAlgoliaData extends Pick<PartnershipData, 'displayName' | 'photoURL' | 'partnerCount'> {
|
|
10
11
|
createdAt: number;
|
|
11
12
|
}
|
|
12
13
|
export interface PartnershipSepaCreditorInfo {
|
|
13
14
|
creditorId: string;
|
|
14
|
-
legalName: string;
|
|
15
|
-
address: BasicAddressData;
|
|
16
15
|
iban: string;
|
|
17
16
|
swiftbic: string;
|
|
18
17
|
}
|
|
18
|
+
export interface PartnershipTransferInfo {
|
|
19
|
+
iban: string;
|
|
20
|
+
holderName: string;
|
|
21
|
+
}
|
|
22
|
+
export interface PartnershipPaymentMethodsConfig {
|
|
23
|
+
sepa: boolean;
|
|
24
|
+
transfer: PartnershipTransferInfo | null;
|
|
25
|
+
cash: string | null;
|
|
26
|
+
}
|
|
19
27
|
export interface PartnershipBasicData {
|
|
20
28
|
displayName: string;
|
|
21
29
|
photoURL: string;
|
|
@@ -27,14 +35,19 @@ export interface PartnershipBasicData {
|
|
|
27
35
|
partnerCount: number;
|
|
28
36
|
memberCount: number;
|
|
29
37
|
website: string | null;
|
|
38
|
+
username: string;
|
|
30
39
|
}
|
|
31
40
|
export interface PartnershipData extends PartnershipBasicData {
|
|
32
41
|
sepaCreditorInfo: PartnershipSepaCreditorInfo | null;
|
|
42
|
+
paymentMethodsConfig: PartnershipPaymentMethodsConfig | null;
|
|
33
43
|
description: string | null;
|
|
34
44
|
administrators: string[];
|
|
35
45
|
administratorsList: AdminItem[];
|
|
36
46
|
federationIds: string[];
|
|
37
47
|
customFields: Record<string, PartnershipCustomField>;
|
|
48
|
+
boardRoles: string[];
|
|
49
|
+
boardMembers: BoardMemberItem[];
|
|
50
|
+
boardDocuments: BoardDocumentItem[];
|
|
38
51
|
createdAt: Timestamp;
|
|
39
52
|
createdBy: DocumentReference;
|
|
40
53
|
editedAt: Timestamp | null;
|