@glissandoo/lib 1.108.10 → 1.108.11

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.
@@ -159,6 +159,11 @@ export declare enum FbFunctionName {
159
159
  PartnershipSubscriptionOnUpdate = "partnershipSubscription-onUpdate",
160
160
  PartnershipSubscriptionOnWrite = "partnershipSubscription-onWrite",
161
161
  PartnershipSubscriptionRemove = "partnershipSubscription-remove",
162
+ PartnershipCommunicationPublish = "partnershipCommunication-publish",
163
+ PartnershipCommunicationRemove = "partnershipCommunication-remove",
164
+ PartnershipCommunicationSendScheduled = "partnershipCommunication-sendScheduled",
165
+ PartnershipCommunicationSendTest = "partnershipCommunication-sendTest",
166
+ PartnershipCommunicationUpdate = "partnershipCommunication-update",
162
167
  ReminderBiweeklyEventsEmail = "reminder-biweeklyEventsEmail",
163
168
  ReminderDatetime = "reminder-datetime",
164
169
  ReminderResponseDeadlineEnded = "reminder-responseDeadlineEnded",
@@ -163,6 +163,11 @@ var FbFunctionName;
163
163
  FbFunctionName["PartnershipSubscriptionOnUpdate"] = "partnershipSubscription-onUpdate";
164
164
  FbFunctionName["PartnershipSubscriptionOnWrite"] = "partnershipSubscription-onWrite";
165
165
  FbFunctionName["PartnershipSubscriptionRemove"] = "partnershipSubscription-remove";
166
+ FbFunctionName["PartnershipCommunicationPublish"] = "partnershipCommunication-publish";
167
+ FbFunctionName["PartnershipCommunicationRemove"] = "partnershipCommunication-remove";
168
+ FbFunctionName["PartnershipCommunicationSendScheduled"] = "partnershipCommunication-sendScheduled";
169
+ FbFunctionName["PartnershipCommunicationSendTest"] = "partnershipCommunication-sendTest";
170
+ FbFunctionName["PartnershipCommunicationUpdate"] = "partnershipCommunication-update";
166
171
  FbFunctionName["ReminderBiweeklyEventsEmail"] = "reminder-biweeklyEventsEmail";
167
172
  FbFunctionName["ReminderDatetime"] = "reminder-datetime";
168
173
  FbFunctionName["ReminderResponseDeadlineEnded"] = "reminder-responseDeadlineEnded";
@@ -19,6 +19,7 @@ export declare namespace PartnershipFbFunctionsTypes {
19
19
  type CreateResult = void;
20
20
  interface EditParams extends CreateData {
21
21
  partnershipId: string;
22
+ photoURL?: string;
22
23
  }
23
24
  type EditResult = void;
24
25
  interface RemoveParams {
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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;
@@ -168,6 +168,11 @@ const regionByFunctions = {
168
168
  [index_1.FbFunctionName.PartnershipSubscriptionOnUpdate]: GCloudRegions.EuropeWest6,
169
169
  [index_1.FbFunctionName.PartnershipSubscriptionOnWrite]: GCloudRegions.EuropeWest6,
170
170
  [index_1.FbFunctionName.PartnershipSubscriptionRemove]: GCloudRegions.EuropeWest6,
171
+ [index_1.FbFunctionName.PartnershipCommunicationPublish]: GCloudRegions.EuropeWest6,
172
+ [index_1.FbFunctionName.PartnershipCommunicationRemove]: GCloudRegions.EuropeWest6,
173
+ [index_1.FbFunctionName.PartnershipCommunicationSendScheduled]: GCloudRegions.EuropeWest6,
174
+ [index_1.FbFunctionName.PartnershipCommunicationSendTest]: GCloudRegions.EuropeWest6,
175
+ [index_1.FbFunctionName.PartnershipCommunicationUpdate]: GCloudRegions.EuropeWest6,
171
176
  [index_1.FbFunctionName.ReminderBiweeklyEventsEmail]: GCloudRegions.EuropeWest6,
172
177
  [index_1.FbFunctionName.ReminderDatetime]: GCloudRegions.EuropeWest6,
173
178
  [index_1.FbFunctionName.ReminderResponseDeadlineEnded]: GCloudRegions.EuropeWest6,
@@ -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",
@@ -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";
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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>;
@@ -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
- displayAddress: string;
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>;
@@ -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
- if (!this.data.sepaCreditorInfo)
34
- return null;
35
- return {
36
- ...this.data.sepaCreditorInfo,
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);
@@ -11,11 +11,18 @@ export interface PartnershipAlgoliaData extends Pick<PartnershipData, 'displayNa
11
11
  }
12
12
  export interface PartnershipSepaCreditorInfo {
13
13
  creditorId: string;
14
- legalName: string;
15
- address: BasicAddressData;
16
14
  iban: string;
17
15
  swiftbic: string;
18
16
  }
17
+ export interface PartnershipTransferInfo {
18
+ iban: string;
19
+ holderName: string;
20
+ }
21
+ export interface PartnershipPaymentMethodsConfig {
22
+ sepa: boolean;
23
+ transfer: PartnershipTransferInfo | null;
24
+ cash: string | null;
25
+ }
19
26
  export interface PartnershipBasicData {
20
27
  displayName: string;
21
28
  photoURL: string;
@@ -30,6 +37,7 @@ export interface PartnershipBasicData {
30
37
  }
31
38
  export interface PartnershipData extends PartnershipBasicData {
32
39
  sepaCreditorInfo: PartnershipSepaCreditorInfo | null;
40
+ paymentMethodsConfig: PartnershipPaymentMethodsConfig | null;
33
41
  description: string | null;
34
42
  administrators: string[];
35
43
  administratorsList: AdminItem[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glissandoo/lib",
3
- "version": "1.108.10",
3
+ "version": "1.108.11",
4
4
  "description": "Glissandoo library js",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",