@glissandoo/lib 1.95.1 → 1.96.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.
- package/functions/index.d.ts +3 -0
- package/functions/index.js +3 -0
- package/functions/partnership.d.ts +24 -15
- package/functions/partnershipPartner.d.ts +4 -2
- package/functions/regions.js +3 -0
- package/helpers/collections.d.ts +5 -5
- package/helpers/collections.js +5 -5
- package/helpers/errors.d.ts +2 -1
- package/helpers/errors.js +1 -0
- package/helpers/types.d.ts +1 -0
- package/helpers/types.js +15 -1
- package/models/Customer/basic.js +2 -4
- package/models/Federation/index.js +2 -4
- package/models/Partnership/Partner/index.d.ts +17 -4
- package/models/Partnership/Partner/index.js +32 -13
- package/models/Partnership/Partner/types.d.ts +18 -11
- package/models/Partnership/Payment/index.d.ts +18 -11
- package/models/Partnership/Payment/index.js +39 -13
- package/models/Partnership/Payment/types.d.ts +22 -25
- package/models/Partnership/Payment/types.js +5 -8
- package/models/Partnership/Plan/index.d.ts +19 -7
- package/models/Partnership/Plan/index.js +61 -14
- package/models/Partnership/Plan/types.d.ts +11 -14
- package/models/Partnership/Plan/types.js +5 -8
- package/models/Partnership/SepaPaymentGroup/index.d.ts +12 -0
- package/models/Partnership/SepaPaymentGroup/index.js +34 -0
- package/models/Partnership/SepaPaymentGroup/types.d.ts +11 -0
- package/models/Partnership/Subscription/index.d.ts +9 -13
- package/models/Partnership/Subscription/index.js +18 -31
- package/models/Partnership/Subscription/types.d.ts +9 -18
- package/models/Partnership/Subscription/types.js +0 -7
- package/models/Partnership/basic.d.ts +1 -2
- package/models/Partnership/basic.js +2 -7
- package/models/Partnership/index.d.ts +2 -3
- package/models/Partnership/index.js +4 -4
- package/models/Partnership/types.d.ts +11 -3
- package/package.json +1 -1
- package/functions/partner.d.ts +0 -64
- package/helpers/payments.d.ts +0 -2
- package/helpers/payments.js +0 -9
- package/models/Partnership/Partner/basic.d.ts +0 -13
- package/models/Partnership/Partner/basic.js +0 -39
- package/models/Partnership/Partner/tiny.d.ts +0 -7
- package/models/Partnership/Partner/tiny.js +0 -21
- package/models/Partnership/Payment/basic.d.ts +0 -16
- package/models/Partnership/Payment/basic.js +0 -53
- package/models/Partnership/Plan/basic.d.ts +0 -18
- package/models/Partnership/Plan/basic.js +0 -65
- /package/{functions/partner.js → models/Partnership/SepaPaymentGroup/types.js} +0 -0
package/functions/index.d.ts
CHANGED
|
@@ -123,6 +123,9 @@ export declare enum FbFunctionName {
|
|
|
123
123
|
PartnershipPublish = "partnership-publish",
|
|
124
124
|
PartnershipRemove = "partnership-remove",
|
|
125
125
|
PartnershipRemoveAdmin = "partnership-removeAdmin",
|
|
126
|
+
PartnershipPartnerCreate = "partnershipPartner-create",
|
|
127
|
+
PartnershipPartnerEdit = "partnershipPartner-edit",
|
|
128
|
+
PartnershipPartnerRemove = "partnershipPartner-remove",
|
|
126
129
|
ReminderBiweeklyEventsEmail = "reminder-biweeklyEventsEmail",
|
|
127
130
|
ReminderDatetime = "reminder-datetime",
|
|
128
131
|
ReminderResponseDeadlineEnded = "reminder-responseDeadlineEnded",
|
package/functions/index.js
CHANGED
|
@@ -127,6 +127,9 @@ var FbFunctionName;
|
|
|
127
127
|
FbFunctionName["PartnershipPublish"] = "partnership-publish";
|
|
128
128
|
FbFunctionName["PartnershipRemove"] = "partnership-remove";
|
|
129
129
|
FbFunctionName["PartnershipRemoveAdmin"] = "partnership-removeAdmin";
|
|
130
|
+
FbFunctionName["PartnershipPartnerCreate"] = "partnershipPartner-create";
|
|
131
|
+
FbFunctionName["PartnershipPartnerEdit"] = "partnershipPartner-edit";
|
|
132
|
+
FbFunctionName["PartnershipPartnerRemove"] = "partnershipPartner-remove";
|
|
130
133
|
FbFunctionName["ReminderBiweeklyEventsEmail"] = "reminder-biweeklyEventsEmail";
|
|
131
134
|
FbFunctionName["ReminderDatetime"] = "reminder-datetime";
|
|
132
135
|
FbFunctionName["ReminderResponseDeadlineEnded"] = "reminder-responseDeadlineEnded";
|
|
@@ -1,35 +1,44 @@
|
|
|
1
1
|
import { BasicAddressData } from '../helpers/types';
|
|
2
|
+
import { PartnershipSepaCreditorInfo } from '../models/Partnership/types';
|
|
2
3
|
export declare namespace PartnershipFbFunctionsTypes {
|
|
3
|
-
interface
|
|
4
|
-
groupId: string;
|
|
4
|
+
interface BaseCreateParams {
|
|
5
5
|
displayName: string;
|
|
6
6
|
CIF: string;
|
|
7
7
|
email: string;
|
|
8
8
|
phone: string | null;
|
|
9
9
|
address: BasicAddressData;
|
|
10
|
+
sepaCreditorInfo: PartnershipSepaCreditorInfo | null;
|
|
11
|
+
}
|
|
12
|
+
export interface PublishParams extends BaseCreateParams {
|
|
13
|
+
groupId: string;
|
|
10
14
|
}
|
|
11
|
-
type PublishResult = void;
|
|
12
|
-
interface CreateParams {
|
|
15
|
+
export type PublishResult = void;
|
|
16
|
+
export interface CreateParams extends BaseCreateParams {
|
|
13
17
|
partnershipId: string;
|
|
14
|
-
displayName: string;
|
|
15
18
|
}
|
|
16
|
-
type CreateResult = void;
|
|
17
|
-
interface EditParams {
|
|
19
|
+
export type CreateResult = void;
|
|
20
|
+
export interface EditParams extends Partial<BaseCreateParams> {
|
|
18
21
|
partnershipId: string;
|
|
22
|
+
displayName: string;
|
|
23
|
+
CIF: string;
|
|
24
|
+
email: string;
|
|
25
|
+
phone: string | null;
|
|
26
|
+
address: BasicAddressData;
|
|
19
27
|
}
|
|
20
|
-
type EditResult = void;
|
|
21
|
-
interface RemoveParams {
|
|
28
|
+
export type EditResult = void;
|
|
29
|
+
export interface RemoveParams {
|
|
22
30
|
partnershipId: string;
|
|
23
31
|
}
|
|
24
|
-
type RemoveResult = void;
|
|
25
|
-
interface AddConfirmedAdminParams {
|
|
32
|
+
export type RemoveResult = void;
|
|
33
|
+
export interface AddConfirmedAdminParams {
|
|
26
34
|
partnershipId: string;
|
|
27
|
-
|
|
35
|
+
email: string;
|
|
28
36
|
}
|
|
29
|
-
type AddConfirmedAdminResult = void;
|
|
30
|
-
interface RemoveAdminParams {
|
|
37
|
+
export type AddConfirmedAdminResult = void;
|
|
38
|
+
export interface RemoveAdminParams {
|
|
31
39
|
partnershipId: string;
|
|
32
40
|
email: string;
|
|
33
41
|
}
|
|
34
|
-
type RemoveAdminResult = void;
|
|
42
|
+
export type RemoveAdminResult = void;
|
|
43
|
+
export {};
|
|
35
44
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { CreatedOn } from '../helpers/types';
|
|
2
|
-
import {
|
|
1
|
+
import { BasicAddressData, CreatedOn } from '../helpers/types';
|
|
2
|
+
import { PartnershipPartnerSepaMandate } from '../models/Partnership/Partner/types';
|
|
3
3
|
export declare namespace PartnershipPartnerFbFunctionsTypes {
|
|
4
4
|
interface CreateParams {
|
|
5
5
|
partnershipId: string;
|
|
6
6
|
partnerId: string;
|
|
7
|
+
NIF: string | null;
|
|
7
8
|
name: string;
|
|
8
9
|
lastname: string;
|
|
9
10
|
email: string;
|
|
@@ -11,6 +12,7 @@ export declare namespace PartnershipPartnerFbFunctionsTypes {
|
|
|
11
12
|
birthdate: number | null;
|
|
12
13
|
address: BasicAddressData | null;
|
|
13
14
|
createdOn: CreatedOn;
|
|
15
|
+
sepaMandate: Omit<PartnershipPartnerSepaMandate, 'mandateId'> | null;
|
|
14
16
|
}
|
|
15
17
|
type CreateResult = void;
|
|
16
18
|
type EditParams = Omit<CreateParams, 'createdOn'>;
|
package/functions/regions.js
CHANGED
|
@@ -134,6 +134,9 @@ const regionByFunctions = {
|
|
|
134
134
|
[index_1.FbFunctionName.PartnershipPublish]: GCloudRegions.EuropeWest6,
|
|
135
135
|
[index_1.FbFunctionName.PartnershipRemove]: GCloudRegions.EuropeWest6,
|
|
136
136
|
[index_1.FbFunctionName.PartnershipRemoveAdmin]: GCloudRegions.EuropeWest6,
|
|
137
|
+
[index_1.FbFunctionName.PartnershipPartnerCreate]: GCloudRegions.EuropeWest6,
|
|
138
|
+
[index_1.FbFunctionName.PartnershipPartnerEdit]: GCloudRegions.EuropeWest6,
|
|
139
|
+
[index_1.FbFunctionName.PartnershipPartnerRemove]: GCloudRegions.EuropeWest6,
|
|
137
140
|
[index_1.FbFunctionName.ReminderBiweeklyEventsEmail]: GCloudRegions.EuropeWest6,
|
|
138
141
|
[index_1.FbFunctionName.ReminderDatetime]: GCloudRegions.EuropeWest6,
|
|
139
142
|
[index_1.FbFunctionName.ReminderResponseDeadlineEnded]: GCloudRegions.EuropeWest6,
|
package/helpers/collections.d.ts
CHANGED
|
@@ -21,11 +21,11 @@ export declare enum CollectionNames {
|
|
|
21
21
|
GroupStageTemplates = "stageTemplates",
|
|
22
22
|
Metrics = "metrics",
|
|
23
23
|
Partnership = "partnership",
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
PartnershipPartner = "partnershipPartner",
|
|
25
|
+
PartnershipGroup = "partnershipGroup",
|
|
26
|
+
PartnershipSubscription = "partnershipSubscription",
|
|
27
|
+
PartnershipPayment = "partnershipPayment",
|
|
28
|
+
PartnershipPlan = "partnershipPlan",
|
|
29
29
|
Federation = "federation",
|
|
30
30
|
FederationPartnerships = "partnerships",
|
|
31
31
|
Offer = "offer",
|
package/helpers/collections.js
CHANGED
|
@@ -25,11 +25,11 @@ var CollectionNames;
|
|
|
25
25
|
CollectionNames["GroupStageTemplates"] = "stageTemplates";
|
|
26
26
|
CollectionNames["Metrics"] = "metrics";
|
|
27
27
|
CollectionNames["Partnership"] = "partnership";
|
|
28
|
-
CollectionNames["
|
|
29
|
-
CollectionNames["
|
|
30
|
-
CollectionNames["
|
|
31
|
-
CollectionNames["
|
|
32
|
-
CollectionNames["
|
|
28
|
+
CollectionNames["PartnershipPartner"] = "partnershipPartner";
|
|
29
|
+
CollectionNames["PartnershipGroup"] = "partnershipGroup";
|
|
30
|
+
CollectionNames["PartnershipSubscription"] = "partnershipSubscription";
|
|
31
|
+
CollectionNames["PartnershipPayment"] = "partnershipPayment";
|
|
32
|
+
CollectionNames["PartnershipPlan"] = "partnershipPlan";
|
|
33
33
|
CollectionNames["Federation"] = "federation";
|
|
34
34
|
CollectionNames["FederationPartnerships"] = "partnerships";
|
|
35
35
|
CollectionNames["Offer"] = "offer";
|
package/helpers/errors.d.ts
CHANGED
|
@@ -62,7 +62,8 @@ export declare enum HttpsErrorMessages {
|
|
|
62
62
|
PlayersWithCustomInstrumentsToBeDeleted = "error.group.playersWithCustomInstrumentsToBeDeleted",
|
|
63
63
|
ThemesWithCustomInstrumentsToBeDeleted = "error.group.themesWithCustomInstrumentsToBeDeleted",
|
|
64
64
|
CustomerHasGroups = "error.customer.hasGroups",
|
|
65
|
-
GroupPlayerEditInstumentsNotAllowed = "error.groupPlayer.editInstrumentsNotAllowed"
|
|
65
|
+
GroupPlayerEditInstumentsNotAllowed = "error.groupPlayer.editInstrumentsNotAllowed",
|
|
66
|
+
InvalidEmail = "error.email.noValid"
|
|
66
67
|
}
|
|
67
68
|
export interface HttpsErrorDetails extends Record<HttpsErrorMessages, unknown> {
|
|
68
69
|
[HttpsErrorMessages.ThemesWithCustomInstrumentsToBeDeleted]: {
|
package/helpers/errors.js
CHANGED
|
@@ -64,4 +64,5 @@ var HttpsErrorMessages;
|
|
|
64
64
|
HttpsErrorMessages["ThemesWithCustomInstrumentsToBeDeleted"] = "error.group.themesWithCustomInstrumentsToBeDeleted";
|
|
65
65
|
HttpsErrorMessages["CustomerHasGroups"] = "error.customer.hasGroups";
|
|
66
66
|
HttpsErrorMessages["GroupPlayerEditInstumentsNotAllowed"] = "error.groupPlayer.editInstrumentsNotAllowed";
|
|
67
|
+
HttpsErrorMessages["InvalidEmail"] = "error.email.noValid";
|
|
67
68
|
})(HttpsErrorMessages = exports.HttpsErrorMessages || (exports.HttpsErrorMessages = {}));
|
package/helpers/types.d.ts
CHANGED
package/helpers/types.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CreatedOn = exports.AdminItemStatus = void 0;
|
|
6
|
+
exports.displayBasicAddress = exports.CreatedOn = exports.AdminItemStatus = void 0;
|
|
7
|
+
const isString_1 = __importDefault(require("lodash/isString"));
|
|
4
8
|
var AdminItemStatus;
|
|
5
9
|
(function (AdminItemStatus) {
|
|
6
10
|
AdminItemStatus["Pending"] = "pending";
|
|
@@ -13,3 +17,13 @@ var CreatedOn;
|
|
|
13
17
|
CreatedOn["App"] = "app";
|
|
14
18
|
CreatedOn["Dashboard"] = "dashboard";
|
|
15
19
|
})(CreatedOn = exports.CreatedOn || (exports.CreatedOn = {}));
|
|
20
|
+
function displayBasicAddress(address) {
|
|
21
|
+
if (address === null || address === undefined)
|
|
22
|
+
return null;
|
|
23
|
+
const { street, city, postalCode, province, country } = address;
|
|
24
|
+
const fields = [street, postalCode, city, province, country];
|
|
25
|
+
return fields
|
|
26
|
+
.filter((field) => (0, isString_1.default)(field) && field.trim() !== '')
|
|
27
|
+
.join(', ');
|
|
28
|
+
}
|
|
29
|
+
exports.displayBasicAddress = displayBasicAddress;
|
package/models/Customer/basic.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
6
|
+
const types_1 = require("../../helpers/types");
|
|
7
7
|
const Model_1 = __importDefault(require("../Model"));
|
|
8
8
|
class CustomerBasic extends Model_1.default {
|
|
9
9
|
constructor(doc) {
|
|
@@ -29,9 +29,7 @@ class CustomerBasic extends Model_1.default {
|
|
|
29
29
|
return this.data.address || {};
|
|
30
30
|
}
|
|
31
31
|
get displayAddress() {
|
|
32
|
-
|
|
33
|
-
const fields = [street, postalCode, city, province, country];
|
|
34
|
-
return fields.filter((field) => (0, lodash_1.isString)(field)).join(', ');
|
|
32
|
+
return (0, types_1.displayBasicAddress)(this.address);
|
|
35
33
|
}
|
|
36
34
|
get phone() {
|
|
37
35
|
return this.data.phone;
|
|
@@ -3,9 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const lodash_1 = require("lodash");
|
|
7
6
|
const collections_1 = require("../../helpers/collections");
|
|
8
7
|
const glissandooAdmin_1 = require("../../helpers/glissandooAdmin");
|
|
8
|
+
const types_1 = require("../../helpers/types");
|
|
9
9
|
const Model_1 = __importDefault(require("../Model"));
|
|
10
10
|
class Federation extends Model_1.default {
|
|
11
11
|
constructor(doc) {
|
|
@@ -45,9 +45,7 @@ class Federation extends Model_1.default {
|
|
|
45
45
|
return this.data.address || null;
|
|
46
46
|
}
|
|
47
47
|
get displayAddress() {
|
|
48
|
-
|
|
49
|
-
const fields = [street, postalCode, city, province, country];
|
|
50
|
-
return fields.filter((field) => (0, lodash_1.isString)(field) && field.trim() !== '').join(', ');
|
|
48
|
+
return (0, types_1.displayBasicAddress)(this.address || {});
|
|
51
49
|
}
|
|
52
50
|
get partnershipConnectedIds() {
|
|
53
51
|
return this.data.partnershipConnectedIds || [];
|
|
@@ -1,19 +1,32 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ModelWithLang from '../../Model/lang';
|
|
2
2
|
import { PartnershipPartnerData } from './types';
|
|
3
|
-
export default class PartnershipPartner extends
|
|
3
|
+
export default class PartnershipPartner extends ModelWithLang<PartnershipPartnerData> {
|
|
4
4
|
get name(): string;
|
|
5
5
|
get lastname(): string;
|
|
6
|
+
get photoURL(): string | null;
|
|
7
|
+
get displayName(): string;
|
|
8
|
+
get NIF(): string | null;
|
|
6
9
|
get email(): string;
|
|
7
10
|
get phone(): string | null;
|
|
8
11
|
get birthdate(): FirebaseFirestore.Timestamp | null;
|
|
9
|
-
get partnershipId(): string;
|
|
12
|
+
get partnershipId(): string[];
|
|
13
|
+
get sepaMandate(): {
|
|
14
|
+
holderDisplayAddress: string;
|
|
15
|
+
mandateId: string;
|
|
16
|
+
iban: string;
|
|
17
|
+
holderFullName: string;
|
|
18
|
+
holderAddress: import("../../../helpers/types").BasicAddressData;
|
|
19
|
+
swiftbic: string | null;
|
|
20
|
+
} | null;
|
|
10
21
|
get address(): import("../../../helpers/types").BasicAddressData | null;
|
|
11
|
-
get iban(): string | null;
|
|
12
22
|
get displayAddress(): string | null;
|
|
13
23
|
get createdAt(): FirebaseFirestore.Timestamp;
|
|
14
24
|
get createdBy(): import("../../../types/firestore").DocumentReference<import("../../../types/firestore").DocumentData>;
|
|
25
|
+
get editedAt(): FirebaseFirestore.Timestamp | null;
|
|
26
|
+
get editedBy(): string | null;
|
|
15
27
|
get deletedAt(): FirebaseFirestore.Timestamp | null;
|
|
16
28
|
get deletedBy(): string | null;
|
|
17
29
|
get isDeleted(): boolean;
|
|
18
30
|
get isActive(): boolean;
|
|
31
|
+
get userId(): string | null;
|
|
19
32
|
}
|
|
@@ -3,16 +3,25 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
class PartnershipPartner extends
|
|
6
|
+
const lodash_1 = require("lodash");
|
|
7
|
+
const types_1 = require("../../../helpers/types");
|
|
8
|
+
const lang_1 = __importDefault(require("../../Model/lang"));
|
|
9
|
+
class PartnershipPartner extends lang_1.default {
|
|
10
10
|
get name() {
|
|
11
11
|
return this.data.name;
|
|
12
12
|
}
|
|
13
13
|
get lastname() {
|
|
14
14
|
return this.data.lastname;
|
|
15
15
|
}
|
|
16
|
+
get photoURL() {
|
|
17
|
+
return this.data.photoURL || null;
|
|
18
|
+
}
|
|
19
|
+
get displayName() {
|
|
20
|
+
return this.data.displayName;
|
|
21
|
+
}
|
|
22
|
+
get NIF() {
|
|
23
|
+
return this.data.NIF;
|
|
24
|
+
}
|
|
16
25
|
get email() {
|
|
17
26
|
return this.data.email;
|
|
18
27
|
}
|
|
@@ -23,20 +32,21 @@ class PartnershipPartner extends basic_1.default {
|
|
|
23
32
|
return this.data.birthdate;
|
|
24
33
|
}
|
|
25
34
|
get partnershipId() {
|
|
26
|
-
return (0,
|
|
35
|
+
return (0, lodash_1.at)(this.ref.path.split('/'), 1) || '';
|
|
36
|
+
}
|
|
37
|
+
get sepaMandate() {
|
|
38
|
+
if (!this.data.sepaMandate)
|
|
39
|
+
return null;
|
|
40
|
+
return {
|
|
41
|
+
...this.data.sepaMandate,
|
|
42
|
+
holderDisplayAddress: (0, types_1.displayBasicAddress)(this.data.sepaMandate.holderAddress),
|
|
43
|
+
};
|
|
27
44
|
}
|
|
28
45
|
get address() {
|
|
29
46
|
return this.data.address;
|
|
30
47
|
}
|
|
31
|
-
get iban() {
|
|
32
|
-
return this.data.iban;
|
|
33
|
-
}
|
|
34
48
|
get displayAddress() {
|
|
35
|
-
|
|
36
|
-
return null;
|
|
37
|
-
const { street, city, postalCode, province, country } = this.address;
|
|
38
|
-
const fields = [street, postalCode, city, province, country];
|
|
39
|
-
return fields.filter((field) => (0, isString_1.default)(field)).join(', ');
|
|
49
|
+
return (0, types_1.displayBasicAddress)(this.address);
|
|
40
50
|
}
|
|
41
51
|
get createdAt() {
|
|
42
52
|
return this.data.createdAt;
|
|
@@ -44,6 +54,12 @@ class PartnershipPartner extends basic_1.default {
|
|
|
44
54
|
get createdBy() {
|
|
45
55
|
return this.data.createdBy;
|
|
46
56
|
}
|
|
57
|
+
get editedAt() {
|
|
58
|
+
return this.data.editedAt || null;
|
|
59
|
+
}
|
|
60
|
+
get editedBy() {
|
|
61
|
+
return this.data.editedBy || null;
|
|
62
|
+
}
|
|
47
63
|
get deletedAt() {
|
|
48
64
|
return this.data.deletedAt || null;
|
|
49
65
|
}
|
|
@@ -56,5 +72,8 @@ class PartnershipPartner extends basic_1.default {
|
|
|
56
72
|
get isActive() {
|
|
57
73
|
return this.exists && !this.isDeleted;
|
|
58
74
|
}
|
|
75
|
+
get userId() {
|
|
76
|
+
return this.data.userId || null;
|
|
77
|
+
}
|
|
59
78
|
}
|
|
60
79
|
exports.default = PartnershipPartner;
|
|
@@ -1,23 +1,30 @@
|
|
|
1
1
|
import { Timestamp } from '@google-cloud/firestore';
|
|
2
2
|
import { BasicAddressData } from '../../../helpers/types';
|
|
3
3
|
import { DocumentReference } from '../../../types/firestore';
|
|
4
|
-
export interface
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
readonly createdBy: DocumentReference;
|
|
11
|
-
deletedAt: Timestamp | null;
|
|
12
|
-
deletedBy: string | null;
|
|
4
|
+
export interface PartnershipPartnerSepaMandate {
|
|
5
|
+
mandateId: string;
|
|
6
|
+
iban: string;
|
|
7
|
+
holderFullName: string;
|
|
8
|
+
holderAddress: BasicAddressData;
|
|
9
|
+
swiftbic: string | null;
|
|
13
10
|
}
|
|
14
|
-
export interface PartnershipPartnerData
|
|
11
|
+
export interface PartnershipPartnerData {
|
|
15
12
|
name: string;
|
|
16
13
|
lastname: string;
|
|
14
|
+
photoURL: string | null;
|
|
15
|
+
displayName: string;
|
|
17
16
|
email: string;
|
|
18
17
|
address: BasicAddressData | null;
|
|
19
18
|
phone: string | null;
|
|
20
19
|
birthdate: Timestamp | null;
|
|
21
|
-
|
|
20
|
+
NIF: string | null;
|
|
21
|
+
sepaMandate: PartnershipPartnerSepaMandate | null;
|
|
22
22
|
groupIds: string[];
|
|
23
|
+
createdAt: Timestamp;
|
|
24
|
+
createdBy: DocumentReference;
|
|
25
|
+
editedAt: Timestamp | null;
|
|
26
|
+
editedBy: string | null;
|
|
27
|
+
deletedAt: Timestamp | null;
|
|
28
|
+
deletedBy: string | null;
|
|
29
|
+
userId: string | null;
|
|
23
30
|
}
|
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
get
|
|
7
|
-
get
|
|
1
|
+
import ModelWithLang from '../../Model/lang';
|
|
2
|
+
import { PaymentData, PaymentType } from './types';
|
|
3
|
+
export default class Payment extends ModelWithLang<PaymentData> {
|
|
4
|
+
get partnershipId(): string | null;
|
|
5
|
+
get title(): string;
|
|
6
|
+
get amount(): number;
|
|
7
|
+
get displayAmount(): string;
|
|
8
|
+
get type(): PaymentType;
|
|
9
|
+
get isRecurrent(): boolean;
|
|
10
|
+
get isOneTime(): boolean;
|
|
8
11
|
get subscriptionId(): string | null;
|
|
9
|
-
get
|
|
10
|
-
get
|
|
11
|
-
get history(): import("./types").
|
|
12
|
-
get historyOrdered(): import("./types").
|
|
12
|
+
get partnerId(): string | null;
|
|
13
|
+
get paymentMethod(): import("../Plan/types").PaymentMethod | null;
|
|
14
|
+
get history(): import("./types").PaymentHistoryItem[];
|
|
15
|
+
get historyOrdered(): import("./types").PaymentHistoryItem[];
|
|
16
|
+
get createdAt(): FirebaseFirestore.Timestamp;
|
|
17
|
+
get createdBy(): string | null;
|
|
18
|
+
get editedAt(): FirebaseFirestore.Timestamp | null;
|
|
19
|
+
get editedBy(): string | null;
|
|
13
20
|
}
|
|
@@ -3,31 +3,57 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
6
|
+
const utils_1 = require("../../../helpers/utils");
|
|
7
|
+
const lang_1 = __importDefault(require("../../Model/lang"));
|
|
8
|
+
const types_1 = require("./types");
|
|
9
|
+
class Payment extends lang_1.default {
|
|
11
10
|
get partnershipId() {
|
|
12
|
-
return this.
|
|
11
|
+
return (0, utils_1.at)(this.ref.path.split('/'), 1);
|
|
13
12
|
}
|
|
14
|
-
get
|
|
15
|
-
return this.data.
|
|
13
|
+
get title() {
|
|
14
|
+
return this.data.title;
|
|
15
|
+
}
|
|
16
|
+
get amount() {
|
|
17
|
+
return this.data.amount;
|
|
18
|
+
}
|
|
19
|
+
get displayAmount() {
|
|
20
|
+
return `${this.amount} €`;
|
|
21
|
+
}
|
|
22
|
+
get type() {
|
|
23
|
+
return this.data.type;
|
|
24
|
+
}
|
|
25
|
+
get isRecurrent() {
|
|
26
|
+
return this.type === types_1.PaymentType.Recurring;
|
|
27
|
+
}
|
|
28
|
+
get isOneTime() {
|
|
29
|
+
return this.type === types_1.PaymentType.OneTime;
|
|
16
30
|
}
|
|
17
31
|
get subscriptionId() {
|
|
18
32
|
return this.data.subscriptionId;
|
|
19
33
|
}
|
|
20
|
-
get
|
|
21
|
-
return this.data.
|
|
34
|
+
get partnerId() {
|
|
35
|
+
return this.data.partnerId;
|
|
22
36
|
}
|
|
23
|
-
get
|
|
24
|
-
return this.data.
|
|
37
|
+
get paymentMethod() {
|
|
38
|
+
return this.data.paymentMethod;
|
|
25
39
|
}
|
|
26
40
|
get history() {
|
|
27
41
|
return this.data.history || [];
|
|
28
42
|
}
|
|
29
43
|
get historyOrdered() {
|
|
30
|
-
return this.history.sort((a, b) =>
|
|
44
|
+
return this.history.sort((a, b) => a.changedAt.toMillis() < b.changedAt.toMillis() ? 1 : -1);
|
|
45
|
+
}
|
|
46
|
+
get createdAt() {
|
|
47
|
+
return this.data.createdAt;
|
|
48
|
+
}
|
|
49
|
+
get createdBy() {
|
|
50
|
+
return this.data.createdBy || null;
|
|
51
|
+
}
|
|
52
|
+
get editedAt() {
|
|
53
|
+
return this.data.editedAt || null;
|
|
54
|
+
}
|
|
55
|
+
get editedBy() {
|
|
56
|
+
return this.data.editedBy || null;
|
|
31
57
|
}
|
|
32
58
|
}
|
|
33
59
|
exports.default = Payment;
|
|
@@ -1,32 +1,29 @@
|
|
|
1
1
|
import { Timestamp } from '@google-cloud/firestore';
|
|
2
|
+
import { PaymentMethod } from '../Plan/types';
|
|
2
3
|
export declare enum PaymentType {
|
|
3
|
-
Recurring = "
|
|
4
|
-
OneTime = "
|
|
4
|
+
Recurring = "RCUR",
|
|
5
|
+
OneTime = "OOFF"
|
|
5
6
|
}
|
|
6
7
|
export declare enum PaymentStatus {
|
|
7
|
-
Pending =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
Error = 3,
|
|
11
|
-
Chargeback = 4,
|
|
12
|
-
Canceled = 5
|
|
8
|
+
Pending = "pending",
|
|
9
|
+
Charged = "charged",
|
|
10
|
+
Canceled = "canceled"
|
|
13
11
|
}
|
|
14
|
-
export interface
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
export interface PaymentHistoryItem {
|
|
13
|
+
status: PaymentStatus;
|
|
14
|
+
changedAt: Timestamp;
|
|
15
|
+
changedBy: string;
|
|
17
16
|
}
|
|
18
|
-
export interface
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
readonly transactionId: string;
|
|
31
|
-
history: PaymentHistory[];
|
|
17
|
+
export interface PaymentData {
|
|
18
|
+
title: string;
|
|
19
|
+
amount: number;
|
|
20
|
+
type: PaymentType;
|
|
21
|
+
subscriptionId: string | null;
|
|
22
|
+
partnerId: string | null;
|
|
23
|
+
paymentMethod: PaymentMethod | null;
|
|
24
|
+
history: PaymentHistoryItem[];
|
|
25
|
+
createdAt: Timestamp;
|
|
26
|
+
createdBy: string | null;
|
|
27
|
+
editedAt: Timestamp | null;
|
|
28
|
+
editedBy: string | null;
|
|
32
29
|
}
|
|
@@ -3,15 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PaymentStatus = exports.PaymentType = void 0;
|
|
4
4
|
var PaymentType;
|
|
5
5
|
(function (PaymentType) {
|
|
6
|
-
PaymentType["Recurring"] = "
|
|
7
|
-
PaymentType["OneTime"] = "
|
|
6
|
+
PaymentType["Recurring"] = "RCUR";
|
|
7
|
+
PaymentType["OneTime"] = "OOFF";
|
|
8
8
|
})(PaymentType = exports.PaymentType || (exports.PaymentType = {}));
|
|
9
9
|
var PaymentStatus;
|
|
10
10
|
(function (PaymentStatus) {
|
|
11
|
-
PaymentStatus[
|
|
12
|
-
PaymentStatus[
|
|
13
|
-
PaymentStatus[
|
|
14
|
-
PaymentStatus[PaymentStatus["Error"] = 3] = "Error";
|
|
15
|
-
PaymentStatus[PaymentStatus["Chargeback"] = 4] = "Chargeback";
|
|
16
|
-
PaymentStatus[PaymentStatus["Canceled"] = 5] = "Canceled";
|
|
11
|
+
PaymentStatus["Pending"] = "pending";
|
|
12
|
+
PaymentStatus["Charged"] = "charged";
|
|
13
|
+
PaymentStatus["Canceled"] = "canceled";
|
|
17
14
|
})(PaymentStatus = exports.PaymentStatus || (exports.PaymentStatus = {}));
|
|
@@ -1,14 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import PartnershipPlanBasic from './basic';
|
|
1
|
+
import ModelWithLang from '../../Model/lang';
|
|
3
2
|
import { PartnershipPlanData } from './types';
|
|
4
|
-
export default class PartnershipPlan extends
|
|
5
|
-
constructor(doc: DocumentModel);
|
|
3
|
+
export default class PartnershipPlan extends ModelWithLang<PartnershipPlanData> {
|
|
6
4
|
get partnershipId(): string;
|
|
5
|
+
private setPaymentDay;
|
|
6
|
+
private setPaymentMonth;
|
|
7
|
+
private setPaymentDate;
|
|
8
|
+
getNextPaymentDate(base: Date): Date;
|
|
9
|
+
getFirstPaymentDate(): Date;
|
|
10
|
+
get name(): string;
|
|
11
|
+
get description(): string;
|
|
12
|
+
get price(): number;
|
|
13
|
+
get displayPrice(): string;
|
|
14
|
+
get schedule(): import("./types").PlanScheduleType;
|
|
15
|
+
get paymentMethod(): import("./types").PaymentMethod;
|
|
16
|
+
get isAnnuallySchedule(): boolean;
|
|
17
|
+
get isPaymentDayEndOfMonth(): boolean;
|
|
18
|
+
get createdAt(): FirebaseFirestore.Timestamp;
|
|
19
|
+
get createdBy(): string;
|
|
20
|
+
get editedAt(): FirebaseFirestore.Timestamp | null;
|
|
21
|
+
get editedBy(): string | null;
|
|
7
22
|
get deletedAt(): FirebaseFirestore.Timestamp | null;
|
|
8
23
|
get deletedBy(): string | null;
|
|
9
24
|
get isDeleted(): boolean;
|
|
10
25
|
get isActive(): boolean;
|
|
11
|
-
get subscriptionsCount(): number;
|
|
12
|
-
get createdAt(): FirebaseFirestore.Timestamp;
|
|
13
|
-
get createdBy(): string;
|
|
14
26
|
}
|