@glissandoo/lib 1.94.0 → 1.94.2
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/federationPartnership.d.ts +1 -1
- package/functions/index.d.ts +1 -0
- package/functions/index.js +1 -0
- package/functions/partner.d.ts +2 -2
- package/functions/partnership.d.ts +10 -0
- package/functions/partnershipPartner.d.ts +23 -0
- package/functions/partnershipPartner.js +2 -0
- package/functions/regions.js +1 -0
- package/helpers/collections.d.ts +1 -3
- package/helpers/collections.js +1 -3
- package/helpers/payments.d.ts +1 -1
- package/helpers/payments.js +1 -1
- package/models/Customer/basic.d.ts +1 -1
- package/models/Customer/types.d.ts +1 -1
- package/models/Federation/index.d.ts +1 -1
- package/models/Federation/types.d.ts +1 -1
- package/models/Metrics/index.d.ts +0 -2
- package/models/Metrics/index.js +0 -6
- package/models/Metrics/types.d.ts +1 -1
- package/models/{Partner → Partnership/Partner}/basic.d.ts +3 -7
- package/models/{Partner → Partnership/Partner}/basic.js +0 -21
- package/models/Partnership/Partner/index.d.ts +11 -6
- package/models/Partnership/Partner/index.js +29 -9
- package/models/{Partner → Partnership/Partner}/tiny.d.ts +1 -1
- package/models/{Partner → Partnership/Partner}/tiny.js +1 -1
- package/models/Partnership/Partner/types.d.ts +27 -4
- package/models/{Payment → Partnership/Payment}/basic.d.ts +1 -1
- package/models/{Payment → Partnership/Payment}/basic.js +1 -1
- package/models/Partnership/Payment/index.d.ts +9 -4
- package/models/Partnership/Payment/index.js +20 -5
- package/models/Partnership/Payment/types.d.ts +31 -5
- package/models/Partnership/Payment/types.js +15 -0
- package/models/Partnership/{Partner/Subscription → Subscription}/index.d.ts +2 -2
- package/models/Partnership/{Partner/Subscription → Subscription}/index.js +3 -3
- package/models/Partnership/{Partner/Subscription → Subscription}/types.d.ts +2 -2
- package/models/Partnership/basic.d.ts +1 -1
- package/models/Partnership/types.d.ts +1 -12
- package/models/Partnership/types.js +1 -7
- package/models/User/index.d.ts +2 -0
- package/models/User/index.js +4 -0
- package/models/User/types.d.ts +2 -0
- package/models/User/types.js +1 -0
- package/package.json +1 -1
- package/models/Partner/index.d.ts +0 -16
- package/models/Partner/index.js +0 -48
- package/models/Partner/types.d.ts +0 -46
- package/models/Partner/types.js +0 -9
- package/models/Payment/index.d.ts +0 -13
- package/models/Payment/index.js +0 -33
- package/models/Payment/types.d.ts +0 -32
- package/models/Payment/types.js +0 -17
- /package/models/Partnership/{Partner/Subscription → Subscription}/types.js +0 -0
package/functions/index.d.ts
CHANGED
|
@@ -120,6 +120,7 @@ export declare enum FbFunctionName {
|
|
|
120
120
|
PartnershipGroupAdd = "partnershipGroup-add",
|
|
121
121
|
PartnershipGroupRemove = "partnershipGroup-remove",
|
|
122
122
|
PartnershipOnUpdate = "partnership-onUpdate",
|
|
123
|
+
PartnershipPublish = "partnership-publish",
|
|
123
124
|
PartnershipRemove = "partnership-remove",
|
|
124
125
|
PartnershipRemoveAdmin = "partnership-removeAdmin",
|
|
125
126
|
ReminderBiweeklyEventsEmail = "reminder-biweeklyEventsEmail",
|
package/functions/index.js
CHANGED
|
@@ -124,6 +124,7 @@ var FbFunctionName;
|
|
|
124
124
|
FbFunctionName["PartnershipGroupAdd"] = "partnershipGroup-add";
|
|
125
125
|
FbFunctionName["PartnershipGroupRemove"] = "partnershipGroup-remove";
|
|
126
126
|
FbFunctionName["PartnershipOnUpdate"] = "partnership-onUpdate";
|
|
127
|
+
FbFunctionName["PartnershipPublish"] = "partnership-publish";
|
|
127
128
|
FbFunctionName["PartnershipRemove"] = "partnership-remove";
|
|
128
129
|
FbFunctionName["PartnershipRemoveAdmin"] = "partnership-removeAdmin";
|
|
129
130
|
FbFunctionName["ReminderBiweeklyEventsEmail"] = "reminder-biweeklyEventsEmail";
|
package/functions/partner.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BasicAddressData, PartnerData } from '../models/Partner/types';
|
|
2
|
-
import PartnerSubscription from '../models/Partnership/
|
|
1
|
+
import { BasicAddressData, PartnerData } from '../models/Partnership/Partner/types';
|
|
2
|
+
import PartnerSubscription from '../models/Partnership/Subscription';
|
|
3
3
|
import { PartnershipData } from '../models/Partnership/types';
|
|
4
4
|
export declare namespace PartnerFbFunctionsTypes {
|
|
5
5
|
interface CreateParams {
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
+
import { BasicAddressData } from '../models/Partnership/Partner/types';
|
|
1
2
|
export declare namespace PartnershipFbFunctionsTypes {
|
|
3
|
+
interface PublishParams {
|
|
4
|
+
groupId: string;
|
|
5
|
+
displayName: string;
|
|
6
|
+
CIF: string;
|
|
7
|
+
email: string;
|
|
8
|
+
phone: string | null;
|
|
9
|
+
address: BasicAddressData;
|
|
10
|
+
}
|
|
11
|
+
type PublishResult = void;
|
|
2
12
|
interface CreateParams {
|
|
3
13
|
partnershipId: string;
|
|
4
14
|
displayName: string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CreatedOn } from '../helpers/types';
|
|
2
|
+
import { BasicAddressData } from '../models/Partnership/Partner/types';
|
|
3
|
+
export declare namespace PartnershipPartnerFbFunctionsTypes {
|
|
4
|
+
interface CreateParams {
|
|
5
|
+
partnershipId: string;
|
|
6
|
+
partnerId: string;
|
|
7
|
+
name: string;
|
|
8
|
+
lastname: string;
|
|
9
|
+
email: string;
|
|
10
|
+
phone: string | null;
|
|
11
|
+
birthdate: number | null;
|
|
12
|
+
address: BasicAddressData | null;
|
|
13
|
+
createdOn: CreatedOn;
|
|
14
|
+
}
|
|
15
|
+
type CreateResult = void;
|
|
16
|
+
type EditParams = Omit<CreateParams, 'createdOn'>;
|
|
17
|
+
type EditResult = void;
|
|
18
|
+
interface RemoveParams {
|
|
19
|
+
partnershipId: string;
|
|
20
|
+
partnerId: string;
|
|
21
|
+
}
|
|
22
|
+
type RemoveResult = void;
|
|
23
|
+
}
|
package/functions/regions.js
CHANGED
|
@@ -131,6 +131,7 @@ const regionByFunctions = {
|
|
|
131
131
|
[index_1.FbFunctionName.PartnershipGroupAdd]: GCloudRegions.EuropeWest6,
|
|
132
132
|
[index_1.FbFunctionName.PartnershipGroupRemove]: GCloudRegions.EuropeWest6,
|
|
133
133
|
[index_1.FbFunctionName.PartnershipOnUpdate]: GCloudRegions.EuropeWest6,
|
|
134
|
+
[index_1.FbFunctionName.PartnershipPublish]: GCloudRegions.EuropeWest6,
|
|
134
135
|
[index_1.FbFunctionName.PartnershipRemove]: GCloudRegions.EuropeWest6,
|
|
135
136
|
[index_1.FbFunctionName.PartnershipRemoveAdmin]: GCloudRegions.EuropeWest6,
|
|
136
137
|
[index_1.FbFunctionName.ReminderBiweeklyEventsEmail]: GCloudRegions.EuropeWest6,
|
package/helpers/collections.d.ts
CHANGED
|
@@ -20,14 +20,12 @@ export declare enum CollectionNames {
|
|
|
20
20
|
GroupRepertory = "repertory",
|
|
21
21
|
GroupStageTemplates = "stageTemplates",
|
|
22
22
|
Metrics = "metrics",
|
|
23
|
-
Partner = "partner",
|
|
24
23
|
Partnership = "partnership",
|
|
25
24
|
PartnershipPartners = "partners",
|
|
26
25
|
PartnershipGroups = "groups",
|
|
27
|
-
|
|
26
|
+
PartnershipSubscriptions = "subscriptions",
|
|
28
27
|
PartnershipPayments = "payments",
|
|
29
28
|
PartnershipPlans = "plans",
|
|
30
|
-
Payment = "payment",
|
|
31
29
|
Federation = "federation",
|
|
32
30
|
FederationPartnerships = "partnerships",
|
|
33
31
|
Offer = "offer",
|
package/helpers/collections.js
CHANGED
|
@@ -24,14 +24,12 @@ var CollectionNames;
|
|
|
24
24
|
CollectionNames["GroupRepertory"] = "repertory";
|
|
25
25
|
CollectionNames["GroupStageTemplates"] = "stageTemplates";
|
|
26
26
|
CollectionNames["Metrics"] = "metrics";
|
|
27
|
-
CollectionNames["Partner"] = "partner";
|
|
28
27
|
CollectionNames["Partnership"] = "partnership";
|
|
29
28
|
CollectionNames["PartnershipPartners"] = "partners";
|
|
30
29
|
CollectionNames["PartnershipGroups"] = "groups";
|
|
31
|
-
CollectionNames["
|
|
30
|
+
CollectionNames["PartnershipSubscriptions"] = "subscriptions";
|
|
32
31
|
CollectionNames["PartnershipPayments"] = "payments";
|
|
33
32
|
CollectionNames["PartnershipPlans"] = "plans";
|
|
34
|
-
CollectionNames["Payment"] = "payment";
|
|
35
33
|
CollectionNames["Federation"] = "federation";
|
|
36
34
|
CollectionNames["FederationPartnerships"] = "partnerships";
|
|
37
35
|
CollectionNames["Offer"] = "offer";
|
package/helpers/payments.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { PaymentStatus } from '../models/Payment/types';
|
|
1
|
+
import { PaymentStatus } from '../models/Partnership/Payment/types';
|
|
2
2
|
export declare const paymentStatusErrors: PaymentStatus[];
|
package/helpers/payments.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.paymentStatusErrors = void 0;
|
|
4
|
-
const types_1 = require("../models/Payment/types");
|
|
4
|
+
const types_1 = require("../models/Partnership/Payment/types");
|
|
5
5
|
exports.paymentStatusErrors = [
|
|
6
6
|
types_1.PaymentStatus.Error,
|
|
7
7
|
types_1.PaymentStatus.Chargeback,
|
|
@@ -5,7 +5,7 @@ export default class CustomerBasic<D> extends Model<D & CustomerBasicData> {
|
|
|
5
5
|
get basicInfo(): CustomerBasicData;
|
|
6
6
|
get displayName(): string;
|
|
7
7
|
get email(): string;
|
|
8
|
-
get address(): import("../Partner/types").BasicAddressData;
|
|
8
|
+
get address(): import("../Partnership/Partner/types").BasicAddressData;
|
|
9
9
|
get displayAddress(): string;
|
|
10
10
|
get phone(): string | null;
|
|
11
11
|
get groupIds(): string[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DocumentReference, Timestamp } from '@google-cloud/firestore';
|
|
2
2
|
import { AdminItem } from '../../helpers/types';
|
|
3
|
-
import { BasicAddressData } from '../Partner/types';
|
|
3
|
+
import { BasicAddressData } from '../Partnership/Partner/types';
|
|
4
4
|
export declare enum CustomerRoles {
|
|
5
5
|
Admin = "admin"
|
|
6
6
|
}
|
|
@@ -13,7 +13,7 @@ export default class Federation extends Model<FederationData> {
|
|
|
13
13
|
get photoURL(): string;
|
|
14
14
|
get phone(): string | null;
|
|
15
15
|
get web(): string | null;
|
|
16
|
-
get address(): import("../Partner/types").BasicAddressData | null;
|
|
16
|
+
get address(): import("../Partnership/Partner/types").BasicAddressData | null;
|
|
17
17
|
get displayAddress(): string;
|
|
18
18
|
get partnershipConnectedIds(): string[];
|
|
19
19
|
get createdAt(): FirebaseFirestore.Timestamp;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DocumentReference, Timestamp } from '@google-cloud/firestore';
|
|
2
2
|
import { AdminItem } from '../../helpers/types';
|
|
3
|
-
import { BasicAddressData } from '../Partner/types';
|
|
3
|
+
import { BasicAddressData } from '../Partnership/Partner/types';
|
|
4
4
|
export interface FederationData {
|
|
5
5
|
displayName: string;
|
|
6
6
|
photoURL: string;
|
|
@@ -9,8 +9,6 @@ export default class Metrics extends Model<MetricsData> {
|
|
|
9
9
|
get events(): EntityTypes;
|
|
10
10
|
get communications(): EntityTypes;
|
|
11
11
|
get repertory(): EntityTypes;
|
|
12
|
-
get partnerships(): EntityTypes;
|
|
13
|
-
get partners(): EntityTypes;
|
|
14
12
|
get date(): FirebaseFirestore.Timestamp;
|
|
15
13
|
get createdAt(): FirebaseFirestore.Timestamp;
|
|
16
14
|
}
|
package/models/Metrics/index.js
CHANGED
|
@@ -31,12 +31,6 @@ class Metrics extends Model_1.default {
|
|
|
31
31
|
get repertory() {
|
|
32
32
|
return this.data.repertory || this.defaultEntity;
|
|
33
33
|
}
|
|
34
|
-
get partnerships() {
|
|
35
|
-
return this.data.partnership || this.defaultEntity;
|
|
36
|
-
}
|
|
37
|
-
get partners() {
|
|
38
|
-
return this.data.partner || this.defaultEntity;
|
|
39
|
-
}
|
|
40
34
|
get date() {
|
|
41
35
|
return this.data.date;
|
|
42
36
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Timestamp } from '@google-cloud/firestore';
|
|
2
2
|
import { CollectionNames } from '../../helpers/collections';
|
|
3
|
-
export type AllowCollections = CollectionNames.User | CollectionNames.Group | CollectionNames.Event | CollectionNames.Communication | CollectionNames.GroupRepertory | CollectionNames.
|
|
3
|
+
export type AllowCollections = CollectionNames.User | CollectionNames.Group | CollectionNames.Event | CollectionNames.Communication | CollectionNames.GroupRepertory | CollectionNames.Customer;
|
|
4
4
|
export interface EntityTypes {
|
|
5
5
|
total: number;
|
|
6
6
|
acc: number;
|
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
import { DocumentModel } from '
|
|
1
|
+
import { DocumentModel } from '../../Model';
|
|
2
2
|
import PartnerTiny from './tiny';
|
|
3
|
-
import { PartnerBasicData
|
|
3
|
+
import { PartnerBasicData } from './types';
|
|
4
4
|
export default class PartnerBasic<D> extends PartnerTiny<D & PartnerBasicData> {
|
|
5
5
|
constructor(doc: DocumentModel);
|
|
6
6
|
get basicInfo(): PartnerBasicData;
|
|
7
|
-
get status(): PartnerStatus;
|
|
8
7
|
get createdAt(): FirebaseFirestore.Timestamp;
|
|
9
|
-
get createdBy():
|
|
8
|
+
get createdBy(): import("../../../types/firestore").DocumentReference<import("../../../types/firestore").DocumentData>;
|
|
10
9
|
get deletedAt(): FirebaseFirestore.Timestamp | null;
|
|
11
10
|
get deletedBy(): string | null;
|
|
12
11
|
get isDeleted(): boolean;
|
|
13
|
-
get verifiedAt(): FirebaseFirestore.Timestamp | null;
|
|
14
|
-
get verifiedBy(): string | null;
|
|
15
|
-
get isVerified(): boolean;
|
|
16
12
|
get isActive(): boolean;
|
|
17
13
|
}
|
|
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const tiny_1 = __importDefault(require("./tiny"));
|
|
7
|
-
const types_1 = require("./types");
|
|
8
7
|
class PartnerBasic extends tiny_1.default {
|
|
9
8
|
constructor(doc) {
|
|
10
9
|
super(doc);
|
|
@@ -12,23 +11,12 @@ class PartnerBasic extends tiny_1.default {
|
|
|
12
11
|
get basicInfo() {
|
|
13
12
|
return {
|
|
14
13
|
...this.tinyInfo,
|
|
15
|
-
verifiedAt: this.verifiedAt,
|
|
16
|
-
verifiedBy: this.verifiedBy,
|
|
17
14
|
deletedAt: this.deletedAt,
|
|
18
15
|
deletedBy: this.deletedBy,
|
|
19
16
|
createdAt: this.createdAt,
|
|
20
17
|
createdBy: this.createdBy,
|
|
21
18
|
};
|
|
22
19
|
}
|
|
23
|
-
get status() {
|
|
24
|
-
if (this.isDeleted) {
|
|
25
|
-
return types_1.PartnerStatus.Deleted;
|
|
26
|
-
}
|
|
27
|
-
if (this.isVerified) {
|
|
28
|
-
return types_1.PartnerStatus.Verified;
|
|
29
|
-
}
|
|
30
|
-
return types_1.PartnerStatus.PendingVerification;
|
|
31
|
-
}
|
|
32
20
|
get createdAt() {
|
|
33
21
|
return this.data.createdAt;
|
|
34
22
|
}
|
|
@@ -44,15 +32,6 @@ class PartnerBasic extends tiny_1.default {
|
|
|
44
32
|
get isDeleted() {
|
|
45
33
|
return this.deletedAt !== null;
|
|
46
34
|
}
|
|
47
|
-
get verifiedAt() {
|
|
48
|
-
return this.data.verifiedAt || null;
|
|
49
|
-
}
|
|
50
|
-
get verifiedBy() {
|
|
51
|
-
return this.data.verifiedBy || null;
|
|
52
|
-
}
|
|
53
|
-
get isVerified() {
|
|
54
|
-
return this.verifiedAt !== null;
|
|
55
|
-
}
|
|
56
35
|
get isActive() {
|
|
57
36
|
return this.exists && !this.isDeleted;
|
|
58
37
|
}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { DocumentModel } from '../../Model';
|
|
2
|
-
import PartnerBasic from '
|
|
3
|
-
import {
|
|
4
|
-
export default class
|
|
2
|
+
import PartnerBasic from './basic';
|
|
3
|
+
import { PartnerData } from './types';
|
|
4
|
+
export default class Partner extends PartnerBasic<PartnerData> {
|
|
5
5
|
constructor(doc: DocumentModel);
|
|
6
|
-
get
|
|
7
|
-
get
|
|
8
|
-
get
|
|
6
|
+
get name(): string;
|
|
7
|
+
get lastname(): string;
|
|
8
|
+
get email(): string;
|
|
9
|
+
get phone(): string | null;
|
|
10
|
+
get birthdate(): FirebaseFirestore.Timestamp | null;
|
|
11
|
+
get partnershipId(): string[];
|
|
12
|
+
get address(): import("./types").BasicAddressData | null;
|
|
13
|
+
get displayAddress(): string | null;
|
|
9
14
|
}
|
|
@@ -3,20 +3,40 @@ 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
|
-
|
|
6
|
+
const lodash_1 = require("lodash");
|
|
7
|
+
const isString_1 = __importDefault(require("lodash/isString"));
|
|
8
|
+
const basic_1 = __importDefault(require("./basic"));
|
|
9
|
+
class Partner extends basic_1.default {
|
|
9
10
|
constructor(doc) {
|
|
10
11
|
super(doc);
|
|
11
12
|
}
|
|
13
|
+
get name() {
|
|
14
|
+
return this.data.name;
|
|
15
|
+
}
|
|
16
|
+
get lastname() {
|
|
17
|
+
return this.data.lastname;
|
|
18
|
+
}
|
|
19
|
+
get email() {
|
|
20
|
+
return this.data.email;
|
|
21
|
+
}
|
|
22
|
+
get phone() {
|
|
23
|
+
return this.data.phone;
|
|
24
|
+
}
|
|
25
|
+
get birthdate() {
|
|
26
|
+
return this.data.birthdate;
|
|
27
|
+
}
|
|
12
28
|
get partnershipId() {
|
|
13
|
-
return (0,
|
|
29
|
+
return (0, lodash_1.at)(this.ref.path.split('/'), 1) || '';
|
|
14
30
|
}
|
|
15
|
-
get
|
|
16
|
-
return this.data.
|
|
31
|
+
get address() {
|
|
32
|
+
return this.data.address;
|
|
17
33
|
}
|
|
18
|
-
get
|
|
19
|
-
|
|
34
|
+
get displayAddress() {
|
|
35
|
+
if (!this.address)
|
|
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(', ');
|
|
20
40
|
}
|
|
21
41
|
}
|
|
22
|
-
exports.default =
|
|
42
|
+
exports.default = Partner;
|
|
@@ -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 Model_1 = __importDefault(require("
|
|
6
|
+
const Model_1 = __importDefault(require("../../Model"));
|
|
7
7
|
class PartnerTiny extends Model_1.default {
|
|
8
8
|
constructor(doc) {
|
|
9
9
|
super(doc);
|
|
@@ -1,5 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { Timestamp } from '@google-cloud/firestore';
|
|
2
|
+
import { DocumentReference } from '../../../types/firestore';
|
|
3
|
+
export interface BasicAddressData {
|
|
4
|
+
street?: string;
|
|
5
|
+
city?: string;
|
|
6
|
+
postalCode?: string;
|
|
7
|
+
province?: string;
|
|
8
|
+
country?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface PartnerTinyData {
|
|
11
|
+
photoURL: string | null;
|
|
12
|
+
displayName: string;
|
|
13
|
+
}
|
|
14
|
+
export interface PartnerBasicData extends PartnerTinyData {
|
|
15
|
+
readonly createdAt: Timestamp;
|
|
16
|
+
readonly createdBy: DocumentReference;
|
|
17
|
+
deletedAt: Timestamp | null;
|
|
18
|
+
deletedBy: string | null;
|
|
19
|
+
}
|
|
20
|
+
export interface PartnerData extends PartnerBasicData {
|
|
21
|
+
name: string;
|
|
22
|
+
lastname: string;
|
|
23
|
+
email: string;
|
|
24
|
+
address: BasicAddressData | null;
|
|
25
|
+
phone: string | null;
|
|
26
|
+
birthdate: Timestamp | null;
|
|
27
|
+
groupIds: string[];
|
|
5
28
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Model, { DocumentModel } from '
|
|
1
|
+
import Model, { DocumentModel } from '../../Model';
|
|
2
2
|
import { PaymentBasicData, PaymentType } from './types';
|
|
3
3
|
export default class PaymentBasic<D> extends Model<D & PaymentBasicData> {
|
|
4
4
|
constructor(doc: DocumentModel);
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const date_fns_1 = require("date-fns");
|
|
7
|
-
const Model_1 = __importDefault(require("
|
|
7
|
+
const Model_1 = __importDefault(require("../../Model"));
|
|
8
8
|
const types_1 = require("./types");
|
|
9
9
|
class PaymentBasic extends Model_1.default {
|
|
10
10
|
constructor(doc) {
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { DocumentModel } from '../../Model';
|
|
2
|
-
import PaymentBasic from '
|
|
3
|
-
import {
|
|
4
|
-
export default class
|
|
2
|
+
import PaymentBasic from './basic';
|
|
3
|
+
import { PaymentData } from './types';
|
|
4
|
+
export default class Payment extends PaymentBasic<PaymentData> {
|
|
5
5
|
constructor(doc: DocumentModel);
|
|
6
|
+
get partnershipId(): string;
|
|
6
7
|
get partnerId(): string;
|
|
7
|
-
get
|
|
8
|
+
get subscriptionId(): string | null;
|
|
9
|
+
get onetimeId(): string | null;
|
|
10
|
+
get transactionId(): string;
|
|
11
|
+
get history(): import("./types").PaymentHistory[];
|
|
12
|
+
get historyOrdered(): import("./types").PaymentHistory[];
|
|
8
13
|
}
|
|
@@ -3,16 +3,31 @@ 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 basic_1 = __importDefault(require("
|
|
7
|
-
class
|
|
6
|
+
const basic_1 = __importDefault(require("./basic"));
|
|
7
|
+
class Payment extends basic_1.default {
|
|
8
8
|
constructor(doc) {
|
|
9
9
|
super(doc);
|
|
10
10
|
}
|
|
11
|
+
get partnershipId() {
|
|
12
|
+
return this.data.partnershipId;
|
|
13
|
+
}
|
|
11
14
|
get partnerId() {
|
|
12
15
|
return this.data.partnerId;
|
|
13
16
|
}
|
|
14
|
-
get
|
|
15
|
-
return this.data.
|
|
17
|
+
get subscriptionId() {
|
|
18
|
+
return this.data.subscriptionId;
|
|
19
|
+
}
|
|
20
|
+
get onetimeId() {
|
|
21
|
+
return this.data.onetimeId;
|
|
22
|
+
}
|
|
23
|
+
get transactionId() {
|
|
24
|
+
return this.data.transactionId;
|
|
25
|
+
}
|
|
26
|
+
get history() {
|
|
27
|
+
return this.data.history || [];
|
|
28
|
+
}
|
|
29
|
+
get historyOrdered() {
|
|
30
|
+
return this.history.sort((a, b) => (a.timestamp < b.timestamp ? 1 : -1));
|
|
16
31
|
}
|
|
17
32
|
}
|
|
18
|
-
exports.default =
|
|
33
|
+
exports.default = Payment;
|
|
@@ -1,6 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { Timestamp } from '@google-cloud/firestore';
|
|
2
|
+
export declare enum PaymentType {
|
|
3
|
+
Recurring = "recurring",
|
|
4
|
+
OneTime = "one-time"
|
|
5
|
+
}
|
|
6
|
+
export declare enum PaymentStatus {
|
|
7
|
+
Pending = 0,
|
|
8
|
+
Waiting = 1,
|
|
9
|
+
Success = 2,
|
|
10
|
+
Error = 3,
|
|
11
|
+
Chargeback = 4,
|
|
12
|
+
Canceled = 5
|
|
13
|
+
}
|
|
14
|
+
export interface PaymentHistory {
|
|
15
|
+
readonly status: PaymentStatus;
|
|
16
|
+
readonly timestamp: number;
|
|
17
|
+
}
|
|
18
|
+
export interface PaymentBasicData {
|
|
19
|
+
readonly title: string;
|
|
20
|
+
readonly amount: number;
|
|
21
|
+
lastAction: PaymentHistory;
|
|
22
|
+
readonly createdAt: Timestamp;
|
|
23
|
+
readonly type: PaymentType;
|
|
24
|
+
}
|
|
25
|
+
export interface PaymentData extends PaymentBasicData {
|
|
26
|
+
readonly partnershipId: string;
|
|
27
|
+
readonly partnerId: string;
|
|
28
|
+
readonly subscriptionId: string | null;
|
|
29
|
+
readonly onetimeId: string | null;
|
|
30
|
+
readonly transactionId: string;
|
|
31
|
+
history: PaymentHistory[];
|
|
6
32
|
}
|
|
@@ -1,2 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PaymentStatus = exports.PaymentType = void 0;
|
|
4
|
+
var PaymentType;
|
|
5
|
+
(function (PaymentType) {
|
|
6
|
+
PaymentType["Recurring"] = "recurring";
|
|
7
|
+
PaymentType["OneTime"] = "one-time";
|
|
8
|
+
})(PaymentType = exports.PaymentType || (exports.PaymentType = {}));
|
|
9
|
+
var PaymentStatus;
|
|
10
|
+
(function (PaymentStatus) {
|
|
11
|
+
PaymentStatus[PaymentStatus["Pending"] = 0] = "Pending";
|
|
12
|
+
PaymentStatus[PaymentStatus["Waiting"] = 1] = "Waiting";
|
|
13
|
+
PaymentStatus[PaymentStatus["Success"] = 2] = "Success";
|
|
14
|
+
PaymentStatus[PaymentStatus["Error"] = 3] = "Error";
|
|
15
|
+
PaymentStatus[PaymentStatus["Chargeback"] = 4] = "Chargeback";
|
|
16
|
+
PaymentStatus[PaymentStatus["Canceled"] = 5] = "Canceled";
|
|
17
|
+
})(PaymentStatus = exports.PaymentStatus || (exports.PaymentStatus = {}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DocumentModel } from '
|
|
2
|
-
import PartnershipPlanBasic from '
|
|
1
|
+
import { DocumentModel } from '../../Model';
|
|
2
|
+
import PartnershipPlanBasic from '../Plan/basic';
|
|
3
3
|
import { SubscriptionData, SubscriptionStatus } from './types';
|
|
4
4
|
export default class PartnerSubscription extends PartnershipPlanBasic<SubscriptionData> {
|
|
5
5
|
constructor(doc: DocumentModel);
|
|
@@ -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 payments_1 = require("
|
|
7
|
-
const utils_1 = require("
|
|
8
|
-
const basic_1 = __importDefault(require("
|
|
6
|
+
const payments_1 = require("../../../helpers/payments");
|
|
7
|
+
const utils_1 = require("../../../helpers/utils");
|
|
8
|
+
const basic_1 = __importDefault(require("../Plan/basic"));
|
|
9
9
|
const types_1 = require("./types");
|
|
10
10
|
class PartnerSubscription extends basic_1.default {
|
|
11
11
|
constructor(doc) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DocumentReference, Timestamp } from '@google-cloud/firestore';
|
|
2
|
-
import { PaymentStatus } from '
|
|
3
|
-
import { PartnershipPlanBasicData } from '
|
|
2
|
+
import { PaymentStatus } from '../Payment/types';
|
|
3
|
+
import { PartnershipPlanBasicData } from '../Plan/types';
|
|
4
4
|
export declare enum SubscriptionStatus {
|
|
5
5
|
Active = "active",
|
|
6
6
|
Pause = "pause",
|
|
@@ -6,7 +6,7 @@ export default class PartnershipBasic<D> extends Model<D & PartnershipBasicData>
|
|
|
6
6
|
get displayName(): string;
|
|
7
7
|
get photoURL(): string;
|
|
8
8
|
get email(): string;
|
|
9
|
-
get address(): import("
|
|
9
|
+
get address(): import("./Partner/types").BasicAddressData;
|
|
10
10
|
get displayAddress(): string;
|
|
11
11
|
get phone(): string | null;
|
|
12
12
|
get groupIds(): string[];
|
|
@@ -1,20 +1,9 @@
|
|
|
1
1
|
import { DocumentReference, Timestamp } from '@google-cloud/firestore';
|
|
2
2
|
import { AdminItem } from '../../helpers/types';
|
|
3
|
-
import { BasicAddressData } from '
|
|
3
|
+
import { BasicAddressData } from './Partner/types';
|
|
4
4
|
export declare enum PartnershipRoles {
|
|
5
5
|
Admin = "admin"
|
|
6
6
|
}
|
|
7
|
-
export declare enum PartnershipStatus {
|
|
8
|
-
Verified = "verified",
|
|
9
|
-
PendingVerification = "pendingVerification",
|
|
10
|
-
Deleted = "deleted"
|
|
11
|
-
}
|
|
12
|
-
export interface LegalContactData {
|
|
13
|
-
name: string;
|
|
14
|
-
lastname: string;
|
|
15
|
-
birthdate: number;
|
|
16
|
-
email: string;
|
|
17
|
-
}
|
|
18
7
|
export interface PartnershipAlgoliaData extends Pick<PartnershipData, 'displayName' | 'photoURL' | 'partnerCount'> {
|
|
19
8
|
createdAt: number;
|
|
20
9
|
}
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.PartnershipRoles = void 0;
|
|
4
4
|
var PartnershipRoles;
|
|
5
5
|
(function (PartnershipRoles) {
|
|
6
6
|
PartnershipRoles["Admin"] = "admin";
|
|
7
7
|
})(PartnershipRoles = exports.PartnershipRoles || (exports.PartnershipRoles = {}));
|
|
8
|
-
var PartnershipStatus;
|
|
9
|
-
(function (PartnershipStatus) {
|
|
10
|
-
PartnershipStatus["Verified"] = "verified";
|
|
11
|
-
PartnershipStatus["PendingVerification"] = "pendingVerification";
|
|
12
|
-
PartnershipStatus["Deleted"] = "deleted";
|
|
13
|
-
})(PartnershipStatus = exports.PartnershipStatus || (exports.PartnershipStatus = {}));
|
package/models/User/index.d.ts
CHANGED
|
@@ -39,12 +39,14 @@ export default class User extends UserBasic<UserData> {
|
|
|
39
39
|
};
|
|
40
40
|
get dashboardConfig(): {
|
|
41
41
|
default_group_id: string | null;
|
|
42
|
+
default_partnership_id: string | null;
|
|
42
43
|
repertoire_order_by: RepertoireFilterBy;
|
|
43
44
|
repertoire_order_direction: RepertoireFilterDirection;
|
|
44
45
|
events_type: import("../Evento/types").EventType | null;
|
|
45
46
|
};
|
|
46
47
|
getDashboardConfig<T extends UserDashboardConfig>(value: T): {
|
|
47
48
|
default_group_id: string | null;
|
|
49
|
+
default_partnership_id: string | null;
|
|
48
50
|
repertoire_order_by: RepertoireFilterBy;
|
|
49
51
|
repertoire_order_direction: RepertoireFilterDirection;
|
|
50
52
|
events_type: import("../Evento/types").EventType | null;
|
package/models/User/index.js
CHANGED
|
@@ -117,6 +117,7 @@ class User extends basic_1.default {
|
|
|
117
117
|
get dashboardConfig() {
|
|
118
118
|
const { dashboardConfig = {
|
|
119
119
|
[types_2.UserDashboardConfig.DefaultGroupId]: null,
|
|
120
|
+
[types_2.UserDashboardConfig.DefaultPartnershipId]: null,
|
|
120
121
|
[types_2.UserDashboardConfig.RepertoireOrderBy]: types_1.RepertoireFilterBy.CreatedAt,
|
|
121
122
|
[types_2.UserDashboardConfig.RepertoireOrderDirection]: types_1.RepertoireFilterDirection.Desc,
|
|
122
123
|
[types_2.UserDashboardConfig.EventsType]: null,
|
|
@@ -125,6 +126,9 @@ class User extends basic_1.default {
|
|
|
125
126
|
[types_2.UserDashboardConfig.DefaultGroupId]: types_2.UserDashboardConfig.DefaultGroupId in dashboardConfig
|
|
126
127
|
? dashboardConfig[types_2.UserDashboardConfig.DefaultGroupId]
|
|
127
128
|
: null,
|
|
129
|
+
[types_2.UserDashboardConfig.DefaultPartnershipId]: types_2.UserDashboardConfig.DefaultPartnershipId in dashboardConfig
|
|
130
|
+
? dashboardConfig[types_2.UserDashboardConfig.DefaultPartnershipId]
|
|
131
|
+
: null,
|
|
128
132
|
[types_2.UserDashboardConfig.RepertoireOrderBy]: types_2.UserDashboardConfig.RepertoireOrderBy in dashboardConfig
|
|
129
133
|
? dashboardConfig[types_2.UserDashboardConfig.RepertoireOrderBy]
|
|
130
134
|
: types_1.RepertoireFilterBy.CreatedAt,
|
package/models/User/types.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export declare enum UserAppConfig {
|
|
|
16
16
|
}
|
|
17
17
|
export declare enum UserDashboardConfig {
|
|
18
18
|
DefaultGroupId = "default_group_id",
|
|
19
|
+
DefaultPartnershipId = "default_partnership_id",
|
|
19
20
|
RepertoireOrderBy = "repertoire_order_by",
|
|
20
21
|
RepertoireOrderDirection = "repertoire_order_direction",
|
|
21
22
|
EventsType = "events_type"
|
|
@@ -81,6 +82,7 @@ export interface UserData extends UserBasicData {
|
|
|
81
82
|
emailSettings: Record<UserEmailSettings, boolean>;
|
|
82
83
|
dashboardConfig: {
|
|
83
84
|
[UserDashboardConfig.DefaultGroupId]: string | null;
|
|
85
|
+
[UserDashboardConfig.DefaultPartnershipId]: string | null;
|
|
84
86
|
[UserDashboardConfig.RepertoireOrderBy]: RepertoireFilterBy;
|
|
85
87
|
[UserDashboardConfig.RepertoireOrderDirection]: RepertoireFilterDirection;
|
|
86
88
|
[UserDashboardConfig.EventsType]: EventType | null;
|
package/models/User/types.js
CHANGED
|
@@ -19,6 +19,7 @@ var UserAppConfig;
|
|
|
19
19
|
var UserDashboardConfig;
|
|
20
20
|
(function (UserDashboardConfig) {
|
|
21
21
|
UserDashboardConfig["DefaultGroupId"] = "default_group_id";
|
|
22
|
+
UserDashboardConfig["DefaultPartnershipId"] = "default_partnership_id";
|
|
22
23
|
UserDashboardConfig["RepertoireOrderBy"] = "repertoire_order_by";
|
|
23
24
|
UserDashboardConfig["RepertoireOrderDirection"] = "repertoire_order_direction";
|
|
24
25
|
UserDashboardConfig["EventsType"] = "events_type";
|
package/package.json
CHANGED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { DocumentModel } from '../Model';
|
|
2
|
-
import PartnerBasic from './basic';
|
|
3
|
-
import { PartnerData } from './types';
|
|
4
|
-
export default class Partner extends PartnerBasic<PartnerData> {
|
|
5
|
-
constructor(doc: DocumentModel);
|
|
6
|
-
get name(): string;
|
|
7
|
-
get lastname(): string;
|
|
8
|
-
get email(): string;
|
|
9
|
-
get phone(): string | null;
|
|
10
|
-
get birthdate(): FirebaseFirestore.Timestamp | null;
|
|
11
|
-
get partnershipId(): string;
|
|
12
|
-
get mandateId(): number | null;
|
|
13
|
-
get address(): import("./types").BasicAddressData | null;
|
|
14
|
-
get displayIBAN(): string | null;
|
|
15
|
-
get displayAddress(): string | null;
|
|
16
|
-
}
|
package/models/Partner/index.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
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 isString_1 = __importDefault(require("lodash/isString"));
|
|
7
|
-
const basic_1 = __importDefault(require("./basic"));
|
|
8
|
-
class Partner extends basic_1.default {
|
|
9
|
-
constructor(doc) {
|
|
10
|
-
super(doc);
|
|
11
|
-
}
|
|
12
|
-
get name() {
|
|
13
|
-
return this.data.name;
|
|
14
|
-
}
|
|
15
|
-
get lastname() {
|
|
16
|
-
return this.data.lastname;
|
|
17
|
-
}
|
|
18
|
-
get email() {
|
|
19
|
-
return this.data.email;
|
|
20
|
-
}
|
|
21
|
-
get phone() {
|
|
22
|
-
return this.data.phone;
|
|
23
|
-
}
|
|
24
|
-
get birthdate() {
|
|
25
|
-
return this.data.birthdate;
|
|
26
|
-
}
|
|
27
|
-
get partnershipId() {
|
|
28
|
-
return this.data.partnershipId;
|
|
29
|
-
}
|
|
30
|
-
get mandateId() {
|
|
31
|
-
return this.data.mandateId;
|
|
32
|
-
}
|
|
33
|
-
get address() {
|
|
34
|
-
return this.data.address;
|
|
35
|
-
}
|
|
36
|
-
get displayIBAN() {
|
|
37
|
-
const { iban } = this.data;
|
|
38
|
-
return iban ? `${iban.first} **** **** **** **** ${iban.last}` : null;
|
|
39
|
-
}
|
|
40
|
-
get displayAddress() {
|
|
41
|
-
if (!this.address)
|
|
42
|
-
return null;
|
|
43
|
-
const { street, city, postalCode, province, country } = this.address;
|
|
44
|
-
const fields = [street, postalCode, city, province, country];
|
|
45
|
-
return fields.filter((field) => (0, isString_1.default)(field)).join(', ');
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
exports.default = Partner;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { Timestamp } from '@google-cloud/firestore';
|
|
2
|
-
export declare enum PartnerStatus {
|
|
3
|
-
Verified = "verified",
|
|
4
|
-
PendingVerification = "pendingVerification",
|
|
5
|
-
Deleted = "deleted"
|
|
6
|
-
}
|
|
7
|
-
export interface BasicAddressData {
|
|
8
|
-
street?: string;
|
|
9
|
-
city?: string;
|
|
10
|
-
postalCode?: string;
|
|
11
|
-
province?: string;
|
|
12
|
-
country?: string;
|
|
13
|
-
}
|
|
14
|
-
export interface PartnerPartialIban {
|
|
15
|
-
first: string;
|
|
16
|
-
last: string;
|
|
17
|
-
}
|
|
18
|
-
export interface PartnerAlgoliaData extends Pick<PartnerData, 'photoURL' | 'partnershipId'> {
|
|
19
|
-
status: PartnerStatus;
|
|
20
|
-
displayName: string;
|
|
21
|
-
createdAt: number;
|
|
22
|
-
}
|
|
23
|
-
export interface PartnerTinyData {
|
|
24
|
-
photoURL: string | null;
|
|
25
|
-
displayName: string;
|
|
26
|
-
}
|
|
27
|
-
export interface PartnerBasicData extends PartnerTinyData {
|
|
28
|
-
verifiedAt: Timestamp | null;
|
|
29
|
-
verifiedBy: string | null;
|
|
30
|
-
createdAt: Timestamp;
|
|
31
|
-
createdBy: string;
|
|
32
|
-
deletedAt: Timestamp | null;
|
|
33
|
-
deletedBy: string | null;
|
|
34
|
-
}
|
|
35
|
-
export interface PartnerData extends PartnerBasicData {
|
|
36
|
-
name: string;
|
|
37
|
-
lastname: string;
|
|
38
|
-
email: string;
|
|
39
|
-
iban: PartnerPartialIban | null;
|
|
40
|
-
address: BasicAddressData | null;
|
|
41
|
-
phone: string | null;
|
|
42
|
-
birthdate: Timestamp | null;
|
|
43
|
-
partnershipId: string;
|
|
44
|
-
mandateId: number | null;
|
|
45
|
-
token: string | null;
|
|
46
|
-
}
|
package/models/Partner/types.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PartnerStatus = void 0;
|
|
4
|
-
var PartnerStatus;
|
|
5
|
-
(function (PartnerStatus) {
|
|
6
|
-
PartnerStatus["Verified"] = "verified";
|
|
7
|
-
PartnerStatus["PendingVerification"] = "pendingVerification";
|
|
8
|
-
PartnerStatus["Deleted"] = "deleted";
|
|
9
|
-
})(PartnerStatus = exports.PartnerStatus || (exports.PartnerStatus = {}));
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { DocumentModel } from '../Model';
|
|
2
|
-
import PaymentBasic from './basic';
|
|
3
|
-
import { PaymentData } from './types';
|
|
4
|
-
export default class Payment extends PaymentBasic<PaymentData> {
|
|
5
|
-
constructor(doc: DocumentModel);
|
|
6
|
-
get partnershipId(): string;
|
|
7
|
-
get partnerId(): string;
|
|
8
|
-
get subscriptionId(): string | null;
|
|
9
|
-
get onetimeId(): string | null;
|
|
10
|
-
get transactionId(): string;
|
|
11
|
-
get history(): import("./types").PaymentHistory[];
|
|
12
|
-
get historyOrdered(): import("./types").PaymentHistory[];
|
|
13
|
-
}
|
package/models/Payment/index.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const basic_1 = __importDefault(require("./basic"));
|
|
7
|
-
class Payment extends basic_1.default {
|
|
8
|
-
constructor(doc) {
|
|
9
|
-
super(doc);
|
|
10
|
-
}
|
|
11
|
-
get partnershipId() {
|
|
12
|
-
return this.data.partnershipId;
|
|
13
|
-
}
|
|
14
|
-
get partnerId() {
|
|
15
|
-
return this.data.partnerId;
|
|
16
|
-
}
|
|
17
|
-
get subscriptionId() {
|
|
18
|
-
return this.data.subscriptionId;
|
|
19
|
-
}
|
|
20
|
-
get onetimeId() {
|
|
21
|
-
return this.data.onetimeId;
|
|
22
|
-
}
|
|
23
|
-
get transactionId() {
|
|
24
|
-
return this.data.transactionId;
|
|
25
|
-
}
|
|
26
|
-
get history() {
|
|
27
|
-
return this.data.history || [];
|
|
28
|
-
}
|
|
29
|
-
get historyOrdered() {
|
|
30
|
-
return this.history.sort((a, b) => (a.timestamp < b.timestamp ? 1 : -1));
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.default = Payment;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Timestamp } from '@google-cloud/firestore';
|
|
2
|
-
export declare enum PaymentType {
|
|
3
|
-
Recurring = "recurring",
|
|
4
|
-
OneTime = "one-time"
|
|
5
|
-
}
|
|
6
|
-
export declare enum PaymentStatus {
|
|
7
|
-
Pending = 0,
|
|
8
|
-
Waiting = 1,
|
|
9
|
-
Success = 2,
|
|
10
|
-
Error = 3,
|
|
11
|
-
Chargeback = 4,
|
|
12
|
-
Canceled = 5
|
|
13
|
-
}
|
|
14
|
-
export interface PaymentHistory {
|
|
15
|
-
readonly status: PaymentStatus;
|
|
16
|
-
readonly timestamp: number;
|
|
17
|
-
}
|
|
18
|
-
export interface PaymentBasicData {
|
|
19
|
-
readonly title: string;
|
|
20
|
-
readonly amount: number;
|
|
21
|
-
lastAction: PaymentHistory;
|
|
22
|
-
readonly createdAt: Timestamp;
|
|
23
|
-
readonly type: PaymentType;
|
|
24
|
-
}
|
|
25
|
-
export interface PaymentData extends PaymentBasicData {
|
|
26
|
-
readonly partnershipId: string;
|
|
27
|
-
readonly partnerId: string;
|
|
28
|
-
readonly subscriptionId: string | null;
|
|
29
|
-
readonly onetimeId: string | null;
|
|
30
|
-
readonly transactionId: string;
|
|
31
|
-
history: PaymentHistory[];
|
|
32
|
-
}
|
package/models/Payment/types.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PaymentStatus = exports.PaymentType = void 0;
|
|
4
|
-
var PaymentType;
|
|
5
|
-
(function (PaymentType) {
|
|
6
|
-
PaymentType["Recurring"] = "recurring";
|
|
7
|
-
PaymentType["OneTime"] = "one-time";
|
|
8
|
-
})(PaymentType = exports.PaymentType || (exports.PaymentType = {}));
|
|
9
|
-
var PaymentStatus;
|
|
10
|
-
(function (PaymentStatus) {
|
|
11
|
-
PaymentStatus[PaymentStatus["Pending"] = 0] = "Pending";
|
|
12
|
-
PaymentStatus[PaymentStatus["Waiting"] = 1] = "Waiting";
|
|
13
|
-
PaymentStatus[PaymentStatus["Success"] = 2] = "Success";
|
|
14
|
-
PaymentStatus[PaymentStatus["Error"] = 3] = "Error";
|
|
15
|
-
PaymentStatus[PaymentStatus["Chargeback"] = 4] = "Chargeback";
|
|
16
|
-
PaymentStatus[PaymentStatus["Canceled"] = 5] = "Canceled";
|
|
17
|
-
})(PaymentStatus = exports.PaymentStatus || (exports.PaymentStatus = {}));
|
|
File without changes
|