@nimee/shared-types 1.0.281 → 1.0.283
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/dist/account/marketPlace.d.ts +4 -0
- package/dist/payment/endUserSeasonTicket.d.ts +19 -5
- package/dist/payment/endUserSeasonTicket.js +8 -1
- package/dist/payment/endUserSeasonTicket.js.map +1 -1
- package/dist/payment/seasonTicket.d.ts +9 -0
- package/dist/payment/seasonTicket.js.map +1 -1
- package/package.json +1 -1
- package/src/account/marketPlace.ts +4 -0
- package/src/payment/endUserSeasonTicket.ts +20 -4
- package/src/payment/seasonTicket.ts +10 -0
|
@@ -149,5 +149,9 @@ export interface IMarketPlace {
|
|
|
149
149
|
shouldForce2fa?: boolean;
|
|
150
150
|
twoFaIntervalMinutes?: number;
|
|
151
151
|
inactivityConfig?: IInactivityConfig;
|
|
152
|
+
sessionConfig?: {
|
|
153
|
+
enabled: boolean;
|
|
154
|
+
browserCloseHours: number;
|
|
155
|
+
};
|
|
152
156
|
allowTicketWallet?: boolean;
|
|
153
157
|
}
|
|
@@ -47,14 +47,14 @@ export interface IEndUserSeasonTicketModel {
|
|
|
47
47
|
seasonTicket: string | mongoose.Types.ObjectId;
|
|
48
48
|
marketplace: string | mongoose.Types.ObjectId;
|
|
49
49
|
seller: string | mongoose.Types.ObjectId;
|
|
50
|
-
endUser
|
|
50
|
+
endUser?: string | mongoose.Types.ObjectId | null;
|
|
51
51
|
status: ISeasonTicketStatusType;
|
|
52
52
|
_id?: string | mongoose.Types.ObjectId;
|
|
53
|
-
email
|
|
54
|
-
phone
|
|
53
|
+
email?: string | null;
|
|
54
|
+
phone?: string | null;
|
|
55
55
|
iterations: number;
|
|
56
56
|
paymentIterationType: IPaymentSeasonTicketIterationType;
|
|
57
|
-
purchaseToken
|
|
57
|
+
purchaseToken?: string;
|
|
58
58
|
startDate?: Date;
|
|
59
59
|
endDate?: Date;
|
|
60
60
|
cancelDate?: Date;
|
|
@@ -101,6 +101,14 @@ export interface IEndUserSeasonTicketModel {
|
|
|
101
101
|
errorText?: string;
|
|
102
102
|
lastPaymentFailedAt?: Date;
|
|
103
103
|
failedPaymentAttempts?: number;
|
|
104
|
+
parentSubscriptionId?: string | mongoose.Types.ObjectId | null;
|
|
105
|
+
familyRole?: IFamilyRole | null;
|
|
106
|
+
isProfileComplete?: boolean;
|
|
107
|
+
familyMemberCount?: number | null;
|
|
108
|
+
familyTotalPrice?: number | null;
|
|
109
|
+
imageUrl?: string | null;
|
|
110
|
+
birth_date?: Date | null;
|
|
111
|
+
idNumber?: string | null;
|
|
104
112
|
}
|
|
105
113
|
export declare enum ISeasonTicketStatusType {
|
|
106
114
|
ACTIVE = "active",// the season ticket is active
|
|
@@ -112,5 +120,11 @@ export declare enum ISeasonTicketStatusType {
|
|
|
112
120
|
EXPIRED = "expired",// the season ticket has expired - end date has passed
|
|
113
121
|
PAUSED = "paused",// the season ticket has been paused
|
|
114
122
|
SUB_ITERATION_SUCCESS = "sub-iteration-success",// the subscription iteration was successful
|
|
115
|
-
SUB_ITERATION_SKIPPED = "sub-iteration-skipped"
|
|
123
|
+
SUB_ITERATION_SKIPPED = "sub-iteration-skipped",// the subscription iteration was skipped
|
|
124
|
+
INACTIVE = "inactive"
|
|
125
|
+
}
|
|
126
|
+
export declare enum IFamilyRole {
|
|
127
|
+
PARENT = "parent",
|
|
128
|
+
ADULT = "adult",
|
|
129
|
+
CHILD = "child"
|
|
116
130
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ISeasonTicketStatusType = void 0;
|
|
3
|
+
exports.IFamilyRole = exports.ISeasonTicketStatusType = void 0;
|
|
4
4
|
var ISeasonTicketStatusType;
|
|
5
5
|
(function (ISeasonTicketStatusType) {
|
|
6
6
|
ISeasonTicketStatusType["ACTIVE"] = "active";
|
|
@@ -13,5 +13,12 @@ var ISeasonTicketStatusType;
|
|
|
13
13
|
ISeasonTicketStatusType["PAUSED"] = "paused";
|
|
14
14
|
ISeasonTicketStatusType["SUB_ITERATION_SUCCESS"] = "sub-iteration-success";
|
|
15
15
|
ISeasonTicketStatusType["SUB_ITERATION_SKIPPED"] = "sub-iteration-skipped";
|
|
16
|
+
ISeasonTicketStatusType["INACTIVE"] = "inactive";
|
|
16
17
|
})(ISeasonTicketStatusType || (exports.ISeasonTicketStatusType = ISeasonTicketStatusType = {}));
|
|
18
|
+
var IFamilyRole;
|
|
19
|
+
(function (IFamilyRole) {
|
|
20
|
+
IFamilyRole["PARENT"] = "parent";
|
|
21
|
+
IFamilyRole["ADULT"] = "adult";
|
|
22
|
+
IFamilyRole["CHILD"] = "child";
|
|
23
|
+
})(IFamilyRole || (exports.IFamilyRole = IFamilyRole = {}));
|
|
17
24
|
//# sourceMappingURL=endUserSeasonTicket.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endUserSeasonTicket.js","sourceRoot":"","sources":["../../src/payment/endUserSeasonTicket.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"endUserSeasonTicket.js","sourceRoot":"","sources":["../../src/payment/endUserSeasonTicket.ts"],"names":[],"mappings":";;;AA6FA,IAAY,uBAYX;AAZD,WAAY,uBAAuB;IACjC,4CAAiB,CAAA;IACjB,8CAAmB,CAAA;IACnB,kDAAuB,CAAA;IACvB,wEAA6C,CAAA;IAC7C,4CAAiB,CAAA;IACjB,kDAAuB,CAAA;IACvB,8CAAmB,CAAA;IACnB,4CAAiB,CAAA;IACjB,0EAA+C,CAAA;IAC/C,0EAA+C,CAAA;IAC/C,gDAAqB,CAAA;AACvB,CAAC,EAZW,uBAAuB,uCAAvB,uBAAuB,QAYlC;AAED,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,8BAAe,CAAA;IACf,8BAAe,CAAA;AACjB,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB"}
|
|
@@ -44,6 +44,15 @@ export interface ISeasonTicketModel {
|
|
|
44
44
|
description?: string;
|
|
45
45
|
externalProductId?: string;
|
|
46
46
|
externalPriceId?: string;
|
|
47
|
+
familyEnabled?: boolean;
|
|
48
|
+
familyChildPrice?: number;
|
|
49
|
+
familyChildMaxAge?: number;
|
|
50
|
+
familyMaxAdults?: number;
|
|
51
|
+
familyMaxChildren?: number;
|
|
52
|
+
familyRequiredFields?: {
|
|
53
|
+
child?: string[];
|
|
54
|
+
adult?: string[];
|
|
55
|
+
};
|
|
47
56
|
}
|
|
48
57
|
export declare enum IPaymentSeasonTicketIterationType {
|
|
49
58
|
DAILY = 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seasonTicket.js","sourceRoot":"","sources":["../../src/payment/seasonTicket.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"seasonTicket.js","sourceRoot":"","sources":["../../src/payment/seasonTicket.ts"],"names":[],"mappings":";;;AAiCA,IAAY,iCAKX;AALD,WAAY,iCAAiC;IAC3C,2FAAS,CAAA;IACT,6FAAU,CAAA;IACV,+FAAW,CAAA;IACX,6FAAU,CAAA;AACZ,CAAC,EALW,iCAAiC,iDAAjC,iCAAiC,QAK5C;AAED,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,oDAA+B,CAAA;IAC/B,8CAAyB,CAAA;AAC3B,CAAC,EAHW,iBAAiB,iCAAjB,iBAAiB,QAG5B"}
|
package/package.json
CHANGED
|
@@ -162,5 +162,9 @@ export interface IMarketPlace {
|
|
|
162
162
|
shouldForce2fa?: boolean;
|
|
163
163
|
twoFaIntervalMinutes?: number; // Grace period after 2FA verification. 0 or undefined = every login
|
|
164
164
|
inactivityConfig?: IInactivityConfig;
|
|
165
|
+
sessionConfig?: {
|
|
166
|
+
enabled: boolean;
|
|
167
|
+
browserCloseHours: number;
|
|
168
|
+
};
|
|
165
169
|
allowTicketWallet?: boolean;
|
|
166
170
|
}
|
|
@@ -23,14 +23,14 @@ export interface IEndUserSeasonTicketModel {
|
|
|
23
23
|
seasonTicket: string | mongoose.Types.ObjectId;
|
|
24
24
|
marketplace: string | mongoose.Types.ObjectId;
|
|
25
25
|
seller: string | mongoose.Types.ObjectId;
|
|
26
|
-
endUser
|
|
26
|
+
endUser?: string | mongoose.Types.ObjectId | null;
|
|
27
27
|
status: ISeasonTicketStatusType;
|
|
28
28
|
_id?: string | mongoose.Types.ObjectId;
|
|
29
|
-
email
|
|
30
|
-
phone
|
|
29
|
+
email?: string | null; // email of the end user
|
|
30
|
+
phone?: string | null; // phone number of the end user
|
|
31
31
|
iterations: number; // how many payment iterations are there: -1 means infinite
|
|
32
32
|
paymentIterationType: IPaymentSeasonTicketIterationType; // daily, weekly, monthly, yearly
|
|
33
|
-
purchaseToken
|
|
33
|
+
purchaseToken?: string; // the token used to purchase the season ticket
|
|
34
34
|
startDate?: Date; // the start date of the season ticket - if the seller wants one purchase to be valid for a certain period
|
|
35
35
|
endDate?: Date; // the end date of the season ticket - if the seller wants one purchase to be valid for a certain period
|
|
36
36
|
// so when the end date is over the season ticket is no longer valid and the status should be expired
|
|
@@ -81,6 +81,15 @@ export interface IEndUserSeasonTicketModel {
|
|
|
81
81
|
errorText?: string; // Payme sub_error_text - reason for failed payment
|
|
82
82
|
lastPaymentFailedAt?: Date; // Timestamp of last failed payment attempt - for showing "payment issue" in frontend
|
|
83
83
|
failedPaymentAttempts?: number; // Number of consecutive failed payment attempts
|
|
84
|
+
// Family subscription fields
|
|
85
|
+
parentSubscriptionId?: string | mongoose.Types.ObjectId | null;
|
|
86
|
+
familyRole?: IFamilyRole | null;
|
|
87
|
+
isProfileComplete?: boolean;
|
|
88
|
+
familyMemberCount?: number | null; // only on parent - total members excluding parent
|
|
89
|
+
familyTotalPrice?: number | null; // only on parent - total recurring charge
|
|
90
|
+
imageUrl?: string | null; // profile image for family members (stored on subscription, not endUser)
|
|
91
|
+
birth_date?: Date | null; // birth date for family members (stored on subscription, not endUser)
|
|
92
|
+
idNumber?: string | null; // ID number for family members (stored on subscription, not endUser)
|
|
84
93
|
}
|
|
85
94
|
export enum ISeasonTicketStatusType {
|
|
86
95
|
ACTIVE = "active", // the season ticket is active
|
|
@@ -93,4 +102,11 @@ export enum ISeasonTicketStatusType {
|
|
|
93
102
|
PAUSED = "paused", // the season ticket has been paused
|
|
94
103
|
SUB_ITERATION_SUCCESS = "sub-iteration-success", // the subscription iteration was successful
|
|
95
104
|
SUB_ITERATION_SKIPPED = "sub-iteration-skipped", // the subscription iteration was skipped
|
|
105
|
+
INACTIVE = "inactive", // paid but awaiting profile completion (family members)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export enum IFamilyRole {
|
|
109
|
+
PARENT = "parent",
|
|
110
|
+
ADULT = "adult",
|
|
111
|
+
CHILD = "child",
|
|
96
112
|
}
|
|
@@ -20,6 +20,16 @@ export interface ISeasonTicketModel {
|
|
|
20
20
|
// Provider-agnostic fields for multi-provider support
|
|
21
21
|
externalProductId?: string; // Stripe: prod_xxx, Payme: product_id
|
|
22
22
|
externalPriceId?: string; // Stripe: price_xxx, Payme: plan_id
|
|
23
|
+
// Family subscription fields
|
|
24
|
+
familyEnabled?: boolean;
|
|
25
|
+
familyChildPrice?: number;
|
|
26
|
+
familyChildMaxAge?: number;
|
|
27
|
+
familyMaxAdults?: number;
|
|
28
|
+
familyMaxChildren?: number;
|
|
29
|
+
familyRequiredFields?: {
|
|
30
|
+
child?: string[];
|
|
31
|
+
adult?: string[];
|
|
32
|
+
};
|
|
23
33
|
}
|
|
24
34
|
export enum IPaymentSeasonTicketIterationType {
|
|
25
35
|
DAILY = 1,
|