@glissandoo/lib 1.100.0 → 1.102.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 +22 -4
- package/functions/index.js +22 -4
- package/functions/partnershipPayment.d.ts +29 -0
- package/functions/partnershipPayment.js +2 -0
- package/functions/partnershipSepaPaymentGroup.d.ts +20 -0
- package/functions/partnershipSepaPaymentGroup.js +2 -0
- package/functions/partnershipSubscription.d.ts +2 -1
- package/functions/regions.js +22 -4
- package/helpers/collections.d.ts +3 -2
- package/helpers/collections.js +3 -2
- package/helpers/errors.d.ts +3 -0
- package/helpers/errors.js +3 -0
- package/helpers/types.d.ts +3 -0
- package/helpers/types.js +5 -1
- package/models/Partnership/Payment/index.d.ts +14 -9
- package/models/Partnership/Payment/index.js +29 -17
- package/models/Partnership/Payment/types.d.ts +7 -10
- package/models/Partnership/Payment/types.js +1 -6
- package/models/Partnership/Plan/index.js +1 -1
- package/models/Partnership/Plan/types.d.ts +2 -0
- package/models/Partnership/Plan/types.js +2 -0
- package/models/Partnership/SepaPaymentGroup/index.d.ts +4 -3
- package/models/Partnership/SepaPaymentGroup/index.js +8 -5
- package/models/Partnership/SepaPaymentGroup/types.d.ts +2 -2
- package/models/Partnership/Subscription/index.d.ts +2 -0
- package/models/Partnership/Subscription/index.js +8 -1
- package/models/Partnership/Subscription/types.d.ts +1 -0
- package/package.json +1 -1
package/functions/index.d.ts
CHANGED
|
@@ -114,18 +114,36 @@ export declare enum FbFunctionName {
|
|
|
114
114
|
OfferSelectApplicant = "offer-selectApplicant",
|
|
115
115
|
OfferView = "offer-view",
|
|
116
116
|
OfferViewApplicant = "offer-viewApplicant",
|
|
117
|
-
PartnershipAddConfirmedAdmin = "partnership-addConfirmedAdmin",
|
|
118
117
|
PartnershipCreate = "partnership-create",
|
|
118
|
+
PartnershipPublish = "partnership-publish",
|
|
119
119
|
PartnershipEdit = "partnership-edit",
|
|
120
|
-
PartnershipGroupAdd = "partnershipGroup-add",
|
|
121
|
-
PartnershipGroupRemove = "partnershipGroup-remove",
|
|
122
120
|
PartnershipOnUpdate = "partnership-onUpdate",
|
|
123
|
-
PartnershipPublish = "partnership-publish",
|
|
124
121
|
PartnershipRemove = "partnership-remove",
|
|
122
|
+
PartnershipOnDelete = "partnership-onDelete",
|
|
123
|
+
PartnershipAddConfirmedAdmin = "partnership-addConfirmedAdmin",
|
|
125
124
|
PartnershipRemoveAdmin = "partnership-removeAdmin",
|
|
125
|
+
PartnershipGroupAdd = "partnershipGroup-add",
|
|
126
|
+
PartnershipGroupRemove = "partnershipGroup-remove",
|
|
126
127
|
PartnershipPartnerCreate = "partnershipPartner-create",
|
|
127
128
|
PartnershipPartnerEdit = "partnershipPartner-edit",
|
|
129
|
+
PartnershipPartnerOnWrite = "partnershipPartner-onWrite",
|
|
128
130
|
PartnershipPartnerRemove = "partnershipPartner-remove",
|
|
131
|
+
PartnershipPaymentCreateOneTime = "partnershipPayment-createOneTime",
|
|
132
|
+
PartnershipPaymentGenerateRecurringBySubscriptions = "partnershipPayment-generateRecurringBySubscriptions",
|
|
133
|
+
PartnershipPaymentEdit = "partnershipPayment-edit",
|
|
134
|
+
PartnershipPaymentOnUpdate = "partnershipPayment-onUpdate",
|
|
135
|
+
PartnershipPaymentRemove = "partnershipPayment-remove",
|
|
136
|
+
PartnershipPlanCreate = "partnershipPlan-create",
|
|
137
|
+
PartnershipPlanEdit = "partnershipPlan-edit",
|
|
138
|
+
PartnershipPlanRemove = "partnershipPlan-remove",
|
|
139
|
+
PartnershipSepaPaymentGroupCreate = "partnershipSepaPaymentGroup-create",
|
|
140
|
+
PartnershipSepaPaymentGroupEdit = "partnershipSepaPaymentGroup-edit",
|
|
141
|
+
PartnershipSepaPaymentGroupOnUpdate = "partnershipSepaPaymentGroup-onUpdate",
|
|
142
|
+
PartnershipSepaPaymentGroupRemove = "partnershipSepaPaymentGroup-remove",
|
|
143
|
+
PartnershipSubscriptionCreate = "partnershipSubscription-create",
|
|
144
|
+
PartnershipSubscriptionEdit = "partnershipSubscription-edit",
|
|
145
|
+
PartnershipSubscriptionOnWrite = "partnershipSubscription-onWrite",
|
|
146
|
+
PartnershipSubscriptionRemove = "partnershipSubscription-remove",
|
|
129
147
|
ReminderBiweeklyEventsEmail = "reminder-biweeklyEventsEmail",
|
|
130
148
|
ReminderDatetime = "reminder-datetime",
|
|
131
149
|
ReminderResponseDeadlineEnded = "reminder-responseDeadlineEnded",
|
package/functions/index.js
CHANGED
|
@@ -118,18 +118,36 @@ var FbFunctionName;
|
|
|
118
118
|
FbFunctionName["OfferSelectApplicant"] = "offer-selectApplicant";
|
|
119
119
|
FbFunctionName["OfferView"] = "offer-view";
|
|
120
120
|
FbFunctionName["OfferViewApplicant"] = "offer-viewApplicant";
|
|
121
|
-
FbFunctionName["PartnershipAddConfirmedAdmin"] = "partnership-addConfirmedAdmin";
|
|
122
121
|
FbFunctionName["PartnershipCreate"] = "partnership-create";
|
|
122
|
+
FbFunctionName["PartnershipPublish"] = "partnership-publish";
|
|
123
123
|
FbFunctionName["PartnershipEdit"] = "partnership-edit";
|
|
124
|
-
FbFunctionName["PartnershipGroupAdd"] = "partnershipGroup-add";
|
|
125
|
-
FbFunctionName["PartnershipGroupRemove"] = "partnershipGroup-remove";
|
|
126
124
|
FbFunctionName["PartnershipOnUpdate"] = "partnership-onUpdate";
|
|
127
|
-
FbFunctionName["PartnershipPublish"] = "partnership-publish";
|
|
128
125
|
FbFunctionName["PartnershipRemove"] = "partnership-remove";
|
|
126
|
+
FbFunctionName["PartnershipOnDelete"] = "partnership-onDelete";
|
|
127
|
+
FbFunctionName["PartnershipAddConfirmedAdmin"] = "partnership-addConfirmedAdmin";
|
|
129
128
|
FbFunctionName["PartnershipRemoveAdmin"] = "partnership-removeAdmin";
|
|
129
|
+
FbFunctionName["PartnershipGroupAdd"] = "partnershipGroup-add";
|
|
130
|
+
FbFunctionName["PartnershipGroupRemove"] = "partnershipGroup-remove";
|
|
130
131
|
FbFunctionName["PartnershipPartnerCreate"] = "partnershipPartner-create";
|
|
131
132
|
FbFunctionName["PartnershipPartnerEdit"] = "partnershipPartner-edit";
|
|
133
|
+
FbFunctionName["PartnershipPartnerOnWrite"] = "partnershipPartner-onWrite";
|
|
132
134
|
FbFunctionName["PartnershipPartnerRemove"] = "partnershipPartner-remove";
|
|
135
|
+
FbFunctionName["PartnershipPaymentCreateOneTime"] = "partnershipPayment-createOneTime";
|
|
136
|
+
FbFunctionName["PartnershipPaymentGenerateRecurringBySubscriptions"] = "partnershipPayment-generateRecurringBySubscriptions";
|
|
137
|
+
FbFunctionName["PartnershipPaymentEdit"] = "partnershipPayment-edit";
|
|
138
|
+
FbFunctionName["PartnershipPaymentOnUpdate"] = "partnershipPayment-onUpdate";
|
|
139
|
+
FbFunctionName["PartnershipPaymentRemove"] = "partnershipPayment-remove";
|
|
140
|
+
FbFunctionName["PartnershipPlanCreate"] = "partnershipPlan-create";
|
|
141
|
+
FbFunctionName["PartnershipPlanEdit"] = "partnershipPlan-edit";
|
|
142
|
+
FbFunctionName["PartnershipPlanRemove"] = "partnershipPlan-remove";
|
|
143
|
+
FbFunctionName["PartnershipSepaPaymentGroupCreate"] = "partnershipSepaPaymentGroup-create";
|
|
144
|
+
FbFunctionName["PartnershipSepaPaymentGroupEdit"] = "partnershipSepaPaymentGroup-edit";
|
|
145
|
+
FbFunctionName["PartnershipSepaPaymentGroupOnUpdate"] = "partnershipSepaPaymentGroup-onUpdate";
|
|
146
|
+
FbFunctionName["PartnershipSepaPaymentGroupRemove"] = "partnershipSepaPaymentGroup-remove";
|
|
147
|
+
FbFunctionName["PartnershipSubscriptionCreate"] = "partnershipSubscription-create";
|
|
148
|
+
FbFunctionName["PartnershipSubscriptionEdit"] = "partnershipSubscription-edit";
|
|
149
|
+
FbFunctionName["PartnershipSubscriptionOnWrite"] = "partnershipSubscription-onWrite";
|
|
150
|
+
FbFunctionName["PartnershipSubscriptionRemove"] = "partnershipSubscription-remove";
|
|
133
151
|
FbFunctionName["ReminderBiweeklyEventsEmail"] = "reminder-biweeklyEventsEmail";
|
|
134
152
|
FbFunctionName["ReminderDatetime"] = "reminder-datetime";
|
|
135
153
|
FbFunctionName["ReminderResponseDeadlineEnded"] = "reminder-responseDeadlineEnded";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { PaymentStatus } from '../models/Partnership/Payment/types';
|
|
2
|
+
import { PaymentMethod } from '../models/Partnership/Plan/types';
|
|
3
|
+
export declare namespace PartnershipPaymentFbFunctionsTypes {
|
|
4
|
+
interface CreateOneTimeData {
|
|
5
|
+
title: string;
|
|
6
|
+
amount: number;
|
|
7
|
+
partnerId: string;
|
|
8
|
+
paymentMethod: PaymentMethod;
|
|
9
|
+
}
|
|
10
|
+
interface CreateOneTimeParams extends CreateOneTimeData {
|
|
11
|
+
partnershipId: string;
|
|
12
|
+
paymentId: string;
|
|
13
|
+
}
|
|
14
|
+
type CreateOneTimeResult = void;
|
|
15
|
+
interface EditParams {
|
|
16
|
+
partnershipId: string;
|
|
17
|
+
paymentId: string;
|
|
18
|
+
title?: string;
|
|
19
|
+
amount?: number;
|
|
20
|
+
paymentMethod?: PaymentMethod;
|
|
21
|
+
status?: PaymentStatus;
|
|
22
|
+
}
|
|
23
|
+
type EditResult = void;
|
|
24
|
+
type RemoveParams = {
|
|
25
|
+
partnershipId: string;
|
|
26
|
+
paymentId: string;
|
|
27
|
+
};
|
|
28
|
+
type RemoveResult = void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare namespace PartnershipSepaPaymentGroupFbFunctionsTypes {
|
|
2
|
+
interface CreateData {
|
|
3
|
+
paymentsIds: string[];
|
|
4
|
+
}
|
|
5
|
+
interface CreateParams extends CreateData {
|
|
6
|
+
partnershipId: string;
|
|
7
|
+
sepaPaymentGroupId: string;
|
|
8
|
+
}
|
|
9
|
+
type CreateResult = void;
|
|
10
|
+
interface EditParams extends Partial<CreateData> {
|
|
11
|
+
partnershipId: string;
|
|
12
|
+
sepaPaymentGroupId: string;
|
|
13
|
+
}
|
|
14
|
+
type EditResult = void;
|
|
15
|
+
type RemoveParams = {
|
|
16
|
+
partnershipId: string;
|
|
17
|
+
sepaPaymentGroupId: string;
|
|
18
|
+
};
|
|
19
|
+
type RemoveResult = void;
|
|
20
|
+
}
|
|
@@ -12,7 +12,8 @@ export declare namespace PartnershipSubscriptionFbFunctionsTypes {
|
|
|
12
12
|
interface EditParams {
|
|
13
13
|
partnershipId: string;
|
|
14
14
|
subscriptionId: string;
|
|
15
|
-
|
|
15
|
+
nextPaymentDate?: number;
|
|
16
|
+
endDate?: number | null;
|
|
16
17
|
}
|
|
17
18
|
type EditResult = void;
|
|
18
19
|
type RemoveParams = {
|
package/functions/regions.js
CHANGED
|
@@ -125,18 +125,36 @@ const regionByFunctions = {
|
|
|
125
125
|
[index_1.FbFunctionName.OfferSelectApplicant]: GCloudRegions.EuropeWest6,
|
|
126
126
|
[index_1.FbFunctionName.OfferView]: GCloudRegions.EuropeWest6,
|
|
127
127
|
[index_1.FbFunctionName.OfferViewApplicant]: GCloudRegions.EuropeWest6,
|
|
128
|
-
[index_1.FbFunctionName.PartnershipAddConfirmedAdmin]: GCloudRegions.EuropeWest6,
|
|
129
128
|
[index_1.FbFunctionName.PartnershipCreate]: GCloudRegions.EuropeWest6,
|
|
129
|
+
[index_1.FbFunctionName.PartnershipPublish]: GCloudRegions.EuropeWest6,
|
|
130
130
|
[index_1.FbFunctionName.PartnershipEdit]: GCloudRegions.EuropeWest6,
|
|
131
|
-
[index_1.FbFunctionName.PartnershipGroupAdd]: GCloudRegions.EuropeWest6,
|
|
132
|
-
[index_1.FbFunctionName.PartnershipGroupRemove]: GCloudRegions.EuropeWest6,
|
|
133
131
|
[index_1.FbFunctionName.PartnershipOnUpdate]: GCloudRegions.EuropeWest6,
|
|
134
|
-
[index_1.FbFunctionName.PartnershipPublish]: GCloudRegions.EuropeWest6,
|
|
135
132
|
[index_1.FbFunctionName.PartnershipRemove]: GCloudRegions.EuropeWest6,
|
|
133
|
+
[index_1.FbFunctionName.PartnershipOnDelete]: GCloudRegions.EuropeWest6,
|
|
134
|
+
[index_1.FbFunctionName.PartnershipAddConfirmedAdmin]: GCloudRegions.EuropeWest6,
|
|
136
135
|
[index_1.FbFunctionName.PartnershipRemoveAdmin]: GCloudRegions.EuropeWest6,
|
|
136
|
+
[index_1.FbFunctionName.PartnershipGroupAdd]: GCloudRegions.EuropeWest6,
|
|
137
|
+
[index_1.FbFunctionName.PartnershipGroupRemove]: GCloudRegions.EuropeWest6,
|
|
137
138
|
[index_1.FbFunctionName.PartnershipPartnerCreate]: GCloudRegions.EuropeWest6,
|
|
138
139
|
[index_1.FbFunctionName.PartnershipPartnerEdit]: GCloudRegions.EuropeWest6,
|
|
140
|
+
[index_1.FbFunctionName.PartnershipPartnerOnWrite]: GCloudRegions.EuropeWest6,
|
|
139
141
|
[index_1.FbFunctionName.PartnershipPartnerRemove]: GCloudRegions.EuropeWest6,
|
|
142
|
+
[index_1.FbFunctionName.PartnershipPaymentCreateOneTime]: GCloudRegions.EuropeWest6,
|
|
143
|
+
[index_1.FbFunctionName.PartnershipPaymentGenerateRecurringBySubscriptions]: GCloudRegions.EuropeWest6,
|
|
144
|
+
[index_1.FbFunctionName.PartnershipPaymentEdit]: GCloudRegions.EuropeWest6,
|
|
145
|
+
[index_1.FbFunctionName.PartnershipPaymentOnUpdate]: GCloudRegions.EuropeWest6,
|
|
146
|
+
[index_1.FbFunctionName.PartnershipPaymentRemove]: GCloudRegions.EuropeWest6,
|
|
147
|
+
[index_1.FbFunctionName.PartnershipPlanCreate]: GCloudRegions.EuropeWest6,
|
|
148
|
+
[index_1.FbFunctionName.PartnershipPlanEdit]: GCloudRegions.EuropeWest6,
|
|
149
|
+
[index_1.FbFunctionName.PartnershipPlanRemove]: GCloudRegions.EuropeWest6,
|
|
150
|
+
[index_1.FbFunctionName.PartnershipSepaPaymentGroupCreate]: GCloudRegions.EuropeWest6,
|
|
151
|
+
[index_1.FbFunctionName.PartnershipSepaPaymentGroupEdit]: GCloudRegions.EuropeWest6,
|
|
152
|
+
[index_1.FbFunctionName.PartnershipSepaPaymentGroupOnUpdate]: GCloudRegions.EuropeWest6,
|
|
153
|
+
[index_1.FbFunctionName.PartnershipSepaPaymentGroupRemove]: GCloudRegions.EuropeWest6,
|
|
154
|
+
[index_1.FbFunctionName.PartnershipSubscriptionCreate]: GCloudRegions.EuropeWest6,
|
|
155
|
+
[index_1.FbFunctionName.PartnershipSubscriptionEdit]: GCloudRegions.EuropeWest6,
|
|
156
|
+
[index_1.FbFunctionName.PartnershipSubscriptionOnWrite]: GCloudRegions.EuropeWest6,
|
|
157
|
+
[index_1.FbFunctionName.PartnershipSubscriptionRemove]: GCloudRegions.EuropeWest6,
|
|
140
158
|
[index_1.FbFunctionName.ReminderBiweeklyEventsEmail]: GCloudRegions.EuropeWest6,
|
|
141
159
|
[index_1.FbFunctionName.ReminderDatetime]: GCloudRegions.EuropeWest6,
|
|
142
160
|
[index_1.FbFunctionName.ReminderResponseDeadlineEnded]: GCloudRegions.EuropeWest6,
|
package/helpers/collections.d.ts
CHANGED
|
@@ -21,11 +21,12 @@ export declare enum CollectionNames {
|
|
|
21
21
|
GroupStageTemplates = "stageTemplates",
|
|
22
22
|
Metrics = "metrics",
|
|
23
23
|
Partnership = "partnership",
|
|
24
|
-
PartnershipPartner = "partnershipPartner",
|
|
25
24
|
PartnershipGroup = "partnershipGroup",
|
|
25
|
+
PartnershipPartner = "partnershipPartner",
|
|
26
|
+
PartnershipPlan = "partnershipPlan",
|
|
26
27
|
PartnershipSubscription = "partnershipSubscription",
|
|
27
28
|
PartnershipPayment = "partnershipPayment",
|
|
28
|
-
|
|
29
|
+
PartnershipSepaPaymentGroup = "partnershipSepaPaymentGroup",
|
|
29
30
|
Federation = "federation",
|
|
30
31
|
FederationPartnerships = "partnerships",
|
|
31
32
|
Offer = "offer",
|
package/helpers/collections.js
CHANGED
|
@@ -25,11 +25,12 @@ var CollectionNames;
|
|
|
25
25
|
CollectionNames["GroupStageTemplates"] = "stageTemplates";
|
|
26
26
|
CollectionNames["Metrics"] = "metrics";
|
|
27
27
|
CollectionNames["Partnership"] = "partnership";
|
|
28
|
-
CollectionNames["PartnershipPartner"] = "partnershipPartner";
|
|
29
28
|
CollectionNames["PartnershipGroup"] = "partnershipGroup";
|
|
29
|
+
CollectionNames["PartnershipPartner"] = "partnershipPartner";
|
|
30
|
+
CollectionNames["PartnershipPlan"] = "partnershipPlan";
|
|
30
31
|
CollectionNames["PartnershipSubscription"] = "partnershipSubscription";
|
|
31
32
|
CollectionNames["PartnershipPayment"] = "partnershipPayment";
|
|
32
|
-
CollectionNames["
|
|
33
|
+
CollectionNames["PartnershipSepaPaymentGroup"] = "partnershipSepaPaymentGroup";
|
|
33
34
|
CollectionNames["Federation"] = "federation";
|
|
34
35
|
CollectionNames["FederationPartnerships"] = "partnerships";
|
|
35
36
|
CollectionNames["Offer"] = "offer";
|
package/helpers/errors.d.ts
CHANGED
|
@@ -26,9 +26,12 @@ export declare enum HttpsErrorMessages {
|
|
|
26
26
|
InvalidPartnershipPartner = "error.partner.noValid",
|
|
27
27
|
PartnershipPartnerNotSelf = "error.partner.notSelf",
|
|
28
28
|
InvalidPartnershipPlan = "error.partnershipPlan.noValid",
|
|
29
|
+
PartnershipPlanFirstPaymentDateAfterEndDate = "error.partnershipPlan.firstPaymentDateAfterEndDate",
|
|
29
30
|
PartnershipPlanWithSubscriptions = "error.partnershipPlan.withSubscriptions",
|
|
30
31
|
InvalidPartnershipSubscription = "error.partnershipSubscription.noValid",
|
|
32
|
+
PartnershipSubscriptionNextPaymentDateAfterEndDate = "error.partnershipSubscription.nextPaymentDateAfterEndDate",
|
|
31
33
|
InvalidPartnershipPayment = "error.partnershipPayment.noValid",
|
|
34
|
+
PartnershipPaymentInSepaPaymentGroup = "error.partnershipPayment.inSepaPaymentGroup",
|
|
32
35
|
InvalidPartnershipSepaPaymentGroup = "error.partnershipSepaPaymentGroup.noValid",
|
|
33
36
|
InvalidAdminPartnership = "error.partnership.noAdmin",
|
|
34
37
|
InvalidAdminFederation = "error.federation.noAdmin",
|
package/helpers/errors.js
CHANGED
|
@@ -27,9 +27,12 @@ var HttpsErrorMessages;
|
|
|
27
27
|
HttpsErrorMessages["InvalidPartnershipPartner"] = "error.partner.noValid";
|
|
28
28
|
HttpsErrorMessages["PartnershipPartnerNotSelf"] = "error.partner.notSelf";
|
|
29
29
|
HttpsErrorMessages["InvalidPartnershipPlan"] = "error.partnershipPlan.noValid";
|
|
30
|
+
HttpsErrorMessages["PartnershipPlanFirstPaymentDateAfterEndDate"] = "error.partnershipPlan.firstPaymentDateAfterEndDate";
|
|
30
31
|
HttpsErrorMessages["PartnershipPlanWithSubscriptions"] = "error.partnershipPlan.withSubscriptions";
|
|
31
32
|
HttpsErrorMessages["InvalidPartnershipSubscription"] = "error.partnershipSubscription.noValid";
|
|
33
|
+
HttpsErrorMessages["PartnershipSubscriptionNextPaymentDateAfterEndDate"] = "error.partnershipSubscription.nextPaymentDateAfterEndDate";
|
|
32
34
|
HttpsErrorMessages["InvalidPartnershipPayment"] = "error.partnershipPayment.noValid";
|
|
35
|
+
HttpsErrorMessages["PartnershipPaymentInSepaPaymentGroup"] = "error.partnershipPayment.inSepaPaymentGroup";
|
|
33
36
|
HttpsErrorMessages["InvalidPartnershipSepaPaymentGroup"] = "error.partnershipSepaPaymentGroup.noValid";
|
|
34
37
|
HttpsErrorMessages["InvalidAdminPartnership"] = "error.partnership.noAdmin";
|
|
35
38
|
HttpsErrorMessages["InvalidAdminFederation"] = "error.federation.noAdmin";
|
package/helpers/types.d.ts
CHANGED
package/helpers/types.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
|
-
exports.displayBasicAddress = exports.CreatedOn = exports.AdminItemStatus = void 0;
|
|
6
|
+
exports.displayBasicAddress = exports.CreatedBy = exports.CreatedOn = exports.AdminItemStatus = void 0;
|
|
7
7
|
const isString_1 = __importDefault(require("lodash/isString"));
|
|
8
8
|
var AdminItemStatus;
|
|
9
9
|
(function (AdminItemStatus) {
|
|
@@ -17,6 +17,10 @@ var CreatedOn;
|
|
|
17
17
|
CreatedOn["App"] = "app";
|
|
18
18
|
CreatedOn["Dashboard"] = "dashboard";
|
|
19
19
|
})(CreatedOn = exports.CreatedOn || (exports.CreatedOn = {}));
|
|
20
|
+
var CreatedBy;
|
|
21
|
+
(function (CreatedBy) {
|
|
22
|
+
CreatedBy["System"] = "system";
|
|
23
|
+
})(CreatedBy = exports.CreatedBy || (exports.CreatedBy = {}));
|
|
20
24
|
function displayBasicAddress(address) {
|
|
21
25
|
if (address === null || address === undefined)
|
|
22
26
|
return null;
|
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
import ModelWithLang from '../../Model/lang';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { PaymentMethod } from '../Plan/types';
|
|
3
|
+
import { PartnershipPaymentData } from './types';
|
|
4
|
+
export default class PartnershipPayment extends ModelWithLang<PartnershipPaymentData> {
|
|
5
|
+
get partnershipId(): string;
|
|
5
6
|
get title(): string;
|
|
6
7
|
get amount(): number;
|
|
7
8
|
get displayAmount(): string;
|
|
8
|
-
get
|
|
9
|
+
get subscriptionId(): string | null;
|
|
10
|
+
get partnerId(): string;
|
|
9
11
|
get isRecurrent(): boolean;
|
|
10
12
|
get isOneTime(): boolean;
|
|
11
|
-
get
|
|
12
|
-
get
|
|
13
|
-
get
|
|
14
|
-
get
|
|
15
|
-
get
|
|
13
|
+
get paymentMethod(): PaymentMethod;
|
|
14
|
+
get isMethodSepa(): boolean;
|
|
15
|
+
get status(): import("./types").PaymentStatus;
|
|
16
|
+
get statusHistory(): import("./types").PaymentStatusHistoryItem[];
|
|
17
|
+
get statusHistoryOrdered(): import("./types").PaymentStatusHistoryItem[];
|
|
18
|
+
get sepaPaymentGroupId(): string | null;
|
|
19
|
+
get isLinkedToSepaPaymentGroup(): boolean;
|
|
16
20
|
get createdAt(): FirebaseFirestore.Timestamp;
|
|
17
21
|
get createdBy(): string | null;
|
|
18
22
|
get editedAt(): FirebaseFirestore.Timestamp | null;
|
|
19
23
|
get editedBy(): string | null;
|
|
24
|
+
get isActive(): boolean;
|
|
20
25
|
}
|
|
@@ -5,10 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const utils_1 = require("../../../helpers/utils");
|
|
7
7
|
const lang_1 = __importDefault(require("../../Model/lang"));
|
|
8
|
-
const types_1 = require("
|
|
9
|
-
class
|
|
8
|
+
const types_1 = require("../Plan/types");
|
|
9
|
+
class PartnershipPayment extends lang_1.default {
|
|
10
10
|
get partnershipId() {
|
|
11
|
-
return (0, utils_1.at)(this.ref.path.split('/'), 1);
|
|
11
|
+
return (0, utils_1.at)(this.ref.path.split('/'), 1) || '';
|
|
12
12
|
}
|
|
13
13
|
get title() {
|
|
14
14
|
return this.data.title;
|
|
@@ -19,29 +19,38 @@ class Payment extends lang_1.default {
|
|
|
19
19
|
get displayAmount() {
|
|
20
20
|
return `${this.amount} €`;
|
|
21
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;
|
|
30
|
-
}
|
|
31
22
|
get subscriptionId() {
|
|
32
23
|
return this.data.subscriptionId;
|
|
33
24
|
}
|
|
34
25
|
get partnerId() {
|
|
35
26
|
return this.data.partnerId;
|
|
36
27
|
}
|
|
28
|
+
get isRecurrent() {
|
|
29
|
+
return this.subscriptionId !== null;
|
|
30
|
+
}
|
|
31
|
+
get isOneTime() {
|
|
32
|
+
return this.subscriptionId === null;
|
|
33
|
+
}
|
|
37
34
|
get paymentMethod() {
|
|
38
35
|
return this.data.paymentMethod;
|
|
39
36
|
}
|
|
40
|
-
get
|
|
41
|
-
return this.
|
|
37
|
+
get isMethodSepa() {
|
|
38
|
+
return this.paymentMethod === types_1.PaymentMethod.SEPA;
|
|
39
|
+
}
|
|
40
|
+
get status() {
|
|
41
|
+
return this.data.status;
|
|
42
|
+
}
|
|
43
|
+
get statusHistory() {
|
|
44
|
+
return this.data.statusHistory;
|
|
42
45
|
}
|
|
43
|
-
get
|
|
44
|
-
return this.
|
|
46
|
+
get statusHistoryOrdered() {
|
|
47
|
+
return this.statusHistory.sort((a, b) => a.changedAt.toMillis() < b.changedAt.toMillis() ? 1 : -1);
|
|
48
|
+
}
|
|
49
|
+
get sepaPaymentGroupId() {
|
|
50
|
+
return this.data.sepaPaymentGroupId || null;
|
|
51
|
+
}
|
|
52
|
+
get isLinkedToSepaPaymentGroup() {
|
|
53
|
+
return !!this.sepaPaymentGroupId;
|
|
45
54
|
}
|
|
46
55
|
get createdAt() {
|
|
47
56
|
return this.data.createdAt;
|
|
@@ -55,5 +64,8 @@ class Payment extends lang_1.default {
|
|
|
55
64
|
get editedBy() {
|
|
56
65
|
return this.data.editedBy || null;
|
|
57
66
|
}
|
|
67
|
+
get isActive() {
|
|
68
|
+
return this.exists;
|
|
69
|
+
}
|
|
58
70
|
}
|
|
59
|
-
exports.default =
|
|
71
|
+
exports.default = PartnershipPayment;
|
|
@@ -1,27 +1,24 @@
|
|
|
1
1
|
import { Timestamp } from '@google-cloud/firestore';
|
|
2
2
|
import { PaymentMethod } from '../Plan/types';
|
|
3
|
-
export declare enum PaymentType {
|
|
4
|
-
Recurring = "RCUR",
|
|
5
|
-
OneTime = "OOFF"
|
|
6
|
-
}
|
|
7
3
|
export declare enum PaymentStatus {
|
|
8
4
|
Pending = "pending",
|
|
9
5
|
Charged = "charged",
|
|
10
6
|
Canceled = "canceled"
|
|
11
7
|
}
|
|
12
|
-
export interface
|
|
8
|
+
export interface PaymentStatusHistoryItem {
|
|
13
9
|
status: PaymentStatus;
|
|
14
10
|
changedAt: Timestamp;
|
|
15
11
|
changedBy: string;
|
|
16
12
|
}
|
|
17
|
-
export interface
|
|
13
|
+
export interface PartnershipPaymentData {
|
|
18
14
|
title: string;
|
|
19
15
|
amount: number;
|
|
20
|
-
|
|
16
|
+
paymentMethod: PaymentMethod;
|
|
21
17
|
subscriptionId: string | null;
|
|
22
|
-
partnerId: string
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
partnerId: string;
|
|
19
|
+
status: PaymentStatus;
|
|
20
|
+
statusHistory: PaymentStatusHistoryItem[];
|
|
21
|
+
sepaPaymentGroupId: string | null;
|
|
25
22
|
createdAt: Timestamp;
|
|
26
23
|
createdBy: string | null;
|
|
27
24
|
editedAt: Timestamp | null;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PaymentStatus =
|
|
4
|
-
var PaymentType;
|
|
5
|
-
(function (PaymentType) {
|
|
6
|
-
PaymentType["Recurring"] = "RCUR";
|
|
7
|
-
PaymentType["OneTime"] = "OOFF";
|
|
8
|
-
})(PaymentType = exports.PaymentType || (exports.PaymentType = {}));
|
|
3
|
+
exports.PaymentStatus = void 0;
|
|
9
4
|
var PaymentStatus;
|
|
10
5
|
(function (PaymentStatus) {
|
|
11
6
|
PaymentStatus["Pending"] = "pending";
|
|
@@ -22,7 +22,7 @@ class PartnershipPlan extends lang_1.default {
|
|
|
22
22
|
: date;
|
|
23
23
|
}
|
|
24
24
|
setPaymentDate(date) {
|
|
25
|
-
return this.setPaymentMonth(this.setPaymentDay(date));
|
|
25
|
+
return (0, date_fns_1.startOfDay)(this.setPaymentMonth(this.setPaymentDay(date)));
|
|
26
26
|
}
|
|
27
27
|
getNextPaymentDate(base) {
|
|
28
28
|
const newDate = (0, date_fns_1.addMonths)(base, this.schedule.periodInMonths);
|
|
@@ -3,5 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PaymentMethod = void 0;
|
|
4
4
|
var PaymentMethod;
|
|
5
5
|
(function (PaymentMethod) {
|
|
6
|
+
PaymentMethod["Cash"] = "CASH";
|
|
7
|
+
PaymentMethod["Transfer"] = "TRANSFER";
|
|
6
8
|
PaymentMethod["SEPA"] = "SEPA";
|
|
7
9
|
})(PaymentMethod = exports.PaymentMethod || (exports.PaymentMethod = {}));
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import ModelWithLang from '../../Model/lang';
|
|
2
|
-
import {
|
|
3
|
-
export default class
|
|
2
|
+
import { PartnershipSepaPaymentGroupData } from './types';
|
|
3
|
+
export default class PartnershipSepaPaymentGroup extends ModelWithLang<PartnershipSepaPaymentGroupData> {
|
|
4
4
|
get partnershipId(): string;
|
|
5
5
|
get creditorInfo(): import("../types").PartnershipSepaCreditorInfo;
|
|
6
|
-
get filePath(): string | null;
|
|
7
6
|
get paymentsIds(): string[];
|
|
7
|
+
get filePath(): string | null;
|
|
8
8
|
get createdAt(): import("../../../types/firestore").Timestamp;
|
|
9
9
|
get createdBy(): string;
|
|
10
10
|
get editedAt(): import("../../../types/firestore").Timestamp | null;
|
|
11
11
|
get editedBy(): string | null;
|
|
12
|
+
get isActive(): boolean;
|
|
12
13
|
}
|
|
@@ -5,19 +5,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const utils_1 = require("../../../helpers/utils");
|
|
7
7
|
const lang_1 = __importDefault(require("../../Model/lang"));
|
|
8
|
-
class
|
|
8
|
+
class PartnershipSepaPaymentGroup extends lang_1.default {
|
|
9
9
|
get partnershipId() {
|
|
10
10
|
return (0, utils_1.at)(this.ref.path.split('/'), 1) || '';
|
|
11
11
|
}
|
|
12
12
|
get creditorInfo() {
|
|
13
13
|
return this.data.creditorInfo;
|
|
14
14
|
}
|
|
15
|
-
get filePath() {
|
|
16
|
-
return this.data.filePath || null;
|
|
17
|
-
}
|
|
18
15
|
get paymentsIds() {
|
|
19
16
|
return this.data.paymentsIds || [];
|
|
20
17
|
}
|
|
18
|
+
get filePath() {
|
|
19
|
+
return this.data.filePath || null;
|
|
20
|
+
}
|
|
21
21
|
get createdAt() {
|
|
22
22
|
return this.data.createdAt;
|
|
23
23
|
}
|
|
@@ -30,5 +30,8 @@ class PartnerSepaPaymentGroup extends lang_1.default {
|
|
|
30
30
|
get editedBy() {
|
|
31
31
|
return this.data.editedBy || null;
|
|
32
32
|
}
|
|
33
|
+
get isActive() {
|
|
34
|
+
return this.exists;
|
|
35
|
+
}
|
|
33
36
|
}
|
|
34
|
-
exports.default =
|
|
37
|
+
exports.default = PartnershipSepaPaymentGroup;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Timestamp } from '../../../types/firestore';
|
|
2
2
|
import { PartnershipSepaCreditorInfo } from '../types';
|
|
3
|
-
export interface
|
|
3
|
+
export interface PartnershipSepaPaymentGroupData {
|
|
4
4
|
creditorInfo: PartnershipSepaCreditorInfo;
|
|
5
|
+
paymentsIds: string[];
|
|
5
6
|
filePath: string | null;
|
|
6
7
|
createdAt: Timestamp;
|
|
7
8
|
createdBy: string;
|
|
8
|
-
paymentsIds: string[];
|
|
9
9
|
editedAt: Timestamp | null;
|
|
10
10
|
editedBy: string | null;
|
|
11
11
|
}
|
|
@@ -4,7 +4,9 @@ export default class PartnershipSubscription extends Model<PartnershipSubscripti
|
|
|
4
4
|
get partnershipId(): string;
|
|
5
5
|
get planId(): string;
|
|
6
6
|
get partnerId(): string;
|
|
7
|
+
get nextPaymentDate(): FirebaseFirestore.Timestamp;
|
|
7
8
|
get endDate(): FirebaseFirestore.Timestamp | null;
|
|
9
|
+
get isEnded(): boolean;
|
|
8
10
|
get createdAt(): FirebaseFirestore.Timestamp;
|
|
9
11
|
get createdBy(): string;
|
|
10
12
|
get editedAt(): FirebaseFirestore.Timestamp | null;
|
|
@@ -3,6 +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 date_fns_1 = require("date-fns");
|
|
6
7
|
const utils_1 = require("../../../helpers/utils");
|
|
7
8
|
const Model_1 = __importDefault(require("../../Model"));
|
|
8
9
|
class PartnershipSubscription extends Model_1.default {
|
|
@@ -15,9 +16,15 @@ class PartnershipSubscription extends Model_1.default {
|
|
|
15
16
|
get partnerId() {
|
|
16
17
|
return this.data.partnerId;
|
|
17
18
|
}
|
|
19
|
+
get nextPaymentDate() {
|
|
20
|
+
return this.data.nextPaymentDate;
|
|
21
|
+
}
|
|
18
22
|
get endDate() {
|
|
19
23
|
return this.data.endDate || null;
|
|
20
24
|
}
|
|
25
|
+
get isEnded() {
|
|
26
|
+
return this.endDate ? (0, date_fns_1.isPast)(this.endDate.toDate()) : false;
|
|
27
|
+
}
|
|
21
28
|
get createdAt() {
|
|
22
29
|
return this.data.createdAt;
|
|
23
30
|
}
|
|
@@ -40,7 +47,7 @@ class PartnershipSubscription extends Model_1.default {
|
|
|
40
47
|
return this.deletedAt !== null;
|
|
41
48
|
}
|
|
42
49
|
get isActive() {
|
|
43
|
-
return this.exists && !this.
|
|
50
|
+
return this.exists && !this.isDeleted;
|
|
44
51
|
}
|
|
45
52
|
}
|
|
46
53
|
exports.default = PartnershipSubscription;
|