@goweekdays/core 1.3.2 → 2.0.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/CHANGELOG.md +6 -0
- package/dist/index.d.ts +687 -2171
- package/dist/index.js +6029 -25344
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6145 -25518
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,351 +1,267 @@
|
|
|
1
|
+
import Joi from 'joi';
|
|
1
2
|
import * as mongodb from 'mongodb';
|
|
2
3
|
import { ObjectId, ClientSession, Db, Collection } from 'mongodb';
|
|
3
|
-
import * as bson from 'bson';
|
|
4
4
|
import { Request, Response, NextFunction } from 'express';
|
|
5
|
-
import
|
|
5
|
+
import * as bson from 'bson';
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
|
|
8
|
-
type
|
|
9
|
-
name?: string;
|
|
10
|
-
app?: string;
|
|
11
|
-
role?: string;
|
|
12
|
-
roleName?: string;
|
|
13
|
-
referralCode?: string;
|
|
14
|
-
org?: string | ObjectId;
|
|
15
|
-
orgName?: string;
|
|
16
|
-
};
|
|
17
|
-
type TVerification = {
|
|
8
|
+
type TAddress = {
|
|
18
9
|
_id?: ObjectId;
|
|
19
10
|
type: string;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
11
|
+
user: ObjectId | string;
|
|
12
|
+
org?: ObjectId | string;
|
|
13
|
+
country: string;
|
|
14
|
+
address: string;
|
|
15
|
+
continuedAddress?: string;
|
|
16
|
+
city: string;
|
|
17
|
+
province: string;
|
|
18
|
+
postalCode: string;
|
|
19
|
+
taxId: string;
|
|
26
20
|
};
|
|
27
|
-
declare
|
|
28
|
-
|
|
29
|
-
type: string;
|
|
30
|
-
email: string;
|
|
31
|
-
metadata?: TVerificationMetadata;
|
|
32
|
-
status?: string;
|
|
33
|
-
createdAt: string;
|
|
34
|
-
updatedAt?: string | null;
|
|
35
|
-
expireAt: string;
|
|
36
|
-
constructor(value: TVerification);
|
|
37
|
-
}
|
|
21
|
+
declare const addressSchema: Joi.ObjectSchema<any>;
|
|
22
|
+
declare function MAddress(value: any): TAddress;
|
|
38
23
|
|
|
39
|
-
declare function
|
|
24
|
+
declare function useAddressRepo(): {
|
|
40
25
|
createIndex: () => Promise<void>;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
search?: string | undefined;
|
|
46
|
-
page?: number | undefined;
|
|
47
|
-
limit?: number | undefined;
|
|
48
|
-
sort?: Record<string, number> | undefined;
|
|
49
|
-
status?: string | undefined;
|
|
50
|
-
type?: string | string[] | undefined;
|
|
51
|
-
email?: string | undefined;
|
|
52
|
-
app?: string | undefined;
|
|
53
|
-
}) => Promise<TVerification[] | {
|
|
54
|
-
items: any[];
|
|
55
|
-
pages: number;
|
|
56
|
-
pageRange: string;
|
|
57
|
-
}>;
|
|
58
|
-
getById: (_id: ObjectId | string) => Promise<TVerification | null>;
|
|
59
|
-
getByIdByType: (type: string) => Promise<TVerification[] | TVerification[][]>;
|
|
60
|
-
updateStatusById: (_id: ObjectId | string, status: string, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
26
|
+
add: (value: TAddress, session?: ClientSession) => Promise<ObjectId>;
|
|
27
|
+
getByUserId: (user: string | ObjectId) => Promise<TAddress | null>;
|
|
28
|
+
getByOrgId: (org: string | ObjectId) => Promise<TAddress | null>;
|
|
29
|
+
updateById: (_id: string | ObjectId, value: Pick<TAddress, "org" | "country" | "address" | "continuedAddress" | "city" | "province" | "postalCode" | "taxId">, session?: ClientSession) => Promise<string>;
|
|
61
30
|
};
|
|
62
31
|
|
|
63
|
-
|
|
64
|
-
|
|
32
|
+
declare function useAddressController(): {
|
|
33
|
+
add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
34
|
+
getByUserId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
35
|
+
getByOrgId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
36
|
+
updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
65
37
|
};
|
|
66
38
|
|
|
67
|
-
declare function
|
|
68
|
-
|
|
69
|
-
createUserInvite: ({ email, metadata, }: {
|
|
39
|
+
declare function useAuthService(): {
|
|
40
|
+
login: ({ email, password }?: {
|
|
70
41
|
email: string;
|
|
71
|
-
|
|
72
|
-
}) => Promise<
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
getVerifications: ({ search, page, status, type, email, limit, app, }?: {
|
|
76
|
-
search?: string | undefined;
|
|
77
|
-
page?: number | undefined;
|
|
78
|
-
status?: string | undefined;
|
|
79
|
-
type?: string | undefined;
|
|
80
|
-
email?: string | undefined;
|
|
81
|
-
limit?: number | undefined;
|
|
82
|
-
app?: string | undefined;
|
|
83
|
-
}) => Promise<TVerification[] | {
|
|
84
|
-
items: any[];
|
|
85
|
-
pages: number;
|
|
86
|
-
pageRange: string;
|
|
42
|
+
password: string;
|
|
43
|
+
}) => Promise<{
|
|
44
|
+
sid: string;
|
|
45
|
+
user: string;
|
|
87
46
|
}>;
|
|
88
|
-
|
|
89
|
-
updateStatusById: (_id: string, status: string) => Promise<string>;
|
|
90
|
-
signUp: ({ email, metadata, }: {
|
|
91
|
-
email: string;
|
|
92
|
-
metadata: TKeyValuePair;
|
|
93
|
-
}) => Promise<bson.ObjectId>;
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
declare function useVerificationController(): {
|
|
97
|
-
getVerifications: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
98
|
-
createUserInvite: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
99
|
-
createForgetPassword: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
100
|
-
verify: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
101
|
-
cancelUserInvitation: (req: Request, res: Response, next: NextFunction) => Promise<Response<any, Record<string, any>> | undefined>;
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
type TToken = {
|
|
105
|
-
token: string;
|
|
106
|
-
user: ObjectId;
|
|
107
|
-
createdAt?: string;
|
|
47
|
+
logout: (sid: string) => Promise<string>;
|
|
108
48
|
};
|
|
109
|
-
declare class MToken implements TToken {
|
|
110
|
-
token: string;
|
|
111
|
-
user: ObjectId;
|
|
112
|
-
createdAt?: string;
|
|
113
|
-
constructor(value: TToken);
|
|
114
|
-
}
|
|
115
49
|
|
|
116
|
-
declare function
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
getToken: (token: string) => Promise<any>;
|
|
122
|
-
deleteToken: (token: string) => Promise<mongodb.DeleteResult>;
|
|
50
|
+
declare function useAuthController(): {
|
|
51
|
+
login: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
52
|
+
logout: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
53
|
+
resetPassword: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
54
|
+
signUp: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
123
55
|
};
|
|
124
56
|
|
|
125
|
-
type
|
|
126
|
-
name: string;
|
|
127
|
-
app: string;
|
|
128
|
-
role: ObjectId | string;
|
|
129
|
-
status?: string;
|
|
130
|
-
};
|
|
131
|
-
declare class MUserRole implements TUserRole {
|
|
132
|
-
name: string;
|
|
133
|
-
app: string;
|
|
134
|
-
role: ObjectId | string;
|
|
135
|
-
status?: string;
|
|
136
|
-
constructor(value: TUserRole);
|
|
137
|
-
}
|
|
138
|
-
type TUser = {
|
|
57
|
+
type TBuilding = {
|
|
139
58
|
_id?: ObjectId;
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
birthMonth?: string;
|
|
148
|
-
birthDay?: number;
|
|
149
|
-
birthYear?: number;
|
|
150
|
-
gender?: string;
|
|
151
|
-
defaultOrg?: ObjectId | string;
|
|
152
|
-
xenditCustomerId?: string;
|
|
153
|
-
type?: string;
|
|
59
|
+
school: ObjectId;
|
|
60
|
+
serial?: string;
|
|
61
|
+
name: string;
|
|
62
|
+
levels: number;
|
|
63
|
+
createdAt?: Date | string;
|
|
64
|
+
updatedAt?: Date | string;
|
|
65
|
+
deletedAt?: Date | string;
|
|
154
66
|
status?: string;
|
|
155
|
-
referralCode?: string;
|
|
156
|
-
referredBy?: string;
|
|
157
|
-
createdAt?: string;
|
|
158
|
-
updatedAt?: string;
|
|
159
|
-
deletedAt?: string;
|
|
160
67
|
};
|
|
161
|
-
declare
|
|
68
|
+
declare const schemaBuilding: Joi.ObjectSchema<any>;
|
|
69
|
+
type TBuildingUnit = {
|
|
162
70
|
_id?: ObjectId;
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
status
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
71
|
+
school: ObjectId | string;
|
|
72
|
+
name?: string;
|
|
73
|
+
building: ObjectId | string;
|
|
74
|
+
buildingName?: string;
|
|
75
|
+
level: number;
|
|
76
|
+
category: string;
|
|
77
|
+
type: string;
|
|
78
|
+
seating_capacity: number;
|
|
79
|
+
standing_capacity: number;
|
|
80
|
+
description?: string;
|
|
81
|
+
unit_of_measurement: string;
|
|
82
|
+
area: number;
|
|
83
|
+
status: string;
|
|
84
|
+
createdAt?: Date | string;
|
|
85
|
+
updatedAt?: Date | string;
|
|
86
|
+
deletedAt?: Date | string;
|
|
87
|
+
};
|
|
88
|
+
declare const schemaBuildingUnit: Joi.ObjectSchema<any>;
|
|
89
|
+
declare const schemaUpdateOptions: Joi.ObjectSchema<any>;
|
|
90
|
+
declare function MBuilding(value: TBuilding): {
|
|
91
|
+
_id: ObjectId | undefined;
|
|
92
|
+
school: ObjectId;
|
|
93
|
+
serial: string;
|
|
94
|
+
name: string;
|
|
95
|
+
levels: number;
|
|
96
|
+
status: string;
|
|
97
|
+
createdAt: string | Date;
|
|
98
|
+
updatedAt: string | Date;
|
|
99
|
+
deletedAt: string | Date;
|
|
100
|
+
};
|
|
101
|
+
declare function MBuildingUnit(value: TBuildingUnit): {
|
|
102
|
+
_id: ObjectId | undefined;
|
|
103
|
+
school: ObjectId;
|
|
104
|
+
name: string;
|
|
105
|
+
building: ObjectId;
|
|
106
|
+
buildingName: string;
|
|
107
|
+
level: number;
|
|
108
|
+
category: string;
|
|
109
|
+
type: string;
|
|
110
|
+
seating_capacity: number;
|
|
111
|
+
standing_capacity: number;
|
|
112
|
+
description: string;
|
|
113
|
+
unit_of_measurement: string;
|
|
114
|
+
area: number;
|
|
115
|
+
status: string;
|
|
116
|
+
createdAt: string | Date;
|
|
117
|
+
updatedAt: string | Date;
|
|
118
|
+
deletedAt: string | Date;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
declare function useBuildingRepo(): {
|
|
122
|
+
createIndexes: () => Promise<void>;
|
|
123
|
+
add: (value: TBuilding, session?: ClientSession) => Promise<ObjectId>;
|
|
124
|
+
getAll: ({ search, page, limit, sort, school, status, }?: {
|
|
194
125
|
search?: string | undefined;
|
|
195
126
|
page?: number | undefined;
|
|
196
127
|
limit?: number | undefined;
|
|
197
128
|
sort?: {} | undefined;
|
|
129
|
+
school?: string | undefined;
|
|
198
130
|
status?: string | undefined;
|
|
199
|
-
type?: string | undefined;
|
|
200
131
|
}) => Promise<Record<string, any>>;
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
_id: string | ObjectId;
|
|
207
|
-
firstName?: string | undefined;
|
|
208
|
-
lastName?: string | undefined;
|
|
209
|
-
}, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
210
|
-
updateBirthday: ({ _id, month, day, year }?: {
|
|
211
|
-
_id: string | ObjectId;
|
|
212
|
-
month: string;
|
|
213
|
-
day: number;
|
|
214
|
-
year: number;
|
|
215
|
-
}, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
216
|
-
updateUserFieldById: ({ _id, field, value }?: {
|
|
217
|
-
_id: string | ObjectId;
|
|
218
|
-
field: string;
|
|
219
|
-
value: string | ObjectId;
|
|
132
|
+
getById: (_id: string | ObjectId) => Promise<TBuilding | null>;
|
|
133
|
+
updateById: (_id: ObjectId | string, value: {
|
|
134
|
+
name: string;
|
|
135
|
+
serial: string;
|
|
136
|
+
levels: number;
|
|
220
137
|
}, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
221
|
-
|
|
222
|
-
_id: string | ObjectId;
|
|
223
|
-
role: TUserRole;
|
|
224
|
-
}, session?: ClientSession) => Promise<void>;
|
|
225
|
-
getUserByReferralCode: (referralCode: string) => Promise<TUser | null>;
|
|
138
|
+
deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
226
139
|
};
|
|
227
140
|
|
|
228
|
-
declare function
|
|
229
|
-
|
|
141
|
+
declare function useBuildingService(): {
|
|
142
|
+
updateById: (id: string, data: {
|
|
143
|
+
name: string;
|
|
144
|
+
levels: number;
|
|
145
|
+
serial: string;
|
|
146
|
+
}) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
147
|
+
deleteById: (id: string) => Promise<string>;
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
declare function useBuildingController(): {
|
|
151
|
+
createBuilding: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
152
|
+
getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
153
|
+
getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
154
|
+
updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
155
|
+
deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
declare function useBuildingUnitRepo(): {
|
|
159
|
+
createIndexes: () => Promise<void>;
|
|
160
|
+
add: (value: TBuildingUnit, session?: ClientSession) => Promise<ObjectId>;
|
|
161
|
+
getAll: ({ search, page, limit, sort, school, building, status, }?: {
|
|
230
162
|
search?: string | undefined;
|
|
231
163
|
page?: number | undefined;
|
|
232
|
-
status?: string | undefined;
|
|
233
|
-
type?: string | undefined;
|
|
234
164
|
limit?: number | undefined;
|
|
165
|
+
sort?: {} | undefined;
|
|
166
|
+
school?: string | undefined;
|
|
167
|
+
building?: string | undefined;
|
|
168
|
+
status?: string | undefined;
|
|
235
169
|
}) => Promise<Record<string, any>>;
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
170
|
+
getById: (_id: string | ObjectId) => Promise<TBuildingUnit>;
|
|
171
|
+
getByBuildingLevel: (building: string | ObjectId, level: number) => Promise<TBuildingUnit | null>;
|
|
172
|
+
updateById: (_id: string | ObjectId, value: {
|
|
173
|
+
name?: string | undefined;
|
|
174
|
+
building?: string | undefined;
|
|
175
|
+
level?: number | undefined;
|
|
176
|
+
category?: string | undefined;
|
|
177
|
+
type?: string | undefined;
|
|
178
|
+
seating_capacity?: number | undefined;
|
|
179
|
+
standing_capacity?: number | undefined;
|
|
180
|
+
area?: number | undefined;
|
|
181
|
+
}, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
182
|
+
getByBuilding: (building: string | ObjectId) => Promise<TBuildingUnit | null>;
|
|
183
|
+
deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<string>;
|
|
184
|
+
updateByBuildingId: (building: string | ObjectId, value: Partial<Pick<TBuildingUnit, "buildingName">>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
declare function useBuildingUnitService(): {
|
|
188
|
+
add: (value: {
|
|
189
|
+
building: TBuildingUnit;
|
|
190
|
+
qty: number;
|
|
249
191
|
}) => Promise<string>;
|
|
250
|
-
createUserByInvite: ({ id, firstName, lastName, password, }?: {
|
|
251
|
-
id?: string | undefined;
|
|
252
|
-
firstName?: string | undefined;
|
|
253
|
-
lastName?: string | undefined;
|
|
254
|
-
password?: string | undefined;
|
|
255
|
-
}) => Promise<string | ObjectId>;
|
|
256
|
-
createUserBySignUp: ({ id, firstName, lastName, password, }?: {
|
|
257
|
-
id?: string | undefined;
|
|
258
|
-
firstName?: string | undefined;
|
|
259
|
-
lastName?: string | undefined;
|
|
260
|
-
password?: string | undefined;
|
|
261
|
-
}) => Promise<ObjectId>;
|
|
262
|
-
createDefaultUser: () => Promise<string>;
|
|
263
192
|
};
|
|
264
193
|
|
|
265
|
-
declare function
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
updateUserProfile: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
272
|
-
createUserByVerification: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
194
|
+
declare function useBuildingUnitController(): {
|
|
195
|
+
add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
196
|
+
getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
197
|
+
getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
198
|
+
updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
199
|
+
deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
273
200
|
};
|
|
274
201
|
|
|
275
|
-
declare
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
202
|
+
declare const TCounter: z.ZodObject<{
|
|
203
|
+
_id: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodType<ObjectId, z.ZodTypeDef, ObjectId>]>, ObjectId, string | ObjectId>>;
|
|
204
|
+
count: z.ZodDefault<z.ZodNumber>;
|
|
205
|
+
type: z.ZodString;
|
|
206
|
+
createdAt: z.ZodDefault<z.ZodOptional<z.ZodDate>>;
|
|
207
|
+
updatedAt: z.ZodOptional<z.ZodDate>;
|
|
208
|
+
deletedAt: z.ZodOptional<z.ZodDate>;
|
|
209
|
+
}, "strip", z.ZodTypeAny, {
|
|
210
|
+
type: string;
|
|
211
|
+
createdAt: Date;
|
|
212
|
+
count: number;
|
|
213
|
+
_id?: ObjectId | undefined;
|
|
214
|
+
deletedAt?: Date | undefined;
|
|
215
|
+
updatedAt?: Date | undefined;
|
|
216
|
+
}, {
|
|
217
|
+
type: string;
|
|
218
|
+
_id?: string | ObjectId | undefined;
|
|
219
|
+
deletedAt?: Date | undefined;
|
|
220
|
+
updatedAt?: Date | undefined;
|
|
221
|
+
createdAt?: Date | undefined;
|
|
222
|
+
count?: number | undefined;
|
|
223
|
+
}>;
|
|
224
|
+
type TCounter = z.infer<typeof TCounter>;
|
|
225
|
+
declare function useCounterModel(db: Db): {
|
|
226
|
+
createCounter: (value: Pick<TCounter, "type">) => {
|
|
227
|
+
type: string;
|
|
228
|
+
createdAt: Date;
|
|
229
|
+
count: number;
|
|
230
|
+
_id?: ObjectId | undefined;
|
|
231
|
+
deletedAt?: Date | undefined;
|
|
232
|
+
updatedAt?: Date | undefined;
|
|
233
|
+
};
|
|
234
|
+
validateCounter: (data: unknown) => z.SafeParseReturnType<{
|
|
235
|
+
type: string;
|
|
236
|
+
_id?: string | ObjectId | undefined;
|
|
237
|
+
deletedAt?: Date | undefined;
|
|
238
|
+
updatedAt?: Date | undefined;
|
|
239
|
+
createdAt?: Date | undefined;
|
|
240
|
+
count?: number | undefined;
|
|
241
|
+
}, {
|
|
242
|
+
type: string;
|
|
243
|
+
createdAt: Date;
|
|
244
|
+
count: number;
|
|
245
|
+
_id?: ObjectId | undefined;
|
|
246
|
+
deletedAt?: Date | undefined;
|
|
247
|
+
updatedAt?: Date | undefined;
|
|
248
|
+
}>;
|
|
249
|
+
collection: Collection<{
|
|
250
|
+
type: string;
|
|
251
|
+
createdAt: Date;
|
|
252
|
+
count: number;
|
|
253
|
+
_id?: ObjectId | undefined;
|
|
254
|
+
deletedAt?: Date | undefined;
|
|
255
|
+
updatedAt?: Date | undefined;
|
|
282
256
|
}>;
|
|
283
|
-
refreshToken: (token: string) => Promise<string>;
|
|
284
|
-
logout: (token: string) => Promise<string>;
|
|
285
|
-
};
|
|
286
|
-
|
|
287
|
-
declare function useAuthController(): {
|
|
288
|
-
login: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
289
|
-
refreshToken: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
290
|
-
logout: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
291
|
-
resetPassword: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
292
|
-
signUp: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
293
|
-
};
|
|
294
|
-
|
|
295
|
-
type TRole = {
|
|
296
|
-
_id?: ObjectId;
|
|
297
|
-
org?: string | ObjectId;
|
|
298
|
-
name?: string;
|
|
299
|
-
description?: string;
|
|
300
|
-
permissions?: Array<string>;
|
|
301
|
-
type?: string;
|
|
302
|
-
status?: string;
|
|
303
|
-
default?: boolean;
|
|
304
|
-
createdBy?: string | ObjectId;
|
|
305
|
-
createdAt?: string;
|
|
306
|
-
updatedAt?: string;
|
|
307
|
-
deletedAt?: string;
|
|
308
257
|
};
|
|
309
|
-
type TMiniRole = Pick<TRole, "name" | "permissions">;
|
|
310
|
-
declare class MRole implements TRole {
|
|
311
|
-
_id: ObjectId;
|
|
312
|
-
org: string | ObjectId;
|
|
313
|
-
name?: string;
|
|
314
|
-
description?: string;
|
|
315
|
-
permissions?: Array<string>;
|
|
316
|
-
type?: string;
|
|
317
|
-
status?: string;
|
|
318
|
-
default?: boolean;
|
|
319
|
-
createdBy?: string | ObjectId;
|
|
320
|
-
createdAt?: string;
|
|
321
|
-
updatedAt?: string;
|
|
322
|
-
deletedAt?: string;
|
|
323
|
-
constructor(value: TRole);
|
|
324
|
-
}
|
|
325
258
|
|
|
326
|
-
declare function
|
|
259
|
+
declare function useCounterRepo(): {
|
|
327
260
|
createIndex: () => Promise<void>;
|
|
328
|
-
createTextIndex: () => Promise<void>;
|
|
329
261
|
createUniqueIndex: () => Promise<void>;
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
page?: number | undefined;
|
|
334
|
-
limit?: number | undefined;
|
|
335
|
-
sort?: any;
|
|
336
|
-
type?: string | undefined;
|
|
337
|
-
org?: string | ObjectId | undefined;
|
|
338
|
-
}) => Promise<{
|
|
339
|
-
items: any[];
|
|
340
|
-
pages: number;
|
|
341
|
-
pageRange: string;
|
|
342
|
-
} | TRole[]>;
|
|
343
|
-
getRoleByUserId: (value: ObjectId | string) => Promise<TRole | null>;
|
|
344
|
-
getRoleById: (_id: ObjectId | string) => Promise<mongodb.WithId<bson.Document> | TRole | null>;
|
|
345
|
-
getRoleByName: (name: string) => Promise<mongodb.WithId<bson.Document> | TRole | null>;
|
|
346
|
-
updateRole: (_id: string | ObjectId, value: TMiniRole, session?: ClientSession) => Promise<string>;
|
|
347
|
-
deleteRole: (_id: ObjectId | string, session?: ClientSession) => Promise<string>;
|
|
348
|
-
updatePermissionsById: (_id: string | ObjectId, permissions: TRole["permissions"], session?: ClientSession) => Promise<string>;
|
|
262
|
+
add: (type: string) => Promise<void>;
|
|
263
|
+
getByType: (type: string) => Promise<any>;
|
|
264
|
+
incrementByType: (type: string, session?: ClientSession) => Promise<void>;
|
|
349
265
|
};
|
|
350
266
|
|
|
351
267
|
type TFile = {
|
|
@@ -381,2034 +297,634 @@ declare function useFileController(): {
|
|
|
381
297
|
deleteFile: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
382
298
|
};
|
|
383
299
|
|
|
384
|
-
|
|
385
|
-
createRole: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
386
|
-
getRoles: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
387
|
-
getRoleByUserId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
388
|
-
getRoleById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
389
|
-
updateRole: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
390
|
-
deleteRole: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
391
|
-
updatePermissionsById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
392
|
-
};
|
|
393
|
-
|
|
394
|
-
type TEntity = {
|
|
300
|
+
type TMember = {
|
|
395
301
|
_id?: ObjectId;
|
|
302
|
+
org?: string | ObjectId;
|
|
303
|
+
orgName?: string;
|
|
396
304
|
name: string;
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
deletedAt?: string;
|
|
305
|
+
user: string | ObjectId;
|
|
306
|
+
role: string | ObjectId;
|
|
307
|
+
roleName?: string;
|
|
308
|
+
type: string;
|
|
402
309
|
status?: string;
|
|
403
|
-
};
|
|
404
|
-
declare class MEntity implements TEntity {
|
|
405
|
-
_id?: ObjectId;
|
|
406
|
-
name: string;
|
|
407
|
-
username: string;
|
|
408
|
-
type: "strand" | "office" | "bureau" | "service" | "person";
|
|
409
310
|
createdAt?: string;
|
|
410
311
|
updatedAt?: string;
|
|
411
312
|
deletedAt?: string;
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
}
|
|
313
|
+
};
|
|
314
|
+
declare function MMember(value: TMember): TMember;
|
|
415
315
|
|
|
416
|
-
declare function
|
|
316
|
+
declare function useMemberRepo(): {
|
|
417
317
|
createIndex: () => Promise<void>;
|
|
418
318
|
createUniqueIndex: () => Promise<void>;
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
319
|
+
createTextIndex: () => Promise<void>;
|
|
320
|
+
add: (value: TMember, session?: ClientSession) => Promise<string>;
|
|
321
|
+
getById: (_id: string | ObjectId) => Promise<TMember | null>;
|
|
322
|
+
getAll: ({ search, limit, page, user, org, type, status }?: {
|
|
323
|
+
search: string;
|
|
324
|
+
limit: number;
|
|
325
|
+
page: number;
|
|
326
|
+
user?: string | ObjectId | undefined;
|
|
327
|
+
org?: string | ObjectId | undefined;
|
|
328
|
+
type: string;
|
|
329
|
+
status: string;
|
|
425
330
|
}) => Promise<Record<string, any>>;
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
331
|
+
getOrgsByUserId: ({ search, page, limit, sort, user, status, }?: {
|
|
332
|
+
user: string | ObjectId;
|
|
333
|
+
page: number;
|
|
334
|
+
limit?: number | undefined;
|
|
335
|
+
search?: string | undefined;
|
|
336
|
+
sort?: Record<string, number> | undefined;
|
|
337
|
+
status?: string | undefined;
|
|
338
|
+
}) => Promise<{
|
|
339
|
+
items: any[];
|
|
340
|
+
pages: number;
|
|
341
|
+
pageRange: string;
|
|
342
|
+
} | {
|
|
343
|
+
_id: ObjectId;
|
|
344
|
+
name: string;
|
|
345
|
+
}[]>;
|
|
346
|
+
updateStatusByUserId: (user: string | ObjectId, status: string) => Promise<string>;
|
|
347
|
+
updateName: (value: Pick<TMember, "user" | "name">, session?: ClientSession) => Promise<string>;
|
|
348
|
+
getByUserId: (user: string | ObjectId) => Promise<TMember | null>;
|
|
349
|
+
getOrgsByMembership: ({ search, limit, page, user }?: {
|
|
350
|
+
search: string;
|
|
351
|
+
limit: number;
|
|
352
|
+
page: number;
|
|
353
|
+
user?: string | ObjectId | undefined;
|
|
354
|
+
}) => Promise<{
|
|
355
|
+
items: any[];
|
|
356
|
+
pages: number;
|
|
357
|
+
pageRange: string;
|
|
358
|
+
} | {
|
|
359
|
+
text: string;
|
|
360
|
+
value: ObjectId;
|
|
361
|
+
}[]>;
|
|
362
|
+
countByOrg: (org: string | ObjectId) => Promise<number>;
|
|
363
|
+
countByUser: (user: string | ObjectId) => Promise<number>;
|
|
364
|
+
getByUserType: (user: string | ObjectId, type: string, org?: string | ObjectId) => Promise<TMember | null>;
|
|
432
365
|
};
|
|
433
366
|
|
|
434
|
-
declare function
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
367
|
+
declare function useMemberController(): {
|
|
368
|
+
getByUserId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
369
|
+
getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
370
|
+
getOrgsByMembership: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
371
|
+
updateStatusByUserId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
372
|
+
getByUserType: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
439
373
|
};
|
|
440
374
|
|
|
441
|
-
type
|
|
442
|
-
addedAt?: Date | string;
|
|
443
|
-
email: string;
|
|
444
|
-
};
|
|
445
|
-
type TSubscription = {
|
|
375
|
+
type TOrg = {
|
|
446
376
|
_id?: ObjectId;
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
description?: string;
|
|
453
|
-
currency: string;
|
|
454
|
-
promoCode?: string;
|
|
455
|
-
type: string;
|
|
456
|
-
paidSeats?: number;
|
|
457
|
-
currentSeats?: number;
|
|
458
|
-
maxSeats?: number;
|
|
377
|
+
name: string;
|
|
378
|
+
description: string;
|
|
379
|
+
type?: string;
|
|
380
|
+
email?: string;
|
|
381
|
+
contact?: string;
|
|
459
382
|
status?: string;
|
|
460
|
-
billingCycle: "monthly" | "yearly";
|
|
461
|
-
billingContacts?: Array<TBillingRecipient>;
|
|
462
|
-
nextBillingDate?: Date;
|
|
463
|
-
lastPaymentStatus?: string;
|
|
464
|
-
failedAttempts?: number;
|
|
465
383
|
createdAt?: string | Date;
|
|
466
384
|
updatedAt?: string | Date;
|
|
467
385
|
deletedAt?: string | Date;
|
|
468
386
|
};
|
|
469
|
-
declare
|
|
387
|
+
declare const OrgTypes: string[];
|
|
388
|
+
declare const schemaOrg: Joi.ObjectSchema<any>;
|
|
389
|
+
declare function MOrg(value: TOrg): TOrg;
|
|
470
390
|
|
|
471
|
-
declare function
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
getById: (_id: string | ObjectId) => Promise<TSubscription | null>;
|
|
476
|
-
getBySubscriptionId: (subscriptionId: string) => Promise<TSubscription | null>;
|
|
477
|
-
getByUserId: (user: string | ObjectId) => Promise<TSubscription | null>;
|
|
478
|
-
getSubscriptions: ({ search, page, limit, sort, status, }?: {
|
|
391
|
+
declare function useOrgRepo(): {
|
|
392
|
+
createIndexes: () => Promise<void>;
|
|
393
|
+
add: (value: TOrg, session?: ClientSession) => Promise<ObjectId>;
|
|
394
|
+
getAll: ({ search, page, limit, sort, status, }?: {
|
|
479
395
|
search?: string | undefined;
|
|
480
396
|
page?: number | undefined;
|
|
481
397
|
limit?: number | undefined;
|
|
482
398
|
sort?: {} | undefined;
|
|
483
399
|
status?: string | undefined;
|
|
484
400
|
}) => Promise<Record<string, any>>;
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
getByAffiliateUserId: (user: string | ObjectId) => Promise<TSubscription | null>;
|
|
488
|
-
getDueSubscriptions: (BATCH_SIZE?: number) => Promise<TSubscription[]>;
|
|
489
|
-
getFailedSubscriptions: (BATCH_SIZE?: number) => Promise<TSubscription[]>;
|
|
490
|
-
processSuccessfulPayment: (value: Pick<TSubscription, "nextBillingDate"> & {
|
|
401
|
+
getById: (_id: string | ObjectId) => Promise<TOrg>;
|
|
402
|
+
updateFieldById: ({ _id, field, value }?: {
|
|
491
403
|
_id: string | ObjectId;
|
|
404
|
+
field: string;
|
|
405
|
+
value: string;
|
|
492
406
|
}, session?: ClientSession) => Promise<string>;
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
failed?: boolean | undefined;
|
|
496
|
-
}, session?: ClientSession) => Promise<mongodb.UpdateResult<TSubscription>>;
|
|
497
|
-
markSubscriptionAsCanceled: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<TSubscription>>;
|
|
498
|
-
updateSeatsById: ({ _id, currentSeats, maxSeats, paidSeats, amount, status, nextBillingDate, }?: {
|
|
499
|
-
_id: string | ObjectId;
|
|
500
|
-
currentSeats: number;
|
|
501
|
-
maxSeats: number;
|
|
502
|
-
paidSeats?: number | undefined;
|
|
503
|
-
amount: number;
|
|
504
|
-
status?: string | undefined;
|
|
505
|
-
nextBillingDate?: string | undefined;
|
|
506
|
-
}, session?: ClientSession) => Promise<mongodb.UpdateResult<TSubscription>>;
|
|
507
|
-
updateMaxSeatsById: ({ _id, seats }?: {
|
|
508
|
-
_id: string | ObjectId;
|
|
509
|
-
seats: number;
|
|
510
|
-
}, session?: ClientSession) => Promise<mongodb.UpdateResult<TSubscription>>;
|
|
511
|
-
updateStatusById: (_id: string | ObjectId, status: string, session?: ClientSession) => Promise<mongodb.UpdateResult<TSubscription>>;
|
|
512
|
-
updatePromoCodeById: (_id: string | ObjectId, promoCode: string, session?: ClientSession) => Promise<mongodb.UpdateResult<TSubscription>>;
|
|
513
|
-
updatePaymentMethodById: (_id: string | ObjectId, paymentMethodId: string, session?: ClientSession) => Promise<mongodb.UpdateResult<TSubscription>>;
|
|
514
|
-
addBillingContactById: (_id: string | ObjectId, email: string) => Promise<string>;
|
|
515
|
-
updateBillingContactByAddedAt: (_id: string | ObjectId, addedAt: string | Date, email: string) => Promise<string>;
|
|
516
|
-
deleteBillingContactByAddedAt: (_id: string | ObjectId, addedAt: string | Date) => Promise<string>;
|
|
407
|
+
deleteById: (_id: string | ObjectId) => Promise<string>;
|
|
408
|
+
getByName: (name: string) => Promise<TOrg>;
|
|
517
409
|
};
|
|
518
410
|
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
name: string;
|
|
522
|
-
description: string;
|
|
523
|
-
type?: string;
|
|
524
|
-
email?: string;
|
|
525
|
-
contact?: string;
|
|
526
|
-
busInst?: string;
|
|
527
|
-
status?: string;
|
|
528
|
-
xenditCustomerId?: string;
|
|
529
|
-
createdAt?: string;
|
|
530
|
-
updatedAt?: string;
|
|
531
|
-
deletedAt?: string;
|
|
532
|
-
};
|
|
533
|
-
declare function MOrg(value: TOrg): TOrg;
|
|
534
|
-
|
|
535
|
-
type TAddress = {
|
|
536
|
-
_id?: ObjectId;
|
|
537
|
-
type: string;
|
|
538
|
-
user: ObjectId | string;
|
|
539
|
-
org?: ObjectId | string;
|
|
540
|
-
country: string;
|
|
541
|
-
address: string;
|
|
542
|
-
continuedAddress?: string;
|
|
543
|
-
city: string;
|
|
544
|
-
province: string;
|
|
545
|
-
postalCode: string;
|
|
546
|
-
taxId: string;
|
|
547
|
-
};
|
|
548
|
-
declare const addressSchema: Joi.ObjectSchema<any>;
|
|
549
|
-
declare function MAddress(value: any): TAddress;
|
|
550
|
-
|
|
551
|
-
declare function useSubscriptionService(): {
|
|
552
|
-
subscribe: (value: {
|
|
553
|
-
user: string;
|
|
554
|
-
currency: string;
|
|
555
|
-
perSeatPrice: number;
|
|
556
|
-
seats: number;
|
|
557
|
-
transactionId?: string | undefined;
|
|
558
|
-
promoCode?: string | undefined;
|
|
559
|
-
org: {
|
|
560
|
-
name: string;
|
|
561
|
-
type: string;
|
|
562
|
-
email: string;
|
|
563
|
-
busInst?: string;
|
|
564
|
-
contact: string;
|
|
565
|
-
description: string;
|
|
566
|
-
};
|
|
567
|
-
}) => Promise<{
|
|
568
|
-
message: string;
|
|
569
|
-
data: {
|
|
570
|
-
org: string;
|
|
571
|
-
};
|
|
572
|
-
}>;
|
|
573
|
-
getByUserId: (id: string) => Promise<any>;
|
|
574
|
-
getStatusByUser: (user: string) => Promise<string>;
|
|
575
|
-
createAffiliateSubscription: (value: {
|
|
576
|
-
user: string;
|
|
577
|
-
amount: number;
|
|
578
|
-
currency: string;
|
|
579
|
-
promoCode?: string | undefined;
|
|
580
|
-
payment_method_id: string;
|
|
581
|
-
payment_method_expiry_month?: string | undefined;
|
|
582
|
-
payment_method_expiry_year?: string | undefined;
|
|
583
|
-
payment_method_cvv?: string | undefined;
|
|
584
|
-
payment_method_cardholder_name?: string | undefined;
|
|
585
|
-
payment_method_channel: string;
|
|
586
|
-
payment_method_type: string;
|
|
587
|
-
customer_id: string;
|
|
588
|
-
billingAddress: TAddress;
|
|
589
|
-
}) => Promise<string>;
|
|
590
|
-
createOrgSubscription: (value: {
|
|
591
|
-
user: string;
|
|
592
|
-
amount: number;
|
|
593
|
-
currency: string;
|
|
594
|
-
promoCode?: string | undefined;
|
|
595
|
-
payment_method_id: string;
|
|
596
|
-
payment_method_expiry_month?: string | undefined;
|
|
597
|
-
payment_method_expiry_year?: string | undefined;
|
|
598
|
-
payment_method_cvv?: string | undefined;
|
|
599
|
-
payment_method_cardholder_name?: string | undefined;
|
|
600
|
-
payment_method_channel: string;
|
|
601
|
-
payment_method_type: string;
|
|
602
|
-
customer_id: string;
|
|
603
|
-
organization: TOrg;
|
|
604
|
-
billingAddress: TAddress;
|
|
605
|
-
seats: number;
|
|
606
|
-
}) => Promise<{
|
|
607
|
-
message: string;
|
|
608
|
-
data: {
|
|
609
|
-
org: string;
|
|
610
|
-
};
|
|
611
|
-
}>;
|
|
612
|
-
processSubscriptions: (batchSize?: number, maxRetries?: number) => Promise<void>;
|
|
613
|
-
updateSeatsById: (value: {
|
|
614
|
-
transactionId?: string | undefined;
|
|
615
|
-
subscriptionId: string;
|
|
616
|
-
seats: number;
|
|
617
|
-
amount: number;
|
|
618
|
-
}) => Promise<void>;
|
|
619
|
-
updateSubscriptionSeats: (value: {
|
|
620
|
-
transactionId?: string | undefined;
|
|
621
|
-
subscriptionId: string;
|
|
622
|
-
seats: number;
|
|
623
|
-
amount: number;
|
|
624
|
-
}) => Promise<void>;
|
|
625
|
-
processSubscriptionPayment: (invoiceNumber: string, subscriptionId: string) => Promise<void>;
|
|
411
|
+
declare function useOrgService(): {
|
|
412
|
+
add: (value: TOrg) => Promise<string>;
|
|
626
413
|
};
|
|
627
414
|
|
|
628
|
-
declare function
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
415
|
+
declare function useOrgController(): {
|
|
416
|
+
createOrg: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
417
|
+
getOrgsByUserId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
418
|
+
getByName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
419
|
+
getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
633
420
|
getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
634
|
-
getByAffiliateUserId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
635
|
-
getSubscriptions: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
636
|
-
getSubscriptionStatus: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
637
|
-
createAffiliateSubscription: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
638
|
-
createOrgSubscription: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
639
|
-
updateSubscriptionSeats: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
640
|
-
updatePromoCodeById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
641
|
-
updateStatusById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
642
|
-
updatePaymentMethodById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
643
|
-
addBillingContactById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
644
|
-
updateBillingContactByAddedAt: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
645
|
-
deleteBillingContactByAddedAt: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
646
|
-
processSubscriptionPayment: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
647
|
-
};
|
|
648
|
-
|
|
649
|
-
declare const CustomerSchema: z.ZodEffects<z.ZodObject<{
|
|
650
|
-
reference_id: z.ZodString;
|
|
651
|
-
type: z.ZodEnum<["INDIVIDUAL", "BUSINESS"]>;
|
|
652
|
-
individual_detail: z.ZodOptional<z.ZodLazy<z.ZodObject<{
|
|
653
|
-
given_names: z.ZodString;
|
|
654
|
-
surname: z.ZodOptional<z.ZodString>;
|
|
655
|
-
nationality: z.ZodOptional<z.ZodString>;
|
|
656
|
-
place_of_birth: z.ZodOptional<z.ZodString>;
|
|
657
|
-
date_of_birth: z.ZodOptional<z.ZodString>;
|
|
658
|
-
gender: z.ZodOptional<z.ZodEnum<["MALE", "FEMALE", "OTHER"]>>;
|
|
659
|
-
employment: z.ZodOptional<z.ZodString>;
|
|
660
|
-
employer_name: z.ZodOptional<z.ZodString>;
|
|
661
|
-
nature_of_business: z.ZodOptional<z.ZodString>;
|
|
662
|
-
role_description: z.ZodOptional<z.ZodString>;
|
|
663
|
-
}, "strip", z.ZodTypeAny, {
|
|
664
|
-
given_names: string;
|
|
665
|
-
gender?: "MALE" | "FEMALE" | "OTHER" | undefined;
|
|
666
|
-
surname?: string | undefined;
|
|
667
|
-
nationality?: string | undefined;
|
|
668
|
-
place_of_birth?: string | undefined;
|
|
669
|
-
date_of_birth?: string | undefined;
|
|
670
|
-
employment?: string | undefined;
|
|
671
|
-
employer_name?: string | undefined;
|
|
672
|
-
nature_of_business?: string | undefined;
|
|
673
|
-
role_description?: string | undefined;
|
|
674
|
-
}, {
|
|
675
|
-
given_names: string;
|
|
676
|
-
gender?: "MALE" | "FEMALE" | "OTHER" | undefined;
|
|
677
|
-
surname?: string | undefined;
|
|
678
|
-
nationality?: string | undefined;
|
|
679
|
-
place_of_birth?: string | undefined;
|
|
680
|
-
date_of_birth?: string | undefined;
|
|
681
|
-
employment?: string | undefined;
|
|
682
|
-
employer_name?: string | undefined;
|
|
683
|
-
nature_of_business?: string | undefined;
|
|
684
|
-
role_description?: string | undefined;
|
|
685
|
-
}>>>;
|
|
686
|
-
business_detail: z.ZodOptional<z.ZodLazy<z.ZodObject<{
|
|
687
|
-
business_name: z.ZodString;
|
|
688
|
-
trading_name: z.ZodOptional<z.ZodString>;
|
|
689
|
-
business_type: z.ZodEnum<["CORPORATION", "SOLE_PROPRIETOR", "PARTNERSHIP", "COOPERATIVE", "TRUST", "NON_PROFIT", "GOVERNMENT"]>;
|
|
690
|
-
nature_of_business: z.ZodOptional<z.ZodString>;
|
|
691
|
-
business_domicile: z.ZodOptional<z.ZodString>;
|
|
692
|
-
date_of_registration: z.ZodOptional<z.ZodString>;
|
|
693
|
-
}, "strip", z.ZodTypeAny, {
|
|
694
|
-
business_name: string;
|
|
695
|
-
business_type: "CORPORATION" | "SOLE_PROPRIETOR" | "PARTNERSHIP" | "COOPERATIVE" | "TRUST" | "NON_PROFIT" | "GOVERNMENT";
|
|
696
|
-
nature_of_business?: string | undefined;
|
|
697
|
-
trading_name?: string | undefined;
|
|
698
|
-
business_domicile?: string | undefined;
|
|
699
|
-
date_of_registration?: string | undefined;
|
|
700
|
-
}, {
|
|
701
|
-
business_name: string;
|
|
702
|
-
business_type: "CORPORATION" | "SOLE_PROPRIETOR" | "PARTNERSHIP" | "COOPERATIVE" | "TRUST" | "NON_PROFIT" | "GOVERNMENT";
|
|
703
|
-
nature_of_business?: string | undefined;
|
|
704
|
-
trading_name?: string | undefined;
|
|
705
|
-
business_domicile?: string | undefined;
|
|
706
|
-
date_of_registration?: string | undefined;
|
|
707
|
-
}>>>;
|
|
708
|
-
mobile_number: z.ZodOptional<z.ZodString>;
|
|
709
|
-
phone_number: z.ZodOptional<z.ZodString>;
|
|
710
|
-
hashed_phone_number: z.ZodOptional<z.ZodString>;
|
|
711
|
-
email: z.ZodOptional<z.ZodString>;
|
|
712
|
-
addresses: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
713
|
-
country: z.ZodString;
|
|
714
|
-
street_line1: z.ZodOptional<z.ZodString>;
|
|
715
|
-
street_line2: z.ZodOptional<z.ZodString>;
|
|
716
|
-
city: z.ZodOptional<z.ZodString>;
|
|
717
|
-
province_state: z.ZodOptional<z.ZodString>;
|
|
718
|
-
postal_code: z.ZodOptional<z.ZodString>;
|
|
719
|
-
category: z.ZodOptional<z.ZodEnum<["HOME", "WORK", "PROVINCIAL"]>>;
|
|
720
|
-
is_primary: z.ZodOptional<z.ZodBoolean>;
|
|
721
|
-
}, "strip", z.ZodTypeAny, {
|
|
722
|
-
country: string;
|
|
723
|
-
street_line1?: string | undefined;
|
|
724
|
-
street_line2?: string | undefined;
|
|
725
|
-
city?: string | undefined;
|
|
726
|
-
province_state?: string | undefined;
|
|
727
|
-
postal_code?: string | undefined;
|
|
728
|
-
category?: "HOME" | "WORK" | "PROVINCIAL" | undefined;
|
|
729
|
-
is_primary?: boolean | undefined;
|
|
730
|
-
}, {
|
|
731
|
-
country: string;
|
|
732
|
-
street_line1?: string | undefined;
|
|
733
|
-
street_line2?: string | undefined;
|
|
734
|
-
city?: string | undefined;
|
|
735
|
-
province_state?: string | undefined;
|
|
736
|
-
postal_code?: string | undefined;
|
|
737
|
-
category?: "HOME" | "WORK" | "PROVINCIAL" | undefined;
|
|
738
|
-
is_primary?: boolean | undefined;
|
|
739
|
-
}>, "many">>;
|
|
740
|
-
identity_accounts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
741
|
-
type: z.ZodEnum<["BANK_ACCOUNT", "EWALLET", "CREDIT_CARD", "PAY_LATER", "OTC", "QR_CODE", "SOCIAL_MEDIA"]>;
|
|
742
|
-
company: z.ZodOptional<z.ZodString>;
|
|
743
|
-
description: z.ZodOptional<z.ZodString>;
|
|
744
|
-
country: z.ZodOptional<z.ZodString>;
|
|
745
|
-
properties: z.ZodOptional<z.ZodAny>;
|
|
746
|
-
}, "strip", z.ZodTypeAny, {
|
|
747
|
-
type: "BANK_ACCOUNT" | "EWALLET" | "CREDIT_CARD" | "PAY_LATER" | "OTC" | "QR_CODE" | "SOCIAL_MEDIA";
|
|
748
|
-
country?: string | undefined;
|
|
749
|
-
company?: string | undefined;
|
|
750
|
-
description?: string | undefined;
|
|
751
|
-
properties?: any;
|
|
752
|
-
}, {
|
|
753
|
-
type: "BANK_ACCOUNT" | "EWALLET" | "CREDIT_CARD" | "PAY_LATER" | "OTC" | "QR_CODE" | "SOCIAL_MEDIA";
|
|
754
|
-
country?: string | undefined;
|
|
755
|
-
company?: string | undefined;
|
|
756
|
-
description?: string | undefined;
|
|
757
|
-
properties?: any;
|
|
758
|
-
}>, "many">>;
|
|
759
|
-
kyc_documents: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
760
|
-
country: z.ZodString;
|
|
761
|
-
type: z.ZodEnum<["BIRTH_CERTIFICATE", "BANK_STATEMENT", "DRIVING_LICENSE", "IDENTITY_CARD", "PASSPORT", "VISA", "BUSINESS_REGISTRATION", "BUSINESS_LICENSE"]>;
|
|
762
|
-
sub_type: z.ZodOptional<z.ZodEnum<["NATIONAL_ID", "CONSULAR_ID", "VOTER_ID", "POSTAL_ID", "RESIDENCE_PERMIT", "TAX_ID", "STUDENT_ID", "MILITARY_ID", "MEDICAL_ID"]>>;
|
|
763
|
-
document_name: z.ZodOptional<z.ZodString>;
|
|
764
|
-
document_number: z.ZodOptional<z.ZodString>;
|
|
765
|
-
expires_at: z.ZodOptional<z.ZodString>;
|
|
766
|
-
holder_name: z.ZodOptional<z.ZodString>;
|
|
767
|
-
document_images: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
768
|
-
}, "strip", z.ZodTypeAny, {
|
|
769
|
-
type: "BIRTH_CERTIFICATE" | "BANK_STATEMENT" | "DRIVING_LICENSE" | "IDENTITY_CARD" | "PASSPORT" | "VISA" | "BUSINESS_REGISTRATION" | "BUSINESS_LICENSE";
|
|
770
|
-
country: string;
|
|
771
|
-
sub_type?: "NATIONAL_ID" | "CONSULAR_ID" | "VOTER_ID" | "POSTAL_ID" | "RESIDENCE_PERMIT" | "TAX_ID" | "STUDENT_ID" | "MILITARY_ID" | "MEDICAL_ID" | undefined;
|
|
772
|
-
document_name?: string | undefined;
|
|
773
|
-
document_number?: string | undefined;
|
|
774
|
-
expires_at?: string | undefined;
|
|
775
|
-
holder_name?: string | undefined;
|
|
776
|
-
document_images?: string[] | undefined;
|
|
777
|
-
}, {
|
|
778
|
-
type: "BIRTH_CERTIFICATE" | "BANK_STATEMENT" | "DRIVING_LICENSE" | "IDENTITY_CARD" | "PASSPORT" | "VISA" | "BUSINESS_REGISTRATION" | "BUSINESS_LICENSE";
|
|
779
|
-
country: string;
|
|
780
|
-
sub_type?: "NATIONAL_ID" | "CONSULAR_ID" | "VOTER_ID" | "POSTAL_ID" | "RESIDENCE_PERMIT" | "TAX_ID" | "STUDENT_ID" | "MILITARY_ID" | "MEDICAL_ID" | undefined;
|
|
781
|
-
document_name?: string | undefined;
|
|
782
|
-
document_number?: string | undefined;
|
|
783
|
-
expires_at?: string | undefined;
|
|
784
|
-
holder_name?: string | undefined;
|
|
785
|
-
document_images?: string[] | undefined;
|
|
786
|
-
}>, "many">>;
|
|
787
|
-
description: z.ZodOptional<z.ZodString>;
|
|
788
|
-
date_of_registration: z.ZodOptional<z.ZodString>;
|
|
789
|
-
}, "strip", z.ZodTypeAny, {
|
|
790
|
-
type: "INDIVIDUAL" | "BUSINESS";
|
|
791
|
-
reference_id: string;
|
|
792
|
-
email?: string | undefined;
|
|
793
|
-
description?: string | undefined;
|
|
794
|
-
date_of_registration?: string | undefined;
|
|
795
|
-
individual_detail?: {
|
|
796
|
-
given_names: string;
|
|
797
|
-
gender?: "MALE" | "FEMALE" | "OTHER" | undefined;
|
|
798
|
-
surname?: string | undefined;
|
|
799
|
-
nationality?: string | undefined;
|
|
800
|
-
place_of_birth?: string | undefined;
|
|
801
|
-
date_of_birth?: string | undefined;
|
|
802
|
-
employment?: string | undefined;
|
|
803
|
-
employer_name?: string | undefined;
|
|
804
|
-
nature_of_business?: string | undefined;
|
|
805
|
-
role_description?: string | undefined;
|
|
806
|
-
} | undefined;
|
|
807
|
-
business_detail?: {
|
|
808
|
-
business_name: string;
|
|
809
|
-
business_type: "CORPORATION" | "SOLE_PROPRIETOR" | "PARTNERSHIP" | "COOPERATIVE" | "TRUST" | "NON_PROFIT" | "GOVERNMENT";
|
|
810
|
-
nature_of_business?: string | undefined;
|
|
811
|
-
trading_name?: string | undefined;
|
|
812
|
-
business_domicile?: string | undefined;
|
|
813
|
-
date_of_registration?: string | undefined;
|
|
814
|
-
} | undefined;
|
|
815
|
-
mobile_number?: string | undefined;
|
|
816
|
-
phone_number?: string | undefined;
|
|
817
|
-
hashed_phone_number?: string | undefined;
|
|
818
|
-
addresses?: {
|
|
819
|
-
country: string;
|
|
820
|
-
street_line1?: string | undefined;
|
|
821
|
-
street_line2?: string | undefined;
|
|
822
|
-
city?: string | undefined;
|
|
823
|
-
province_state?: string | undefined;
|
|
824
|
-
postal_code?: string | undefined;
|
|
825
|
-
category?: "HOME" | "WORK" | "PROVINCIAL" | undefined;
|
|
826
|
-
is_primary?: boolean | undefined;
|
|
827
|
-
}[] | undefined;
|
|
828
|
-
identity_accounts?: {
|
|
829
|
-
type: "BANK_ACCOUNT" | "EWALLET" | "CREDIT_CARD" | "PAY_LATER" | "OTC" | "QR_CODE" | "SOCIAL_MEDIA";
|
|
830
|
-
country?: string | undefined;
|
|
831
|
-
company?: string | undefined;
|
|
832
|
-
description?: string | undefined;
|
|
833
|
-
properties?: any;
|
|
834
|
-
}[] | undefined;
|
|
835
|
-
kyc_documents?: {
|
|
836
|
-
type: "BIRTH_CERTIFICATE" | "BANK_STATEMENT" | "DRIVING_LICENSE" | "IDENTITY_CARD" | "PASSPORT" | "VISA" | "BUSINESS_REGISTRATION" | "BUSINESS_LICENSE";
|
|
837
|
-
country: string;
|
|
838
|
-
sub_type?: "NATIONAL_ID" | "CONSULAR_ID" | "VOTER_ID" | "POSTAL_ID" | "RESIDENCE_PERMIT" | "TAX_ID" | "STUDENT_ID" | "MILITARY_ID" | "MEDICAL_ID" | undefined;
|
|
839
|
-
document_name?: string | undefined;
|
|
840
|
-
document_number?: string | undefined;
|
|
841
|
-
expires_at?: string | undefined;
|
|
842
|
-
holder_name?: string | undefined;
|
|
843
|
-
document_images?: string[] | undefined;
|
|
844
|
-
}[] | undefined;
|
|
845
|
-
}, {
|
|
846
|
-
type: "INDIVIDUAL" | "BUSINESS";
|
|
847
|
-
reference_id: string;
|
|
848
|
-
email?: string | undefined;
|
|
849
|
-
description?: string | undefined;
|
|
850
|
-
date_of_registration?: string | undefined;
|
|
851
|
-
individual_detail?: {
|
|
852
|
-
given_names: string;
|
|
853
|
-
gender?: "MALE" | "FEMALE" | "OTHER" | undefined;
|
|
854
|
-
surname?: string | undefined;
|
|
855
|
-
nationality?: string | undefined;
|
|
856
|
-
place_of_birth?: string | undefined;
|
|
857
|
-
date_of_birth?: string | undefined;
|
|
858
|
-
employment?: string | undefined;
|
|
859
|
-
employer_name?: string | undefined;
|
|
860
|
-
nature_of_business?: string | undefined;
|
|
861
|
-
role_description?: string | undefined;
|
|
862
|
-
} | undefined;
|
|
863
|
-
business_detail?: {
|
|
864
|
-
business_name: string;
|
|
865
|
-
business_type: "CORPORATION" | "SOLE_PROPRIETOR" | "PARTNERSHIP" | "COOPERATIVE" | "TRUST" | "NON_PROFIT" | "GOVERNMENT";
|
|
866
|
-
nature_of_business?: string | undefined;
|
|
867
|
-
trading_name?: string | undefined;
|
|
868
|
-
business_domicile?: string | undefined;
|
|
869
|
-
date_of_registration?: string | undefined;
|
|
870
|
-
} | undefined;
|
|
871
|
-
mobile_number?: string | undefined;
|
|
872
|
-
phone_number?: string | undefined;
|
|
873
|
-
hashed_phone_number?: string | undefined;
|
|
874
|
-
addresses?: {
|
|
875
|
-
country: string;
|
|
876
|
-
street_line1?: string | undefined;
|
|
877
|
-
street_line2?: string | undefined;
|
|
878
|
-
city?: string | undefined;
|
|
879
|
-
province_state?: string | undefined;
|
|
880
|
-
postal_code?: string | undefined;
|
|
881
|
-
category?: "HOME" | "WORK" | "PROVINCIAL" | undefined;
|
|
882
|
-
is_primary?: boolean | undefined;
|
|
883
|
-
}[] | undefined;
|
|
884
|
-
identity_accounts?: {
|
|
885
|
-
type: "BANK_ACCOUNT" | "EWALLET" | "CREDIT_CARD" | "PAY_LATER" | "OTC" | "QR_CODE" | "SOCIAL_MEDIA";
|
|
886
|
-
country?: string | undefined;
|
|
887
|
-
company?: string | undefined;
|
|
888
|
-
description?: string | undefined;
|
|
889
|
-
properties?: any;
|
|
890
|
-
}[] | undefined;
|
|
891
|
-
kyc_documents?: {
|
|
892
|
-
type: "BIRTH_CERTIFICATE" | "BANK_STATEMENT" | "DRIVING_LICENSE" | "IDENTITY_CARD" | "PASSPORT" | "VISA" | "BUSINESS_REGISTRATION" | "BUSINESS_LICENSE";
|
|
893
|
-
country: string;
|
|
894
|
-
sub_type?: "NATIONAL_ID" | "CONSULAR_ID" | "VOTER_ID" | "POSTAL_ID" | "RESIDENCE_PERMIT" | "TAX_ID" | "STUDENT_ID" | "MILITARY_ID" | "MEDICAL_ID" | undefined;
|
|
895
|
-
document_name?: string | undefined;
|
|
896
|
-
document_number?: string | undefined;
|
|
897
|
-
expires_at?: string | undefined;
|
|
898
|
-
holder_name?: string | undefined;
|
|
899
|
-
document_images?: string[] | undefined;
|
|
900
|
-
}[] | undefined;
|
|
901
|
-
}>, {
|
|
902
|
-
type: "INDIVIDUAL" | "BUSINESS";
|
|
903
|
-
reference_id: string;
|
|
904
|
-
email?: string | undefined;
|
|
905
|
-
description?: string | undefined;
|
|
906
|
-
date_of_registration?: string | undefined;
|
|
907
|
-
individual_detail?: {
|
|
908
|
-
given_names: string;
|
|
909
|
-
gender?: "MALE" | "FEMALE" | "OTHER" | undefined;
|
|
910
|
-
surname?: string | undefined;
|
|
911
|
-
nationality?: string | undefined;
|
|
912
|
-
place_of_birth?: string | undefined;
|
|
913
|
-
date_of_birth?: string | undefined;
|
|
914
|
-
employment?: string | undefined;
|
|
915
|
-
employer_name?: string | undefined;
|
|
916
|
-
nature_of_business?: string | undefined;
|
|
917
|
-
role_description?: string | undefined;
|
|
918
|
-
} | undefined;
|
|
919
|
-
business_detail?: {
|
|
920
|
-
business_name: string;
|
|
921
|
-
business_type: "CORPORATION" | "SOLE_PROPRIETOR" | "PARTNERSHIP" | "COOPERATIVE" | "TRUST" | "NON_PROFIT" | "GOVERNMENT";
|
|
922
|
-
nature_of_business?: string | undefined;
|
|
923
|
-
trading_name?: string | undefined;
|
|
924
|
-
business_domicile?: string | undefined;
|
|
925
|
-
date_of_registration?: string | undefined;
|
|
926
|
-
} | undefined;
|
|
927
|
-
mobile_number?: string | undefined;
|
|
928
|
-
phone_number?: string | undefined;
|
|
929
|
-
hashed_phone_number?: string | undefined;
|
|
930
|
-
addresses?: {
|
|
931
|
-
country: string;
|
|
932
|
-
street_line1?: string | undefined;
|
|
933
|
-
street_line2?: string | undefined;
|
|
934
|
-
city?: string | undefined;
|
|
935
|
-
province_state?: string | undefined;
|
|
936
|
-
postal_code?: string | undefined;
|
|
937
|
-
category?: "HOME" | "WORK" | "PROVINCIAL" | undefined;
|
|
938
|
-
is_primary?: boolean | undefined;
|
|
939
|
-
}[] | undefined;
|
|
940
|
-
identity_accounts?: {
|
|
941
|
-
type: "BANK_ACCOUNT" | "EWALLET" | "CREDIT_CARD" | "PAY_LATER" | "OTC" | "QR_CODE" | "SOCIAL_MEDIA";
|
|
942
|
-
country?: string | undefined;
|
|
943
|
-
company?: string | undefined;
|
|
944
|
-
description?: string | undefined;
|
|
945
|
-
properties?: any;
|
|
946
|
-
}[] | undefined;
|
|
947
|
-
kyc_documents?: {
|
|
948
|
-
type: "BIRTH_CERTIFICATE" | "BANK_STATEMENT" | "DRIVING_LICENSE" | "IDENTITY_CARD" | "PASSPORT" | "VISA" | "BUSINESS_REGISTRATION" | "BUSINESS_LICENSE";
|
|
949
|
-
country: string;
|
|
950
|
-
sub_type?: "NATIONAL_ID" | "CONSULAR_ID" | "VOTER_ID" | "POSTAL_ID" | "RESIDENCE_PERMIT" | "TAX_ID" | "STUDENT_ID" | "MILITARY_ID" | "MEDICAL_ID" | undefined;
|
|
951
|
-
document_name?: string | undefined;
|
|
952
|
-
document_number?: string | undefined;
|
|
953
|
-
expires_at?: string | undefined;
|
|
954
|
-
holder_name?: string | undefined;
|
|
955
|
-
document_images?: string[] | undefined;
|
|
956
|
-
}[] | undefined;
|
|
957
|
-
}, {
|
|
958
|
-
type: "INDIVIDUAL" | "BUSINESS";
|
|
959
|
-
reference_id: string;
|
|
960
|
-
email?: string | undefined;
|
|
961
|
-
description?: string | undefined;
|
|
962
|
-
date_of_registration?: string | undefined;
|
|
963
|
-
individual_detail?: {
|
|
964
|
-
given_names: string;
|
|
965
|
-
gender?: "MALE" | "FEMALE" | "OTHER" | undefined;
|
|
966
|
-
surname?: string | undefined;
|
|
967
|
-
nationality?: string | undefined;
|
|
968
|
-
place_of_birth?: string | undefined;
|
|
969
|
-
date_of_birth?: string | undefined;
|
|
970
|
-
employment?: string | undefined;
|
|
971
|
-
employer_name?: string | undefined;
|
|
972
|
-
nature_of_business?: string | undefined;
|
|
973
|
-
role_description?: string | undefined;
|
|
974
|
-
} | undefined;
|
|
975
|
-
business_detail?: {
|
|
976
|
-
business_name: string;
|
|
977
|
-
business_type: "CORPORATION" | "SOLE_PROPRIETOR" | "PARTNERSHIP" | "COOPERATIVE" | "TRUST" | "NON_PROFIT" | "GOVERNMENT";
|
|
978
|
-
nature_of_business?: string | undefined;
|
|
979
|
-
trading_name?: string | undefined;
|
|
980
|
-
business_domicile?: string | undefined;
|
|
981
|
-
date_of_registration?: string | undefined;
|
|
982
|
-
} | undefined;
|
|
983
|
-
mobile_number?: string | undefined;
|
|
984
|
-
phone_number?: string | undefined;
|
|
985
|
-
hashed_phone_number?: string | undefined;
|
|
986
|
-
addresses?: {
|
|
987
|
-
country: string;
|
|
988
|
-
street_line1?: string | undefined;
|
|
989
|
-
street_line2?: string | undefined;
|
|
990
|
-
city?: string | undefined;
|
|
991
|
-
province_state?: string | undefined;
|
|
992
|
-
postal_code?: string | undefined;
|
|
993
|
-
category?: "HOME" | "WORK" | "PROVINCIAL" | undefined;
|
|
994
|
-
is_primary?: boolean | undefined;
|
|
995
|
-
}[] | undefined;
|
|
996
|
-
identity_accounts?: {
|
|
997
|
-
type: "BANK_ACCOUNT" | "EWALLET" | "CREDIT_CARD" | "PAY_LATER" | "OTC" | "QR_CODE" | "SOCIAL_MEDIA";
|
|
998
|
-
country?: string | undefined;
|
|
999
|
-
company?: string | undefined;
|
|
1000
|
-
description?: string | undefined;
|
|
1001
|
-
properties?: any;
|
|
1002
|
-
}[] | undefined;
|
|
1003
|
-
kyc_documents?: {
|
|
1004
|
-
type: "BIRTH_CERTIFICATE" | "BANK_STATEMENT" | "DRIVING_LICENSE" | "IDENTITY_CARD" | "PASSPORT" | "VISA" | "BUSINESS_REGISTRATION" | "BUSINESS_LICENSE";
|
|
1005
|
-
country: string;
|
|
1006
|
-
sub_type?: "NATIONAL_ID" | "CONSULAR_ID" | "VOTER_ID" | "POSTAL_ID" | "RESIDENCE_PERMIT" | "TAX_ID" | "STUDENT_ID" | "MILITARY_ID" | "MEDICAL_ID" | undefined;
|
|
1007
|
-
document_name?: string | undefined;
|
|
1008
|
-
document_number?: string | undefined;
|
|
1009
|
-
expires_at?: string | undefined;
|
|
1010
|
-
holder_name?: string | undefined;
|
|
1011
|
-
document_images?: string[] | undefined;
|
|
1012
|
-
}[] | undefined;
|
|
1013
|
-
}>;
|
|
1014
|
-
type TCustomer = z.infer<typeof CustomerSchema>;
|
|
1015
|
-
|
|
1016
|
-
declare function useXenditService(): {
|
|
1017
|
-
createCustomer: (value: TCustomer) => Promise<any>;
|
|
1018
|
-
linkPaymentMethodEWallet: ({ customerId, type, success_return_url, failure_return_url, cancel_return_url, }?: {
|
|
1019
|
-
customerId?: string | undefined;
|
|
1020
|
-
type?: string | undefined;
|
|
1021
|
-
success_return_url?: string | undefined;
|
|
1022
|
-
failure_return_url?: string | undefined;
|
|
1023
|
-
cancel_return_url?: string | undefined;
|
|
1024
|
-
}) => Promise<any>;
|
|
1025
|
-
initGCashLinkingAndPaymentRequest: ({ amount, currency, countryCode, customerId, success_return_url, failure_return_url, }?: {
|
|
1026
|
-
amount?: number | undefined;
|
|
1027
|
-
currency?: string | undefined;
|
|
1028
|
-
countryCode?: string | undefined;
|
|
1029
|
-
customerId?: string | undefined;
|
|
1030
|
-
success_return_url?: string | undefined;
|
|
1031
|
-
failure_return_url?: string | undefined;
|
|
1032
|
-
}) => Promise<any>;
|
|
1033
|
-
initSubscription: ({ customer, currency, amount, paymentMethod, description, interval, seats, }?: {
|
|
1034
|
-
customer?: string | undefined;
|
|
1035
|
-
currency?: string | undefined;
|
|
1036
|
-
amount?: number | undefined;
|
|
1037
|
-
paymentMethod?: string | undefined;
|
|
1038
|
-
description?: string | undefined;
|
|
1039
|
-
interval?: string | undefined;
|
|
1040
|
-
seats?: number | undefined;
|
|
1041
|
-
}) => Promise<any>;
|
|
1042
|
-
linkPaymentMethodCard: ({ success_return_url, failure_return_url, card_number, expiry_month, expiry_year, cvv, cardholder_name, currency, }?: {
|
|
1043
|
-
success_return_url?: string | undefined;
|
|
1044
|
-
failure_return_url?: string | undefined;
|
|
1045
|
-
card_number?: string | undefined;
|
|
1046
|
-
expiry_month?: string | undefined;
|
|
1047
|
-
expiry_year?: string | undefined;
|
|
1048
|
-
cvv?: string | undefined;
|
|
1049
|
-
cardholder_name?: string | undefined;
|
|
1050
|
-
currency?: string | undefined;
|
|
1051
|
-
}) => Promise<any>;
|
|
1052
|
-
eWalletSubsequentPayment: ({ amount, currency, payment_method_id, customer_id, description, }?: {
|
|
1053
|
-
amount?: number | undefined;
|
|
1054
|
-
currency?: string | undefined;
|
|
1055
|
-
payment_method_id?: string | undefined;
|
|
1056
|
-
customer_id?: string | undefined;
|
|
1057
|
-
description?: string | undefined;
|
|
1058
|
-
}) => Promise<any>;
|
|
1059
|
-
checkSubscriptionStatus: (subscriptionId: string) => Promise<string>;
|
|
1060
|
-
cancelSubscription: (subscriptionId: string) => Promise<string>;
|
|
1061
|
-
getSubscription: (id: string) => Promise<any>;
|
|
1062
|
-
getSubscriptionCycles: (id: string) => Promise<any>;
|
|
1063
|
-
pay: (value: {
|
|
1064
|
-
amount: number;
|
|
1065
|
-
currency: string;
|
|
1066
|
-
payment_method_id: string;
|
|
1067
|
-
customer_id: string;
|
|
1068
|
-
description?: string;
|
|
1069
|
-
metadata?: Record<string, any>;
|
|
1070
|
-
}) => Promise<any>;
|
|
1071
|
-
getPaymentMethodById: (id: string) => Promise<any>;
|
|
1072
|
-
getCustomerById: (id: string) => Promise<any>;
|
|
1073
|
-
eWalletLinkOnly: (value: Record<string, any>) => Promise<any>;
|
|
1074
|
-
directDebitLinkOnly: (value: Record<string, any>) => Promise<any>;
|
|
1075
|
-
cardLinkOnly: (value: Record<string, any>) => Promise<any>;
|
|
1076
|
-
getPaymentMethodsByCustomerId: (customerId: string) => Promise<any>;
|
|
1077
|
-
updatePaymentMethodStatusById: (id: string, status: string) => Promise<any>;
|
|
1078
421
|
};
|
|
1079
422
|
|
|
1080
|
-
type
|
|
423
|
+
type TPSGC = {
|
|
1081
424
|
_id?: ObjectId;
|
|
1082
|
-
|
|
1083
|
-
org?: ObjectId | string;
|
|
425
|
+
code: string;
|
|
1084
426
|
name: string;
|
|
1085
|
-
description?: string;
|
|
1086
427
|
type: string;
|
|
1087
|
-
number: string;
|
|
1088
|
-
month_expiry?: string;
|
|
1089
|
-
year_expiry?: string;
|
|
1090
|
-
cvv?: string;
|
|
1091
|
-
paymentId: string;
|
|
1092
|
-
customerId?: string;
|
|
1093
|
-
status?: string;
|
|
1094
|
-
createdAt?: string;
|
|
1095
|
-
deletedAt?: string;
|
|
1096
428
|
};
|
|
1097
|
-
declare
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
getByUser: (user: string | ObjectId) => Promise<bson.Document[]>;
|
|
1103
|
-
getByOrg: (org: string | ObjectId) => Promise<bson.Document[]>;
|
|
1104
|
-
deleteById: (_id: string | ObjectId) => Promise<string>;
|
|
1105
|
-
createUniqueIndex: () => Promise<void>;
|
|
1106
|
-
getByPaymentMethodId: (paymentMethodId: string | ObjectId) => Promise<TPaymentMethod$1 | null>;
|
|
429
|
+
declare const schemaPSGC: Joi.ObjectSchema<any>;
|
|
430
|
+
declare function modelPSGC(data: any): {
|
|
431
|
+
code: any;
|
|
432
|
+
name: any;
|
|
433
|
+
type: any;
|
|
1107
434
|
};
|
|
1108
435
|
|
|
1109
|
-
declare function
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
success_return_url?: string | undefined;
|
|
1114
|
-
failure_return_url?: string | undefined;
|
|
1115
|
-
cancel_return_url?: string | undefined;
|
|
1116
|
-
}) => Promise<{
|
|
1117
|
-
paymentMethod: any;
|
|
1118
|
-
actions: any;
|
|
1119
|
-
}>;
|
|
1120
|
-
linkCard: ({ user, type, success_return_url, failure_return_url, card_number, expiry_month, expiry_year, cvv, cardholder_name, currency, }?: {
|
|
1121
|
-
user?: string | undefined;
|
|
1122
|
-
type?: string | undefined;
|
|
1123
|
-
success_return_url?: string | undefined;
|
|
1124
|
-
failure_return_url?: string | undefined;
|
|
1125
|
-
card_number?: string | undefined;
|
|
1126
|
-
expiry_month?: string | undefined;
|
|
1127
|
-
expiry_year?: string | undefined;
|
|
1128
|
-
cvv?: string | undefined;
|
|
1129
|
-
cardholder_name?: string | undefined;
|
|
1130
|
-
currency?: string | undefined;
|
|
1131
|
-
}) => Promise<any>;
|
|
1132
|
-
};
|
|
1133
|
-
|
|
1134
|
-
declare function usePaymentMethodController(): {
|
|
1135
|
-
linkEWallet: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1136
|
-
linkCard: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1137
|
-
getByUser: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1138
|
-
getByOrg: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1139
|
-
linkOnly: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1140
|
-
getPaymentMethodById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1141
|
-
getPaymentMethodsByCustomerId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1142
|
-
updatePaymentMethodStatusById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1143
|
-
};
|
|
1144
|
-
|
|
1145
|
-
declare function useAddressRepo(): {
|
|
1146
|
-
createIndex: () => Promise<void>;
|
|
1147
|
-
add: (value: TAddress, session?: ClientSession) => Promise<ObjectId>;
|
|
1148
|
-
getByUserId: (user: string | ObjectId) => Promise<TAddress | null>;
|
|
1149
|
-
getByOrgId: (org: string | ObjectId) => Promise<TAddress | null>;
|
|
1150
|
-
updateById: (_id: string | ObjectId, value: Pick<TAddress, "org" | "country" | "city" | "address" | "continuedAddress" | "province" | "postalCode" | "taxId">, session?: ClientSession) => Promise<string>;
|
|
1151
|
-
};
|
|
1152
|
-
|
|
1153
|
-
declare function useAddressController(): {
|
|
1154
|
-
add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1155
|
-
getByUserId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1156
|
-
getByOrgId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1157
|
-
updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1158
|
-
};
|
|
1159
|
-
|
|
1160
|
-
declare function useOrgRepo(): {
|
|
1161
|
-
createIndex: () => Promise<void>;
|
|
1162
|
-
createTextIndex: () => Promise<void>;
|
|
1163
|
-
createUniqueIndex: () => Promise<void>;
|
|
1164
|
-
add: (value: TOrg, session?: ClientSession) => Promise<ObjectId>;
|
|
1165
|
-
getAll: ({ search, page, limit, sort, status, }?: {
|
|
436
|
+
declare function usePSGCRepo(): {
|
|
437
|
+
createIndexes: () => Promise<void>;
|
|
438
|
+
add: (value: TPSGC, session?: ClientSession) => Promise<ObjectId>;
|
|
439
|
+
getAll: ({ search, page, limit, sort, type, prefix, }?: {
|
|
1166
440
|
search?: string | undefined;
|
|
1167
441
|
page?: number | undefined;
|
|
1168
442
|
limit?: number | undefined;
|
|
1169
443
|
sort?: {} | undefined;
|
|
1170
|
-
|
|
444
|
+
type?: string | undefined;
|
|
445
|
+
prefix?: string | undefined;
|
|
1171
446
|
}) => Promise<Record<string, any>>;
|
|
1172
|
-
getById: (_id: string | ObjectId) => Promise<
|
|
447
|
+
getById: (_id: string | ObjectId) => Promise<TPSGC>;
|
|
1173
448
|
updateFieldById: ({ _id, field, value }?: {
|
|
1174
449
|
_id: string | ObjectId;
|
|
1175
450
|
field: string;
|
|
1176
451
|
value: string;
|
|
1177
452
|
}, session?: ClientSession) => Promise<string>;
|
|
1178
453
|
deleteById: (_id: string | ObjectId) => Promise<string>;
|
|
1179
|
-
getByName: (name
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
user?: string | undefined;
|
|
1185
|
-
name?: string | undefined;
|
|
1186
|
-
description?: string | undefined;
|
|
1187
|
-
}) => Promise<string>;
|
|
454
|
+
getByName: ({ name, prefix, type }?: {
|
|
455
|
+
name: string;
|
|
456
|
+
prefix?: string | undefined;
|
|
457
|
+
type?: string | undefined;
|
|
458
|
+
}) => Promise<TPSGC | null>;
|
|
1188
459
|
};
|
|
1189
460
|
|
|
1190
|
-
declare function
|
|
1191
|
-
|
|
1192
|
-
getOrgsByUserId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1193
|
-
getByName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
461
|
+
declare function usePSGCController(): {
|
|
462
|
+
add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1194
463
|
getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1195
464
|
getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
465
|
+
getByName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
466
|
+
updateField: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
467
|
+
deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1196
468
|
};
|
|
1197
469
|
|
|
1198
|
-
type
|
|
470
|
+
type TRole = {
|
|
1199
471
|
_id?: ObjectId;
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
roleName?: string;
|
|
1206
|
-
type: string;
|
|
472
|
+
id?: string | ObjectId;
|
|
473
|
+
name?: string;
|
|
474
|
+
description?: string;
|
|
475
|
+
permissions?: Array<string>;
|
|
476
|
+
type?: string;
|
|
1207
477
|
status?: string;
|
|
478
|
+
default?: boolean;
|
|
479
|
+
createdBy?: string | ObjectId;
|
|
1208
480
|
createdAt?: string;
|
|
1209
481
|
updatedAt?: string;
|
|
1210
482
|
deletedAt?: string;
|
|
1211
483
|
};
|
|
1212
|
-
|
|
484
|
+
type TMiniRole = Pick<TRole, "name" | "permissions">;
|
|
485
|
+
declare class MRole implements TRole {
|
|
486
|
+
_id: ObjectId;
|
|
487
|
+
id: string | ObjectId;
|
|
488
|
+
name?: string;
|
|
489
|
+
description?: string;
|
|
490
|
+
permissions?: Array<string>;
|
|
491
|
+
type?: string;
|
|
492
|
+
status?: string;
|
|
493
|
+
default?: boolean;
|
|
494
|
+
createdBy?: string | ObjectId;
|
|
495
|
+
createdAt?: string;
|
|
496
|
+
updatedAt?: string;
|
|
497
|
+
deletedAt?: string;
|
|
498
|
+
constructor(value: TRole);
|
|
499
|
+
}
|
|
1213
500
|
|
|
1214
|
-
declare function
|
|
501
|
+
declare function useRoleRepo(): {
|
|
1215
502
|
createIndex: () => Promise<void>;
|
|
1216
|
-
createUniqueIndex: () => Promise<void>;
|
|
1217
503
|
createTextIndex: () => Promise<void>;
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
search: string;
|
|
1222
|
-
limit: number;
|
|
1223
|
-
page: number;
|
|
1224
|
-
user?: string | ObjectId | undefined;
|
|
1225
|
-
org?: string | ObjectId | undefined;
|
|
1226
|
-
type: string;
|
|
1227
|
-
status: string;
|
|
1228
|
-
}) => Promise<Record<string, any>>;
|
|
1229
|
-
getOrgsByUserId: ({ search, page, limit, sort, user, status, }?: {
|
|
1230
|
-
user: string | ObjectId;
|
|
1231
|
-
page: number;
|
|
1232
|
-
limit?: number | undefined;
|
|
504
|
+
createUniqueIndex: () => Promise<void>;
|
|
505
|
+
addRole: (value: TRole, session?: ClientSession, clearCache?: boolean) => Promise<ObjectId>;
|
|
506
|
+
getRoles: ({ search, page, limit, sort, type, id, }?: {
|
|
1233
507
|
search?: string | undefined;
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
pageRange: string;
|
|
1240
|
-
} | {
|
|
1241
|
-
_id: ObjectId;
|
|
1242
|
-
name: string;
|
|
1243
|
-
}[]>;
|
|
1244
|
-
updateStatusByUserId: (user: string | ObjectId, status: string) => Promise<string>;
|
|
1245
|
-
updateName: (value: Pick<TMember, "name" | "user">, session?: ClientSession) => Promise<string>;
|
|
1246
|
-
getByUserId: (user: string | ObjectId) => Promise<TMember | null>;
|
|
1247
|
-
getOrgsByMembership: ({ search, limit, page, user }?: {
|
|
1248
|
-
search: string;
|
|
1249
|
-
limit: number;
|
|
1250
|
-
page: number;
|
|
1251
|
-
user?: string | ObjectId | undefined;
|
|
508
|
+
page?: number | undefined;
|
|
509
|
+
limit?: number | undefined;
|
|
510
|
+
sort?: any;
|
|
511
|
+
type?: string | undefined;
|
|
512
|
+
id?: string | ObjectId | undefined;
|
|
1252
513
|
}) => Promise<{
|
|
1253
514
|
items: any[];
|
|
1254
515
|
pages: number;
|
|
1255
516
|
pageRange: string;
|
|
1256
|
-
} |
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
517
|
+
} | TRole[]>;
|
|
518
|
+
getRoleByUserId: (value: ObjectId | string) => Promise<TRole | null>;
|
|
519
|
+
getRoleById: (_id: ObjectId | string) => Promise<mongodb.WithId<bson.Document> | TRole | null>;
|
|
520
|
+
getRoleByName: (name: string) => Promise<mongodb.WithId<bson.Document> | TRole | null>;
|
|
521
|
+
updateRole: (_id: string | ObjectId, value: TMiniRole, session?: ClientSession) => Promise<string>;
|
|
522
|
+
deleteRole: (_id: ObjectId | string, session?: ClientSession) => Promise<string>;
|
|
523
|
+
updatePermissionsById: (_id: string | ObjectId, permissions: TRole["permissions"], session?: ClientSession) => Promise<string>;
|
|
524
|
+
delCachedData: () => void;
|
|
1263
525
|
};
|
|
1264
526
|
|
|
1265
|
-
declare function
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
527
|
+
declare function useRoleController(): {
|
|
528
|
+
createRole: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
529
|
+
getRoles: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
530
|
+
getRoleByUserId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
531
|
+
getRoleById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
532
|
+
updateRole: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
533
|
+
deleteRole: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
534
|
+
updatePermissionsById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1271
535
|
};
|
|
1272
536
|
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
max: number;
|
|
1279
|
-
price: number;
|
|
537
|
+
type TUserRole = {
|
|
538
|
+
name: string;
|
|
539
|
+
app: string;
|
|
540
|
+
role: ObjectId | string;
|
|
541
|
+
status?: string;
|
|
1280
542
|
};
|
|
1281
|
-
|
|
543
|
+
declare class MUserRole implements TUserRole {
|
|
544
|
+
name: string;
|
|
545
|
+
app: string;
|
|
546
|
+
role: ObjectId | string;
|
|
547
|
+
status?: string;
|
|
548
|
+
constructor(value: TUserRole);
|
|
549
|
+
}
|
|
550
|
+
type TUser = {
|
|
1282
551
|
_id?: ObjectId;
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
552
|
+
email: string;
|
|
553
|
+
password: string;
|
|
554
|
+
prefix?: string;
|
|
555
|
+
firstName: string;
|
|
556
|
+
middleName?: string;
|
|
557
|
+
lastName: string;
|
|
558
|
+
suffix?: string;
|
|
559
|
+
birthMonth?: string;
|
|
560
|
+
birthDay?: number;
|
|
561
|
+
birthYear?: number;
|
|
562
|
+
gender?: string;
|
|
563
|
+
defaultOrg?: ObjectId | string;
|
|
564
|
+
xenditCustomerId?: string;
|
|
565
|
+
type?: string;
|
|
566
|
+
status?: string;
|
|
567
|
+
referralCode?: string;
|
|
568
|
+
referredBy?: string;
|
|
1289
569
|
createdAt?: string;
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
status?: "active" | "expired" | "disabled";
|
|
1293
|
-
};
|
|
1294
|
-
declare function MPromoCode(data: TPromoCode): TPromoCode;
|
|
1295
|
-
|
|
1296
|
-
declare function usePromoCodeRepo(): {
|
|
1297
|
-
createIndex: () => Promise<void>;
|
|
1298
|
-
createUniqueIndex: () => Promise<void>;
|
|
1299
|
-
add: (value: TPromoCode) => Promise<void>;
|
|
1300
|
-
getByCode: (code: string, type?: string, assigned?: boolean | null) => Promise<TPromoCode | null>;
|
|
1301
|
-
getPromoCodes: ({ search, page, limit, sort, status, type, }?: {
|
|
1302
|
-
search?: string | undefined;
|
|
1303
|
-
page?: number | undefined;
|
|
1304
|
-
limit?: number | undefined;
|
|
1305
|
-
sort?: {} | undefined;
|
|
1306
|
-
status?: string | undefined;
|
|
1307
|
-
type?: string | undefined;
|
|
1308
|
-
}) => Promise<Record<string, any>>;
|
|
1309
|
-
assignByUserId: ({ user, code }?: {
|
|
1310
|
-
user: string | ObjectId;
|
|
1311
|
-
code: string;
|
|
1312
|
-
}, session?: ClientSession) => Promise<void>;
|
|
1313
|
-
getById: (_id: string | ObjectId) => Promise<TPromoCode | null>;
|
|
1314
|
-
};
|
|
1315
|
-
|
|
1316
|
-
declare function usePromoCodeController(): {
|
|
1317
|
-
add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1318
|
-
getByCode: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1319
|
-
getPromoCodes: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1320
|
-
getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1321
|
-
};
|
|
1322
|
-
|
|
1323
|
-
type TOrderMetadata = {
|
|
1324
|
-
subscriptionId?: ObjectId | string;
|
|
1325
|
-
cycle?: number;
|
|
1326
|
-
seats?: number;
|
|
1327
|
-
promoCode?: string;
|
|
570
|
+
updatedAt?: string;
|
|
571
|
+
deletedAt?: string;
|
|
1328
572
|
};
|
|
1329
|
-
|
|
573
|
+
declare class MUser implements TUser {
|
|
1330
574
|
_id?: ObjectId;
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
575
|
+
email: string;
|
|
576
|
+
password: string;
|
|
577
|
+
prefix?: string;
|
|
578
|
+
firstName: string;
|
|
579
|
+
middleName?: string;
|
|
580
|
+
lastName: string;
|
|
581
|
+
suffix?: string;
|
|
582
|
+
birthMonth?: string;
|
|
583
|
+
birthDay?: number;
|
|
584
|
+
birthYear?: number;
|
|
585
|
+
gender?: string;
|
|
586
|
+
roles?: TUserRole[];
|
|
1339
587
|
status?: string;
|
|
588
|
+
type?: string;
|
|
589
|
+
xenditCustomerId?: string | undefined;
|
|
590
|
+
referralCode?: string;
|
|
591
|
+
referredBy?: string;
|
|
1340
592
|
createdAt?: string;
|
|
1341
593
|
updatedAt?: string;
|
|
1342
594
|
deletedAt?: string;
|
|
1343
|
-
|
|
1344
|
-
|
|
595
|
+
defaultOrg?: ObjectId | string;
|
|
596
|
+
constructor(value: TUser);
|
|
597
|
+
}
|
|
1345
598
|
|
|
1346
|
-
declare function
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
599
|
+
declare function useUserRepo(): {
|
|
600
|
+
createTextIndex: () => Promise<void>;
|
|
601
|
+
createUniqueIndex: () => Promise<void>;
|
|
602
|
+
createUser: (value: TUser, session?: ClientSession) => Promise<ObjectId>;
|
|
603
|
+
getUserByEmail: (email: string) => Promise<TUser | null>;
|
|
604
|
+
getUserById: (_id: string | ObjectId) => Promise<TUser | null>;
|
|
605
|
+
getUsers: ({ search, page, limit, sort, status, type, }?: {
|
|
1350
606
|
search?: string | undefined;
|
|
1351
607
|
page?: number | undefined;
|
|
1352
608
|
limit?: number | undefined;
|
|
1353
609
|
sort?: {} | undefined;
|
|
1354
610
|
status?: string | undefined;
|
|
1355
611
|
type?: string | undefined;
|
|
1356
|
-
id?: string | undefined;
|
|
1357
612
|
}) => Promise<Record<string, any>>;
|
|
613
|
+
updatePassword: ({ _id, password }?: {
|
|
614
|
+
_id: string | ObjectId;
|
|
615
|
+
password: string;
|
|
616
|
+
}, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
617
|
+
updateName: ({ _id, firstName, lastName }?: {
|
|
618
|
+
_id: string | ObjectId;
|
|
619
|
+
firstName?: string | undefined;
|
|
620
|
+
lastName?: string | undefined;
|
|
621
|
+
}, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
622
|
+
updateBirthday: ({ _id, month, day, year }?: {
|
|
623
|
+
_id: string | ObjectId;
|
|
624
|
+
month: string;
|
|
625
|
+
day: number;
|
|
626
|
+
year: number;
|
|
627
|
+
}, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
628
|
+
updateUserFieldById: ({ _id, field, value }?: {
|
|
629
|
+
_id: string | ObjectId;
|
|
630
|
+
field: string;
|
|
631
|
+
value: string | ObjectId;
|
|
632
|
+
}, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
633
|
+
addUserRole: ({ _id, role }?: {
|
|
634
|
+
_id: string | ObjectId;
|
|
635
|
+
role: TUserRole;
|
|
636
|
+
}, session?: ClientSession) => Promise<void>;
|
|
637
|
+
getUserByReferralCode: (referralCode: string) => Promise<TUser | null>;
|
|
1358
638
|
};
|
|
1359
639
|
|
|
1360
|
-
declare function
|
|
1361
|
-
|
|
1362
|
-
};
|
|
1363
|
-
|
|
1364
|
-
declare const TInvoice: z.ZodObject<{
|
|
1365
|
-
_id: z.ZodEffects<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<ObjectId, z.ZodTypeDef, ObjectId>]>>, ObjectId | undefined, string | ObjectId | undefined>;
|
|
1366
|
-
invoiceNumber: z.ZodString;
|
|
1367
|
-
type: z.ZodDefault<z.ZodEnum<["organization-subscription", "affiliate-subscription", "one-time-payment", "other"]>>;
|
|
1368
|
-
amount: z.ZodNumber;
|
|
1369
|
-
dueDate: z.ZodDate;
|
|
1370
|
-
status: z.ZodDefault<z.ZodEnum<["pending", "paid", "overdue", "cancelled"]>>;
|
|
1371
|
-
items: z.ZodArray<z.ZodObject<{
|
|
1372
|
-
description: z.ZodString;
|
|
1373
|
-
unitPrice: z.ZodNumber;
|
|
1374
|
-
quantity: z.ZodNumber;
|
|
1375
|
-
seats: z.ZodOptional<z.ZodNumber>;
|
|
1376
|
-
total: z.ZodNumber;
|
|
1377
|
-
}, "strip", z.ZodTypeAny, {
|
|
1378
|
-
description: string;
|
|
1379
|
-
unitPrice: number;
|
|
1380
|
-
quantity: number;
|
|
1381
|
-
total: number;
|
|
1382
|
-
seats?: number | undefined;
|
|
1383
|
-
}, {
|
|
1384
|
-
description: string;
|
|
1385
|
-
unitPrice: number;
|
|
1386
|
-
quantity: number;
|
|
1387
|
-
total: number;
|
|
1388
|
-
seats?: number | undefined;
|
|
1389
|
-
}>, "many">;
|
|
1390
|
-
metadata: z.ZodEffects<z.ZodOptional<z.ZodDefault<z.ZodObject<{
|
|
1391
|
-
transactionId: z.ZodOptional<z.ZodString>;
|
|
1392
|
-
userId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<ObjectId, z.ZodTypeDef, ObjectId>]>>;
|
|
1393
|
-
orgId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<ObjectId, z.ZodTypeDef, ObjectId>]>>;
|
|
1394
|
-
billingCycle: z.ZodOptional<z.ZodEnum<["monthly", "yearly", "quarterly"]>>;
|
|
1395
|
-
subscriptionId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<ObjectId, z.ZodTypeDef, ObjectId>]>>;
|
|
1396
|
-
currency: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
1397
|
-
description: z.ZodOptional<z.ZodString>;
|
|
1398
|
-
}, "strip", z.ZodTypeAny, {
|
|
1399
|
-
description?: string | undefined;
|
|
1400
|
-
userId?: string | ObjectId | undefined;
|
|
1401
|
-
orgId?: string | ObjectId | undefined;
|
|
1402
|
-
transactionId?: string | undefined;
|
|
1403
|
-
currency?: string | undefined;
|
|
1404
|
-
subscriptionId?: string | ObjectId | undefined;
|
|
1405
|
-
billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
|
|
1406
|
-
}, {
|
|
1407
|
-
description?: string | undefined;
|
|
1408
|
-
userId?: string | ObjectId | undefined;
|
|
1409
|
-
orgId?: string | ObjectId | undefined;
|
|
1410
|
-
transactionId?: string | undefined;
|
|
1411
|
-
currency?: string | undefined;
|
|
1412
|
-
subscriptionId?: string | ObjectId | undefined;
|
|
1413
|
-
billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
|
|
1414
|
-
}>>>, {
|
|
1415
|
-
description?: string | undefined;
|
|
1416
|
-
userId?: string | ObjectId | undefined;
|
|
1417
|
-
orgId?: string | ObjectId | undefined;
|
|
1418
|
-
transactionId?: string | undefined;
|
|
1419
|
-
currency?: string | undefined;
|
|
1420
|
-
subscriptionId?: string | ObjectId | undefined;
|
|
1421
|
-
billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
|
|
1422
|
-
} | undefined, {
|
|
1423
|
-
description?: string | undefined;
|
|
1424
|
-
userId?: string | ObjectId | undefined;
|
|
1425
|
-
orgId?: string | ObjectId | undefined;
|
|
1426
|
-
transactionId?: string | undefined;
|
|
1427
|
-
currency?: string | undefined;
|
|
1428
|
-
subscriptionId?: string | ObjectId | undefined;
|
|
1429
|
-
billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
|
|
1430
|
-
} | undefined>;
|
|
1431
|
-
createdAt: z.ZodOptional<z.ZodDefault<z.ZodDate>>;
|
|
1432
|
-
updatedAt: z.ZodOptional<z.ZodDate>;
|
|
1433
|
-
}, "strip", z.ZodTypeAny, {
|
|
1434
|
-
type: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other";
|
|
1435
|
-
status: "pending" | "cancelled" | "paid" | "overdue";
|
|
1436
|
-
items: {
|
|
1437
|
-
description: string;
|
|
1438
|
-
unitPrice: number;
|
|
1439
|
-
quantity: number;
|
|
1440
|
-
total: number;
|
|
1441
|
-
seats?: number | undefined;
|
|
1442
|
-
}[];
|
|
1443
|
-
amount: number;
|
|
1444
|
-
invoiceNumber: string;
|
|
1445
|
-
dueDate: Date;
|
|
1446
|
-
_id?: ObjectId | undefined;
|
|
1447
|
-
updatedAt?: Date | undefined;
|
|
1448
|
-
createdAt?: Date | undefined;
|
|
1449
|
-
metadata?: {
|
|
1450
|
-
description?: string | undefined;
|
|
1451
|
-
userId?: string | ObjectId | undefined;
|
|
1452
|
-
orgId?: string | ObjectId | undefined;
|
|
1453
|
-
transactionId?: string | undefined;
|
|
1454
|
-
currency?: string | undefined;
|
|
1455
|
-
subscriptionId?: string | ObjectId | undefined;
|
|
1456
|
-
billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
|
|
1457
|
-
} | undefined;
|
|
1458
|
-
}, {
|
|
1459
|
-
items: {
|
|
1460
|
-
description: string;
|
|
1461
|
-
unitPrice: number;
|
|
1462
|
-
quantity: number;
|
|
1463
|
-
total: number;
|
|
1464
|
-
seats?: number | undefined;
|
|
1465
|
-
}[];
|
|
1466
|
-
amount: number;
|
|
1467
|
-
invoiceNumber: string;
|
|
1468
|
-
dueDate: Date;
|
|
1469
|
-
type?: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other" | undefined;
|
|
1470
|
-
status?: "pending" | "cancelled" | "paid" | "overdue" | undefined;
|
|
1471
|
-
_id?: string | ObjectId | undefined;
|
|
1472
|
-
updatedAt?: Date | undefined;
|
|
1473
|
-
createdAt?: Date | undefined;
|
|
1474
|
-
metadata?: {
|
|
1475
|
-
description?: string | undefined;
|
|
1476
|
-
userId?: string | ObjectId | undefined;
|
|
1477
|
-
orgId?: string | ObjectId | undefined;
|
|
1478
|
-
transactionId?: string | undefined;
|
|
1479
|
-
currency?: string | undefined;
|
|
1480
|
-
subscriptionId?: string | ObjectId | undefined;
|
|
1481
|
-
billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
|
|
1482
|
-
} | undefined;
|
|
1483
|
-
}>;
|
|
1484
|
-
type TInvoice = z.infer<typeof TInvoice>;
|
|
1485
|
-
declare function useInvoiceModel(db: Db): {
|
|
1486
|
-
createInvoice: (data: TInvoice) => TInvoice;
|
|
1487
|
-
collection: Collection<{
|
|
1488
|
-
type: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other";
|
|
1489
|
-
status: "pending" | "cancelled" | "paid" | "overdue";
|
|
1490
|
-
items: {
|
|
1491
|
-
description: string;
|
|
1492
|
-
unitPrice: number;
|
|
1493
|
-
quantity: number;
|
|
1494
|
-
total: number;
|
|
1495
|
-
seats?: number | undefined;
|
|
1496
|
-
}[];
|
|
1497
|
-
amount: number;
|
|
1498
|
-
invoiceNumber: string;
|
|
1499
|
-
dueDate: Date;
|
|
1500
|
-
_id?: ObjectId | undefined;
|
|
1501
|
-
updatedAt?: Date | undefined;
|
|
1502
|
-
createdAt?: Date | undefined;
|
|
1503
|
-
metadata?: {
|
|
1504
|
-
description?: string | undefined;
|
|
1505
|
-
userId?: string | ObjectId | undefined;
|
|
1506
|
-
orgId?: string | ObjectId | undefined;
|
|
1507
|
-
transactionId?: string | undefined;
|
|
1508
|
-
currency?: string | undefined;
|
|
1509
|
-
subscriptionId?: string | ObjectId | undefined;
|
|
1510
|
-
billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
|
|
1511
|
-
} | undefined;
|
|
1512
|
-
}>;
|
|
1513
|
-
};
|
|
1514
|
-
|
|
1515
|
-
declare function useInvoiceRepo(): {
|
|
1516
|
-
createIndex: () => Promise<void>;
|
|
1517
|
-
createUniqueIndex: () => Promise<void>;
|
|
1518
|
-
add: (value: TInvoice, session?: ClientSession) => Promise<void>;
|
|
1519
|
-
getByDueDate: (id: string | ObjectId, dueDate: Date, status?: TInvoice["status"]) => Promise<{
|
|
1520
|
-
type: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other";
|
|
1521
|
-
status: "pending" | "cancelled" | "paid" | "overdue";
|
|
1522
|
-
items: {
|
|
1523
|
-
description: string;
|
|
1524
|
-
unitPrice: number;
|
|
1525
|
-
quantity: number;
|
|
1526
|
-
total: number;
|
|
1527
|
-
seats?: number | undefined;
|
|
1528
|
-
}[];
|
|
1529
|
-
amount: number;
|
|
1530
|
-
invoiceNumber: string;
|
|
1531
|
-
dueDate: Date;
|
|
1532
|
-
_id?: ObjectId | undefined;
|
|
1533
|
-
updatedAt?: Date | undefined;
|
|
1534
|
-
createdAt?: Date | undefined;
|
|
1535
|
-
metadata?: {
|
|
1536
|
-
description?: string | undefined;
|
|
1537
|
-
userId?: string | ObjectId | undefined;
|
|
1538
|
-
orgId?: string | ObjectId | undefined;
|
|
1539
|
-
transactionId?: string | undefined;
|
|
1540
|
-
currency?: string | undefined;
|
|
1541
|
-
subscriptionId?: string | ObjectId | undefined;
|
|
1542
|
-
billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
|
|
1543
|
-
} | undefined;
|
|
1544
|
-
} | null>;
|
|
1545
|
-
updateStatusByInvoiceNumber: (invoiceNumber: string, status: TInvoice["status"], session?: ClientSession) => Promise<void>;
|
|
1546
|
-
getOverdueInvoices: (BATCH_SIZE?: number) => Promise<{
|
|
1547
|
-
type: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other";
|
|
1548
|
-
status: "pending" | "cancelled" | "paid" | "overdue";
|
|
1549
|
-
items: {
|
|
1550
|
-
description: string;
|
|
1551
|
-
unitPrice: number;
|
|
1552
|
-
quantity: number;
|
|
1553
|
-
total: number;
|
|
1554
|
-
seats?: number | undefined;
|
|
1555
|
-
}[];
|
|
1556
|
-
amount: number;
|
|
1557
|
-
invoiceNumber: string;
|
|
1558
|
-
dueDate: Date;
|
|
1559
|
-
_id?: ObjectId | undefined;
|
|
1560
|
-
updatedAt?: Date | undefined;
|
|
1561
|
-
createdAt?: Date | undefined;
|
|
1562
|
-
metadata?: {
|
|
1563
|
-
description?: string | undefined;
|
|
1564
|
-
userId?: string | ObjectId | undefined;
|
|
1565
|
-
orgId?: string | ObjectId | undefined;
|
|
1566
|
-
transactionId?: string | undefined;
|
|
1567
|
-
currency?: string | undefined;
|
|
1568
|
-
subscriptionId?: string | ObjectId | undefined;
|
|
1569
|
-
billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
|
|
1570
|
-
} | undefined;
|
|
1571
|
-
}[]>;
|
|
1572
|
-
getBySubscriptionId: ({ page, search, limit, sort, id }?: {
|
|
1573
|
-
page?: number | undefined;
|
|
640
|
+
declare function useUserService(): {
|
|
641
|
+
getUsers: ({ search, page, status, type, limit, }?: {
|
|
1574
642
|
search?: string | undefined;
|
|
643
|
+
page?: number | undefined;
|
|
644
|
+
status?: string | undefined;
|
|
645
|
+
type?: string | undefined;
|
|
1575
646
|
limit?: number | undefined;
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
currency?: string | undefined;
|
|
1605
|
-
subscriptionId?: string | ObjectId | undefined;
|
|
1606
|
-
billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
|
|
1607
|
-
} | undefined;
|
|
1608
|
-
} | null>;
|
|
1609
|
-
getByTransactionId: (id: string) => Promise<{
|
|
1610
|
-
type: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other";
|
|
1611
|
-
status: "pending" | "cancelled" | "paid" | "overdue";
|
|
1612
|
-
items: {
|
|
1613
|
-
description: string;
|
|
1614
|
-
unitPrice: number;
|
|
1615
|
-
quantity: number;
|
|
1616
|
-
total: number;
|
|
1617
|
-
seats?: number | undefined;
|
|
1618
|
-
}[];
|
|
1619
|
-
amount: number;
|
|
1620
|
-
invoiceNumber: string;
|
|
1621
|
-
dueDate: Date;
|
|
1622
|
-
_id?: ObjectId | undefined;
|
|
1623
|
-
updatedAt?: Date | undefined;
|
|
1624
|
-
createdAt?: Date | undefined;
|
|
1625
|
-
metadata?: {
|
|
1626
|
-
description?: string | undefined;
|
|
1627
|
-
userId?: string | ObjectId | undefined;
|
|
1628
|
-
orgId?: string | ObjectId | undefined;
|
|
1629
|
-
transactionId?: string | undefined;
|
|
1630
|
-
currency?: string | undefined;
|
|
1631
|
-
subscriptionId?: string | ObjectId | undefined;
|
|
1632
|
-
billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
|
|
1633
|
-
} | undefined;
|
|
1634
|
-
} | null>;
|
|
1635
|
-
};
|
|
1636
|
-
|
|
1637
|
-
declare function useInvoiceService(): {
|
|
1638
|
-
processOverDueInvoices: (BATCH_SIZE?: number, MAX_RETRIES?: number) => Promise<void>;
|
|
1639
|
-
paypalPaidInvoiceWebhookHandler: (invoiceId: string) => Promise<"Payment processed successfully." | undefined>;
|
|
1640
|
-
};
|
|
1641
|
-
|
|
1642
|
-
declare function useInvoiceController(): {
|
|
1643
|
-
getBySubscriptionId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1644
|
-
getByNumber: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1645
|
-
getByDueDateStatus: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1646
|
-
paidInvoiceWebhookHandler: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
647
|
+
}) => Promise<Record<string, any>>;
|
|
648
|
+
createUser: (value: Pick<TUser, "prefix" | "firstName" | "middleName" | "lastName" | "email" | "password" | "suffix">) => Promise<ObjectId>;
|
|
649
|
+
resetPassword: (id: string, newPassword: string, passwordConfirmation: string) => Promise<string>;
|
|
650
|
+
updateName: (_id: string, firstName?: string, lastName?: string) => Promise<string>;
|
|
651
|
+
updateBirthday: (_id: string, month: string, day: number, year: number) => Promise<string>;
|
|
652
|
+
updateUserFieldById: ({ _id, field, value }?: {
|
|
653
|
+
_id: string;
|
|
654
|
+
field: string;
|
|
655
|
+
value: string;
|
|
656
|
+
}) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
657
|
+
updateUserProfile: ({ file, user, previousProfile }?: {
|
|
658
|
+
file: Express.Multer.File;
|
|
659
|
+
user: string;
|
|
660
|
+
previousProfile?: string | undefined;
|
|
661
|
+
}) => Promise<string>;
|
|
662
|
+
createUserByInvite: ({ id, firstName, lastName, password, }?: {
|
|
663
|
+
id?: string | undefined;
|
|
664
|
+
firstName?: string | undefined;
|
|
665
|
+
lastName?: string | undefined;
|
|
666
|
+
password?: string | undefined;
|
|
667
|
+
}) => Promise<string | ObjectId>;
|
|
668
|
+
createUserBySignUp: ({ id, firstName, lastName, password, }?: {
|
|
669
|
+
id?: string | undefined;
|
|
670
|
+
firstName?: string | undefined;
|
|
671
|
+
lastName?: string | undefined;
|
|
672
|
+
password?: string | undefined;
|
|
673
|
+
}) => Promise<ObjectId>;
|
|
674
|
+
createDefaultUser: () => Promise<string>;
|
|
1647
675
|
};
|
|
1648
676
|
|
|
1649
|
-
declare
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
metadata: z.ZodEffects<z.ZodObject<{
|
|
1658
|
-
userId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<ObjectId, z.ZodTypeDef, ObjectId>]>>;
|
|
1659
|
-
orgId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<ObjectId, z.ZodTypeDef, ObjectId>]>>;
|
|
1660
|
-
transactionId: z.ZodOptional<z.ZodString>;
|
|
1661
|
-
currency: z.ZodDefault<z.ZodString>;
|
|
1662
|
-
paymentMethod: z.ZodOptional<z.ZodString>;
|
|
1663
|
-
paymentMethodType: z.ZodOptional<z.ZodString>;
|
|
1664
|
-
paymentMethodId: z.ZodOptional<z.ZodString>;
|
|
1665
|
-
payment: z.ZodOptional<z.ZodString>;
|
|
1666
|
-
subscriptionId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<ObjectId, z.ZodTypeDef, ObjectId>]>>;
|
|
1667
|
-
}, "strip", z.ZodTypeAny, {
|
|
1668
|
-
currency: string;
|
|
1669
|
-
userId?: string | ObjectId | undefined;
|
|
1670
|
-
orgId?: string | ObjectId | undefined;
|
|
1671
|
-
transactionId?: string | undefined;
|
|
1672
|
-
paymentMethod?: string | undefined;
|
|
1673
|
-
paymentMethodType?: string | undefined;
|
|
1674
|
-
paymentMethodId?: string | undefined;
|
|
1675
|
-
payment?: string | undefined;
|
|
1676
|
-
subscriptionId?: string | ObjectId | undefined;
|
|
1677
|
-
}, {
|
|
1678
|
-
userId?: string | ObjectId | undefined;
|
|
1679
|
-
orgId?: string | ObjectId | undefined;
|
|
1680
|
-
transactionId?: string | undefined;
|
|
1681
|
-
currency?: string | undefined;
|
|
1682
|
-
paymentMethod?: string | undefined;
|
|
1683
|
-
paymentMethodType?: string | undefined;
|
|
1684
|
-
paymentMethodId?: string | undefined;
|
|
1685
|
-
payment?: string | undefined;
|
|
1686
|
-
subscriptionId?: string | ObjectId | undefined;
|
|
1687
|
-
}>, {
|
|
1688
|
-
currency: string;
|
|
1689
|
-
userId?: string | ObjectId | undefined;
|
|
1690
|
-
orgId?: string | ObjectId | undefined;
|
|
1691
|
-
transactionId?: string | undefined;
|
|
1692
|
-
paymentMethod?: string | undefined;
|
|
1693
|
-
paymentMethodType?: string | undefined;
|
|
1694
|
-
paymentMethodId?: string | undefined;
|
|
1695
|
-
payment?: string | undefined;
|
|
1696
|
-
subscriptionId?: string | ObjectId | undefined;
|
|
1697
|
-
}, {
|
|
1698
|
-
userId?: string | ObjectId | undefined;
|
|
1699
|
-
orgId?: string | ObjectId | undefined;
|
|
1700
|
-
transactionId?: string | undefined;
|
|
1701
|
-
currency?: string | undefined;
|
|
1702
|
-
paymentMethod?: string | undefined;
|
|
1703
|
-
paymentMethodType?: string | undefined;
|
|
1704
|
-
paymentMethodId?: string | undefined;
|
|
1705
|
-
payment?: string | undefined;
|
|
1706
|
-
subscriptionId?: string | ObjectId | undefined;
|
|
1707
|
-
}>;
|
|
1708
|
-
createdAt: z.ZodOptional<z.ZodDefault<z.ZodDate>>;
|
|
1709
|
-
updatedAt: z.ZodOptional<z.ZodDate>;
|
|
1710
|
-
}, "strip", z.ZodTypeAny, {
|
|
1711
|
-
status: "pending" | "completed" | "failed" | "refunded";
|
|
1712
|
-
metadata: {
|
|
1713
|
-
currency: string;
|
|
1714
|
-
userId?: string | ObjectId | undefined;
|
|
1715
|
-
orgId?: string | ObjectId | undefined;
|
|
1716
|
-
transactionId?: string | undefined;
|
|
1717
|
-
paymentMethod?: string | undefined;
|
|
1718
|
-
paymentMethodType?: string | undefined;
|
|
1719
|
-
paymentMethodId?: string | undefined;
|
|
1720
|
-
payment?: string | undefined;
|
|
1721
|
-
subscriptionId?: string | ObjectId | undefined;
|
|
1722
|
-
};
|
|
1723
|
-
paymentMethod: "EWALLET" | "QR_CODE" | "CARD" | "DIRECT_DEBIT" | "VIRTUAL_ACCOUNT" | "OVER_THE_COUNTER" | "PAYPAL";
|
|
1724
|
-
invoiceId: string;
|
|
1725
|
-
amount: number;
|
|
1726
|
-
_id?: string | ObjectId | undefined;
|
|
1727
|
-
updatedAt?: Date | undefined;
|
|
1728
|
-
createdAt?: Date | undefined;
|
|
1729
|
-
}, {
|
|
1730
|
-
status: "pending" | "completed" | "failed" | "refunded";
|
|
1731
|
-
metadata: {
|
|
1732
|
-
userId?: string | ObjectId | undefined;
|
|
1733
|
-
orgId?: string | ObjectId | undefined;
|
|
1734
|
-
transactionId?: string | undefined;
|
|
1735
|
-
currency?: string | undefined;
|
|
1736
|
-
paymentMethod?: string | undefined;
|
|
1737
|
-
paymentMethodType?: string | undefined;
|
|
1738
|
-
paymentMethodId?: string | undefined;
|
|
1739
|
-
payment?: string | undefined;
|
|
1740
|
-
subscriptionId?: string | ObjectId | undefined;
|
|
1741
|
-
};
|
|
1742
|
-
paymentMethod: "EWALLET" | "QR_CODE" | "CARD" | "DIRECT_DEBIT" | "VIRTUAL_ACCOUNT" | "OVER_THE_COUNTER" | "PAYPAL";
|
|
1743
|
-
amount: number;
|
|
1744
|
-
_id?: string | ObjectId | undefined;
|
|
1745
|
-
updatedAt?: Date | undefined;
|
|
1746
|
-
createdAt?: Date | undefined;
|
|
1747
|
-
invoiceId?: string | undefined;
|
|
1748
|
-
}>;
|
|
1749
|
-
type TPayment = z.infer<typeof TPayment>;
|
|
1750
|
-
declare const DirectDebitSchema: z.ZodObject<{
|
|
1751
|
-
type: z.ZodLiteral<"DIRECT_DEBIT">;
|
|
1752
|
-
direct_debit: z.ZodObject<{
|
|
1753
|
-
channel_code: z.ZodString;
|
|
1754
|
-
channel_properties: z.ZodObject<{
|
|
1755
|
-
success_return_url: z.ZodString;
|
|
1756
|
-
failure_return_url: z.ZodString;
|
|
1757
|
-
}, "strip", z.ZodTypeAny, {
|
|
1758
|
-
success_return_url: string;
|
|
1759
|
-
failure_return_url: string;
|
|
1760
|
-
}, {
|
|
1761
|
-
success_return_url: string;
|
|
1762
|
-
failure_return_url: string;
|
|
1763
|
-
}>;
|
|
1764
|
-
}, "strip", z.ZodTypeAny, {
|
|
1765
|
-
channel_code: string;
|
|
1766
|
-
channel_properties: {
|
|
1767
|
-
success_return_url: string;
|
|
1768
|
-
failure_return_url: string;
|
|
1769
|
-
};
|
|
1770
|
-
}, {
|
|
1771
|
-
channel_code: string;
|
|
1772
|
-
channel_properties: {
|
|
1773
|
-
success_return_url: string;
|
|
1774
|
-
failure_return_url: string;
|
|
1775
|
-
};
|
|
1776
|
-
}>;
|
|
1777
|
-
reusability: z.ZodEnum<["MULTIPLE_USE", "SINGLE_USE"]>;
|
|
1778
|
-
description: z.ZodOptional<z.ZodString>;
|
|
1779
|
-
metadata: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
1780
|
-
customer_id: z.ZodString;
|
|
1781
|
-
}, "strip", z.ZodTypeAny, {
|
|
1782
|
-
type: "DIRECT_DEBIT";
|
|
1783
|
-
metadata: Record<string, string>;
|
|
1784
|
-
direct_debit: {
|
|
1785
|
-
channel_code: string;
|
|
1786
|
-
channel_properties: {
|
|
1787
|
-
success_return_url: string;
|
|
1788
|
-
failure_return_url: string;
|
|
1789
|
-
};
|
|
1790
|
-
};
|
|
1791
|
-
reusability: "MULTIPLE_USE" | "SINGLE_USE";
|
|
1792
|
-
customer_id: string;
|
|
1793
|
-
description?: string | undefined;
|
|
1794
|
-
}, {
|
|
1795
|
-
type: "DIRECT_DEBIT";
|
|
1796
|
-
direct_debit: {
|
|
1797
|
-
channel_code: string;
|
|
1798
|
-
channel_properties: {
|
|
1799
|
-
success_return_url: string;
|
|
1800
|
-
failure_return_url: string;
|
|
1801
|
-
};
|
|
1802
|
-
};
|
|
1803
|
-
reusability: "MULTIPLE_USE" | "SINGLE_USE";
|
|
1804
|
-
customer_id: string;
|
|
1805
|
-
metadata?: Record<string, string> | undefined;
|
|
1806
|
-
description?: string | undefined;
|
|
1807
|
-
}>;
|
|
1808
|
-
type DirectDebit = z.infer<typeof DirectDebitSchema>;
|
|
1809
|
-
declare function validateDirectDebit(data: Record<string, any>): DirectDebit;
|
|
1810
|
-
declare const CardPaymentSchema: z.ZodObject<{
|
|
1811
|
-
type: z.ZodLiteral<"CARD">;
|
|
1812
|
-
card: z.ZodObject<{
|
|
1813
|
-
currency: z.ZodLiteral<"PHP">;
|
|
1814
|
-
channel_properties: z.ZodObject<{
|
|
1815
|
-
skip_three_d_secure: z.ZodBoolean;
|
|
1816
|
-
success_return_url: z.ZodString;
|
|
1817
|
-
failure_return_url: z.ZodString;
|
|
1818
|
-
}, "strip", z.ZodTypeAny, {
|
|
1819
|
-
success_return_url: string;
|
|
1820
|
-
failure_return_url: string;
|
|
1821
|
-
skip_three_d_secure: boolean;
|
|
1822
|
-
}, {
|
|
1823
|
-
success_return_url: string;
|
|
1824
|
-
failure_return_url: string;
|
|
1825
|
-
skip_three_d_secure: boolean;
|
|
1826
|
-
}>;
|
|
1827
|
-
card_information: z.ZodObject<{
|
|
1828
|
-
card_number: z.ZodString;
|
|
1829
|
-
expiry_month: z.ZodString;
|
|
1830
|
-
expiry_year: z.ZodString;
|
|
1831
|
-
cvv: z.ZodString;
|
|
1832
|
-
cardholder_name: z.ZodString;
|
|
1833
|
-
}, "strip", z.ZodTypeAny, {
|
|
1834
|
-
card_number: string;
|
|
1835
|
-
expiry_month: string;
|
|
1836
|
-
expiry_year: string;
|
|
1837
|
-
cvv: string;
|
|
1838
|
-
cardholder_name: string;
|
|
1839
|
-
}, {
|
|
1840
|
-
card_number: string;
|
|
1841
|
-
expiry_month: string;
|
|
1842
|
-
expiry_year: string;
|
|
1843
|
-
cvv: string;
|
|
1844
|
-
cardholder_name: string;
|
|
1845
|
-
}>;
|
|
1846
|
-
}, "strip", z.ZodTypeAny, {
|
|
1847
|
-
currency: "PHP";
|
|
1848
|
-
channel_properties: {
|
|
1849
|
-
success_return_url: string;
|
|
1850
|
-
failure_return_url: string;
|
|
1851
|
-
skip_three_d_secure: boolean;
|
|
1852
|
-
};
|
|
1853
|
-
card_information: {
|
|
1854
|
-
card_number: string;
|
|
1855
|
-
expiry_month: string;
|
|
1856
|
-
expiry_year: string;
|
|
1857
|
-
cvv: string;
|
|
1858
|
-
cardholder_name: string;
|
|
1859
|
-
};
|
|
1860
|
-
}, {
|
|
1861
|
-
currency: "PHP";
|
|
1862
|
-
channel_properties: {
|
|
1863
|
-
success_return_url: string;
|
|
1864
|
-
failure_return_url: string;
|
|
1865
|
-
skip_three_d_secure: boolean;
|
|
1866
|
-
};
|
|
1867
|
-
card_information: {
|
|
1868
|
-
card_number: string;
|
|
1869
|
-
expiry_month: string;
|
|
1870
|
-
expiry_year: string;
|
|
1871
|
-
cvv: string;
|
|
1872
|
-
cardholder_name: string;
|
|
1873
|
-
};
|
|
1874
|
-
}>;
|
|
1875
|
-
reusability: z.ZodEnum<["MULTIPLE_USE", "SINGLE_USE"]>;
|
|
1876
|
-
description: z.ZodOptional<z.ZodString>;
|
|
1877
|
-
metadata: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
1878
|
-
}, "strip", z.ZodTypeAny, {
|
|
1879
|
-
type: "CARD";
|
|
1880
|
-
metadata: Record<string, string>;
|
|
1881
|
-
reusability: "MULTIPLE_USE" | "SINGLE_USE";
|
|
1882
|
-
card: {
|
|
1883
|
-
currency: "PHP";
|
|
1884
|
-
channel_properties: {
|
|
1885
|
-
success_return_url: string;
|
|
1886
|
-
failure_return_url: string;
|
|
1887
|
-
skip_three_d_secure: boolean;
|
|
1888
|
-
};
|
|
1889
|
-
card_information: {
|
|
1890
|
-
card_number: string;
|
|
1891
|
-
expiry_month: string;
|
|
1892
|
-
expiry_year: string;
|
|
1893
|
-
cvv: string;
|
|
1894
|
-
cardholder_name: string;
|
|
1895
|
-
};
|
|
1896
|
-
};
|
|
1897
|
-
description?: string | undefined;
|
|
1898
|
-
}, {
|
|
1899
|
-
type: "CARD";
|
|
1900
|
-
reusability: "MULTIPLE_USE" | "SINGLE_USE";
|
|
1901
|
-
card: {
|
|
1902
|
-
currency: "PHP";
|
|
1903
|
-
channel_properties: {
|
|
1904
|
-
success_return_url: string;
|
|
1905
|
-
failure_return_url: string;
|
|
1906
|
-
skip_three_d_secure: boolean;
|
|
1907
|
-
};
|
|
1908
|
-
card_information: {
|
|
1909
|
-
card_number: string;
|
|
1910
|
-
expiry_month: string;
|
|
1911
|
-
expiry_year: string;
|
|
1912
|
-
cvv: string;
|
|
1913
|
-
cardholder_name: string;
|
|
1914
|
-
};
|
|
1915
|
-
};
|
|
1916
|
-
metadata?: Record<string, string> | undefined;
|
|
1917
|
-
description?: string | undefined;
|
|
1918
|
-
}>;
|
|
1919
|
-
type CardPayment = z.infer<typeof CardPaymentSchema>;
|
|
1920
|
-
declare function validateCardPayment(data: Record<string, any>): CardPayment;
|
|
1921
|
-
declare const EWalletPaymentSchema: z.ZodObject<{
|
|
1922
|
-
type: z.ZodLiteral<"EWALLET">;
|
|
1923
|
-
reusability: z.ZodEnum<["MULTIPLE_USE", "SINGLE_USE"]>;
|
|
1924
|
-
customer_id: z.ZodString;
|
|
1925
|
-
country: z.ZodString;
|
|
1926
|
-
ewallet: z.ZodObject<{
|
|
1927
|
-
channel_code: z.ZodString;
|
|
1928
|
-
channel_properties: z.ZodObject<{
|
|
1929
|
-
success_return_url: z.ZodString;
|
|
1930
|
-
failure_return_url: z.ZodString;
|
|
1931
|
-
cancel_return_url: z.ZodString;
|
|
1932
|
-
}, "strip", z.ZodTypeAny, {
|
|
1933
|
-
success_return_url: string;
|
|
1934
|
-
failure_return_url: string;
|
|
1935
|
-
cancel_return_url: string;
|
|
1936
|
-
}, {
|
|
1937
|
-
success_return_url: string;
|
|
1938
|
-
failure_return_url: string;
|
|
1939
|
-
cancel_return_url: string;
|
|
1940
|
-
}>;
|
|
1941
|
-
}, "strip", z.ZodTypeAny, {
|
|
1942
|
-
channel_code: string;
|
|
1943
|
-
channel_properties: {
|
|
1944
|
-
success_return_url: string;
|
|
1945
|
-
failure_return_url: string;
|
|
1946
|
-
cancel_return_url: string;
|
|
1947
|
-
};
|
|
1948
|
-
}, {
|
|
1949
|
-
channel_code: string;
|
|
1950
|
-
channel_properties: {
|
|
1951
|
-
success_return_url: string;
|
|
1952
|
-
failure_return_url: string;
|
|
1953
|
-
cancel_return_url: string;
|
|
1954
|
-
};
|
|
1955
|
-
}>;
|
|
1956
|
-
description: z.ZodOptional<z.ZodString>;
|
|
1957
|
-
metadata: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
1958
|
-
}, "strip", z.ZodTypeAny, {
|
|
1959
|
-
type: "EWALLET";
|
|
1960
|
-
metadata: Record<string, string>;
|
|
1961
|
-
country: string;
|
|
1962
|
-
reusability: "MULTIPLE_USE" | "SINGLE_USE";
|
|
1963
|
-
customer_id: string;
|
|
1964
|
-
ewallet: {
|
|
1965
|
-
channel_code: string;
|
|
1966
|
-
channel_properties: {
|
|
1967
|
-
success_return_url: string;
|
|
1968
|
-
failure_return_url: string;
|
|
1969
|
-
cancel_return_url: string;
|
|
1970
|
-
};
|
|
1971
|
-
};
|
|
1972
|
-
description?: string | undefined;
|
|
1973
|
-
}, {
|
|
1974
|
-
type: "EWALLET";
|
|
1975
|
-
country: string;
|
|
1976
|
-
reusability: "MULTIPLE_USE" | "SINGLE_USE";
|
|
1977
|
-
customer_id: string;
|
|
1978
|
-
ewallet: {
|
|
1979
|
-
channel_code: string;
|
|
1980
|
-
channel_properties: {
|
|
1981
|
-
success_return_url: string;
|
|
1982
|
-
failure_return_url: string;
|
|
1983
|
-
cancel_return_url: string;
|
|
1984
|
-
};
|
|
1985
|
-
};
|
|
1986
|
-
metadata?: Record<string, string> | undefined;
|
|
1987
|
-
description?: string | undefined;
|
|
1988
|
-
}>;
|
|
1989
|
-
type EWalletPayment = z.infer<typeof EWalletPaymentSchema>;
|
|
1990
|
-
declare function validateEWalletPayment(data: Record<string, any>): EWalletPayment;
|
|
1991
|
-
declare function usePaymentModel(db: Db): {
|
|
1992
|
-
collection: Collection<{
|
|
1993
|
-
status: "pending" | "completed" | "failed" | "refunded";
|
|
1994
|
-
metadata: {
|
|
1995
|
-
currency: string;
|
|
1996
|
-
userId?: string | ObjectId | undefined;
|
|
1997
|
-
orgId?: string | ObjectId | undefined;
|
|
1998
|
-
transactionId?: string | undefined;
|
|
1999
|
-
paymentMethod?: string | undefined;
|
|
2000
|
-
paymentMethodType?: string | undefined;
|
|
2001
|
-
paymentMethodId?: string | undefined;
|
|
2002
|
-
payment?: string | undefined;
|
|
2003
|
-
subscriptionId?: string | ObjectId | undefined;
|
|
2004
|
-
};
|
|
2005
|
-
paymentMethod: "EWALLET" | "QR_CODE" | "CARD" | "DIRECT_DEBIT" | "VIRTUAL_ACCOUNT" | "OVER_THE_COUNTER" | "PAYPAL";
|
|
2006
|
-
invoiceId: string;
|
|
2007
|
-
amount: number;
|
|
2008
|
-
_id?: string | ObjectId | undefined;
|
|
2009
|
-
updatedAt?: Date | undefined;
|
|
2010
|
-
createdAt?: Date | undefined;
|
|
2011
|
-
}>;
|
|
2012
|
-
createPayment: (data: Partial<TPayment>) => {
|
|
2013
|
-
status: "pending" | "completed" | "failed" | "refunded";
|
|
2014
|
-
metadata: {
|
|
2015
|
-
currency: string;
|
|
2016
|
-
userId?: string | ObjectId | undefined;
|
|
2017
|
-
orgId?: string | ObjectId | undefined;
|
|
2018
|
-
transactionId?: string | undefined;
|
|
2019
|
-
paymentMethod?: string | undefined;
|
|
2020
|
-
paymentMethodType?: string | undefined;
|
|
2021
|
-
paymentMethodId?: string | undefined;
|
|
2022
|
-
payment?: string | undefined;
|
|
2023
|
-
subscriptionId?: string | ObjectId | undefined;
|
|
2024
|
-
};
|
|
2025
|
-
paymentMethod: "EWALLET" | "QR_CODE" | "CARD" | "DIRECT_DEBIT" | "VIRTUAL_ACCOUNT" | "OVER_THE_COUNTER" | "PAYPAL";
|
|
2026
|
-
invoiceId: string;
|
|
2027
|
-
amount: number;
|
|
2028
|
-
_id?: string | ObjectId | undefined;
|
|
2029
|
-
updatedAt?: Date | undefined;
|
|
2030
|
-
createdAt?: Date | undefined;
|
|
2031
|
-
};
|
|
2032
|
-
validatePayment: (data: unknown) => {
|
|
2033
|
-
status: "pending" | "completed" | "failed" | "refunded";
|
|
2034
|
-
metadata: {
|
|
2035
|
-
currency: string;
|
|
2036
|
-
userId?: string | ObjectId | undefined;
|
|
2037
|
-
orgId?: string | ObjectId | undefined;
|
|
2038
|
-
transactionId?: string | undefined;
|
|
2039
|
-
paymentMethod?: string | undefined;
|
|
2040
|
-
paymentMethodType?: string | undefined;
|
|
2041
|
-
paymentMethodId?: string | undefined;
|
|
2042
|
-
payment?: string | undefined;
|
|
2043
|
-
subscriptionId?: string | ObjectId | undefined;
|
|
2044
|
-
};
|
|
2045
|
-
paymentMethod: "EWALLET" | "QR_CODE" | "CARD" | "DIRECT_DEBIT" | "VIRTUAL_ACCOUNT" | "OVER_THE_COUNTER" | "PAYPAL";
|
|
2046
|
-
invoiceId: string;
|
|
2047
|
-
amount: number;
|
|
2048
|
-
_id?: string | ObjectId | undefined;
|
|
2049
|
-
updatedAt?: Date | undefined;
|
|
2050
|
-
createdAt?: Date | undefined;
|
|
2051
|
-
};
|
|
677
|
+
declare function useUserController(): {
|
|
678
|
+
getUsers: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
679
|
+
getUserById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
680
|
+
updateName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
681
|
+
updateBirthday: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
682
|
+
updateUserFieldById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
683
|
+
updateUserProfile: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
684
|
+
createUserByVerification: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
2052
685
|
};
|
|
2053
686
|
|
|
2054
|
-
declare function
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
687
|
+
declare function useGitHubService(): {
|
|
688
|
+
setVariables: (params: {
|
|
689
|
+
githubToken: string;
|
|
690
|
+
repoUrl: string;
|
|
691
|
+
environment: string;
|
|
692
|
+
type: "env" | "secret";
|
|
693
|
+
keyValues: string;
|
|
694
|
+
}) => Promise<string>;
|
|
695
|
+
};
|
|
696
|
+
|
|
697
|
+
declare function useUtilController(): {
|
|
698
|
+
healthCheck: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
699
|
+
setGitHubVariables: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
700
|
+
};
|
|
701
|
+
|
|
702
|
+
declare const transactionSchema: Joi.ObjectSchema<any>;
|
|
703
|
+
|
|
704
|
+
type TVerificationMetadata = {
|
|
705
|
+
name?: string;
|
|
706
|
+
app?: string;
|
|
707
|
+
role?: string;
|
|
708
|
+
roleName?: string;
|
|
709
|
+
referralCode?: string;
|
|
710
|
+
org?: string | ObjectId;
|
|
711
|
+
orgName?: string;
|
|
712
|
+
};
|
|
713
|
+
type TVerification = {
|
|
714
|
+
_id?: ObjectId;
|
|
715
|
+
type: string;
|
|
716
|
+
email: string;
|
|
717
|
+
metadata?: TVerificationMetadata;
|
|
718
|
+
status?: string;
|
|
719
|
+
createdAt: string | Date;
|
|
720
|
+
updatedAt?: string | Date | null;
|
|
721
|
+
expireAt: string | Date;
|
|
722
|
+
};
|
|
723
|
+
declare class MVerification implements TVerification {
|
|
724
|
+
_id?: ObjectId;
|
|
725
|
+
type: string;
|
|
726
|
+
email: string;
|
|
727
|
+
metadata?: TVerificationMetadata;
|
|
728
|
+
status?: string;
|
|
729
|
+
createdAt: string | Date;
|
|
730
|
+
updatedAt?: string | Date | null;
|
|
731
|
+
expireAt: string | Date;
|
|
732
|
+
constructor(value: TVerification);
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
declare function useVerificationRepo(): {
|
|
736
|
+
createIndexes: () => Promise<void>;
|
|
737
|
+
add: (value: TVerification, session?: ClientSession) => Promise<ObjectId>;
|
|
738
|
+
getVerifications: ({ search, page, limit, sort, status, type, email, app, }?: {
|
|
2059
739
|
search?: string | undefined;
|
|
2060
740
|
page?: number | undefined;
|
|
2061
741
|
limit?: number | undefined;
|
|
2062
|
-
sort?:
|
|
742
|
+
sort?: Record<string, number> | undefined;
|
|
2063
743
|
status?: string | undefined;
|
|
2064
|
-
type?: string | undefined;
|
|
2065
|
-
|
|
744
|
+
type?: string | string[] | undefined;
|
|
745
|
+
email?: string | undefined;
|
|
746
|
+
app?: string | undefined;
|
|
2066
747
|
}) => Promise<{
|
|
2067
748
|
items: any[];
|
|
2068
749
|
pages: number;
|
|
2069
750
|
pageRange: string;
|
|
2070
|
-
}>;
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
currency: string;
|
|
2075
|
-
userId?: string | ObjectId | undefined;
|
|
2076
|
-
orgId?: string | ObjectId | undefined;
|
|
2077
|
-
transactionId?: string | undefined;
|
|
2078
|
-
paymentMethod?: string | undefined;
|
|
2079
|
-
paymentMethodType?: string | undefined;
|
|
2080
|
-
paymentMethodId?: string | undefined;
|
|
2081
|
-
payment?: string | undefined;
|
|
2082
|
-
subscriptionId?: string | ObjectId | undefined;
|
|
2083
|
-
};
|
|
2084
|
-
paymentMethod: "EWALLET" | "QR_CODE" | "CARD" | "DIRECT_DEBIT" | "VIRTUAL_ACCOUNT" | "OVER_THE_COUNTER" | "PAYPAL";
|
|
2085
|
-
invoiceId: string;
|
|
2086
|
-
amount: number;
|
|
2087
|
-
_id?: string | ObjectId | undefined;
|
|
2088
|
-
updatedAt?: Date | undefined;
|
|
2089
|
-
createdAt?: Date | undefined;
|
|
2090
|
-
}> | null>;
|
|
2091
|
-
};
|
|
2092
|
-
|
|
2093
|
-
declare function usePaymentController(): {
|
|
2094
|
-
getPayments: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
2095
|
-
};
|
|
2096
|
-
|
|
2097
|
-
declare const TCounter: z.ZodObject<{
|
|
2098
|
-
_id: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodType<ObjectId, z.ZodTypeDef, ObjectId>]>, ObjectId, string | ObjectId>>;
|
|
2099
|
-
count: z.ZodDefault<z.ZodNumber>;
|
|
2100
|
-
type: z.ZodString;
|
|
2101
|
-
createdAt: z.ZodDefault<z.ZodOptional<z.ZodDate>>;
|
|
2102
|
-
updatedAt: z.ZodOptional<z.ZodDate>;
|
|
2103
|
-
deletedAt: z.ZodOptional<z.ZodDate>;
|
|
2104
|
-
}, "strip", z.ZodTypeAny, {
|
|
2105
|
-
type: string;
|
|
2106
|
-
createdAt: Date;
|
|
2107
|
-
count: number;
|
|
2108
|
-
_id?: ObjectId | undefined;
|
|
2109
|
-
updatedAt?: Date | undefined;
|
|
2110
|
-
deletedAt?: Date | undefined;
|
|
2111
|
-
}, {
|
|
2112
|
-
type: string;
|
|
2113
|
-
_id?: string | ObjectId | undefined;
|
|
2114
|
-
updatedAt?: Date | undefined;
|
|
2115
|
-
deletedAt?: Date | undefined;
|
|
2116
|
-
createdAt?: Date | undefined;
|
|
2117
|
-
count?: number | undefined;
|
|
2118
|
-
}>;
|
|
2119
|
-
type TCounter = z.infer<typeof TCounter>;
|
|
2120
|
-
declare function useCounterModel(db: Db): {
|
|
2121
|
-
createCounter: (value: Pick<TCounter, "type">) => {
|
|
2122
|
-
type: string;
|
|
2123
|
-
createdAt: Date;
|
|
2124
|
-
count: number;
|
|
2125
|
-
_id?: ObjectId | undefined;
|
|
2126
|
-
updatedAt?: Date | undefined;
|
|
2127
|
-
deletedAt?: Date | undefined;
|
|
2128
|
-
};
|
|
2129
|
-
validateCounter: (data: unknown) => z.SafeParseReturnType<{
|
|
2130
|
-
type: string;
|
|
2131
|
-
_id?: string | ObjectId | undefined;
|
|
2132
|
-
updatedAt?: Date | undefined;
|
|
2133
|
-
deletedAt?: Date | undefined;
|
|
2134
|
-
createdAt?: Date | undefined;
|
|
2135
|
-
count?: number | undefined;
|
|
2136
|
-
}, {
|
|
2137
|
-
type: string;
|
|
2138
|
-
createdAt: Date;
|
|
2139
|
-
count: number;
|
|
2140
|
-
_id?: ObjectId | undefined;
|
|
2141
|
-
updatedAt?: Date | undefined;
|
|
2142
|
-
deletedAt?: Date | undefined;
|
|
2143
|
-
}>;
|
|
2144
|
-
collection: Collection<{
|
|
2145
|
-
type: string;
|
|
2146
|
-
createdAt: Date;
|
|
2147
|
-
count: number;
|
|
2148
|
-
_id?: ObjectId | undefined;
|
|
2149
|
-
updatedAt?: Date | undefined;
|
|
2150
|
-
deletedAt?: Date | undefined;
|
|
2151
|
-
}>;
|
|
2152
|
-
};
|
|
2153
|
-
|
|
2154
|
-
declare function useCounterRepo(): {
|
|
2155
|
-
createIndex: () => Promise<void>;
|
|
2156
|
-
createUniqueIndex: () => Promise<void>;
|
|
2157
|
-
add: (type: string) => Promise<void>;
|
|
2158
|
-
getByType: (type: string) => Promise<any>;
|
|
2159
|
-
incrementByType: (type: string, session?: ClientSession) => Promise<void>;
|
|
2160
|
-
};
|
|
2161
|
-
|
|
2162
|
-
declare const TPriceType: z.ZodEnum<["monthly-subscription", "yearly-subscription", "one-time-payment", "other"]>;
|
|
2163
|
-
type TPriceType = z.infer<typeof TPriceType>;
|
|
2164
|
-
declare const TPrice: z.ZodObject<{
|
|
2165
|
-
_id: z.ZodEffects<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<ObjectId, z.ZodTypeDef, ObjectId>]>>, ObjectId | undefined, string | ObjectId | undefined>;
|
|
2166
|
-
value: z.ZodDefault<z.ZodNumber>;
|
|
2167
|
-
saleValue: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
2168
|
-
saleExpiry: z.ZodOptional<z.ZodDate>;
|
|
2169
|
-
name: z.ZodString;
|
|
2170
|
-
type: z.ZodDefault<z.ZodOptional<z.ZodEnum<["monthly-subscription", "yearly-subscription", "one-time-payment", "other"]>>>;
|
|
2171
|
-
createdAt: z.ZodOptional<z.ZodDefault<z.ZodDate>>;
|
|
2172
|
-
updatedAt: z.ZodOptional<z.ZodDate>;
|
|
2173
|
-
deletedAt: z.ZodOptional<z.ZodDate>;
|
|
2174
|
-
}, "strip", z.ZodTypeAny, {
|
|
2175
|
-
type: "one-time-payment" | "other" | "monthly-subscription" | "yearly-subscription";
|
|
2176
|
-
value: number;
|
|
2177
|
-
name: string;
|
|
2178
|
-
_id?: ObjectId | undefined;
|
|
2179
|
-
updatedAt?: Date | undefined;
|
|
2180
|
-
deletedAt?: Date | undefined;
|
|
2181
|
-
createdAt?: Date | undefined;
|
|
2182
|
-
saleValue?: number | undefined;
|
|
2183
|
-
saleExpiry?: Date | undefined;
|
|
2184
|
-
}, {
|
|
2185
|
-
name: string;
|
|
2186
|
-
type?: "one-time-payment" | "other" | "monthly-subscription" | "yearly-subscription" | undefined;
|
|
2187
|
-
_id?: string | ObjectId | undefined;
|
|
2188
|
-
updatedAt?: Date | undefined;
|
|
2189
|
-
deletedAt?: Date | undefined;
|
|
2190
|
-
value?: number | undefined;
|
|
2191
|
-
createdAt?: Date | undefined;
|
|
2192
|
-
saleValue?: number | undefined;
|
|
2193
|
-
saleExpiry?: Date | undefined;
|
|
2194
|
-
}>;
|
|
2195
|
-
type TPrice = z.infer<typeof TPrice>;
|
|
2196
|
-
declare function usePriceModel(db: Db): {
|
|
2197
|
-
createPrice: (value: Pick<TPrice, "type" | "name" | "value">) => {
|
|
2198
|
-
type: "one-time-payment" | "other" | "monthly-subscription" | "yearly-subscription";
|
|
2199
|
-
value: number;
|
|
2200
|
-
name: string;
|
|
2201
|
-
_id?: ObjectId | undefined;
|
|
2202
|
-
updatedAt?: Date | undefined;
|
|
2203
|
-
deletedAt?: Date | undefined;
|
|
2204
|
-
createdAt?: Date | undefined;
|
|
2205
|
-
saleValue?: number | undefined;
|
|
2206
|
-
saleExpiry?: Date | undefined;
|
|
2207
|
-
};
|
|
2208
|
-
validatePrice: (data: unknown) => z.SafeParseReturnType<{
|
|
2209
|
-
name: string;
|
|
2210
|
-
type?: "one-time-payment" | "other" | "monthly-subscription" | "yearly-subscription" | undefined;
|
|
2211
|
-
_id?: string | ObjectId | undefined;
|
|
2212
|
-
updatedAt?: Date | undefined;
|
|
2213
|
-
deletedAt?: Date | undefined;
|
|
2214
|
-
value?: number | undefined;
|
|
2215
|
-
createdAt?: Date | undefined;
|
|
2216
|
-
saleValue?: number | undefined;
|
|
2217
|
-
saleExpiry?: Date | undefined;
|
|
2218
|
-
}, {
|
|
2219
|
-
type: "one-time-payment" | "other" | "monthly-subscription" | "yearly-subscription";
|
|
2220
|
-
value: number;
|
|
2221
|
-
name: string;
|
|
2222
|
-
_id?: ObjectId | undefined;
|
|
2223
|
-
updatedAt?: Date | undefined;
|
|
2224
|
-
deletedAt?: Date | undefined;
|
|
2225
|
-
createdAt?: Date | undefined;
|
|
2226
|
-
saleValue?: number | undefined;
|
|
2227
|
-
saleExpiry?: Date | undefined;
|
|
2228
|
-
}>;
|
|
2229
|
-
collection: Collection<{
|
|
2230
|
-
type: "one-time-payment" | "other" | "monthly-subscription" | "yearly-subscription";
|
|
2231
|
-
value: number;
|
|
2232
|
-
name: string;
|
|
2233
|
-
_id?: ObjectId | undefined;
|
|
2234
|
-
updatedAt?: Date | undefined;
|
|
2235
|
-
deletedAt?: Date | undefined;
|
|
2236
|
-
createdAt?: Date | undefined;
|
|
2237
|
-
saleValue?: number | undefined;
|
|
2238
|
-
saleExpiry?: Date | undefined;
|
|
2239
|
-
}>;
|
|
751
|
+
} | TVerification[]>;
|
|
752
|
+
getById: (_id: ObjectId | string) => Promise<TVerification | null>;
|
|
753
|
+
getByIdByType: (type: string) => Promise<TVerification[] | TVerification[][]>;
|
|
754
|
+
updateStatusById: (_id: ObjectId | string, status: string, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
2240
755
|
};
|
|
2241
756
|
|
|
2242
|
-
declare function
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
757
|
+
declare function useVerificationService(): {
|
|
758
|
+
createForgetPassword: (email: string) => Promise<string>;
|
|
759
|
+
createUserInvite: ({ email, metadata, }: {
|
|
760
|
+
email: string;
|
|
761
|
+
metadata: TVerificationMetadata;
|
|
762
|
+
}) => Promise<bson.ObjectId>;
|
|
763
|
+
verify: (id: string) => Promise<TVerification | "Member invitation verified successfully.">;
|
|
764
|
+
getById: (id: string) => Promise<TVerification>;
|
|
765
|
+
getVerifications: ({ search, page, status, type, email, limit, app, }?: {
|
|
766
|
+
search?: string | undefined;
|
|
767
|
+
page?: number | undefined;
|
|
768
|
+
status?: string | undefined;
|
|
769
|
+
type?: string | undefined;
|
|
770
|
+
email?: string | undefined;
|
|
771
|
+
limit?: number | undefined;
|
|
772
|
+
app?: string | undefined;
|
|
773
|
+
}) => Promise<{
|
|
774
|
+
items: any[];
|
|
775
|
+
pages: number;
|
|
776
|
+
pageRange: string;
|
|
777
|
+
} | TVerification[]>;
|
|
778
|
+
cancelUserInvitation: (id: string) => Promise<void>;
|
|
779
|
+
updateStatusById: (_id: string, status: string) => Promise<string>;
|
|
780
|
+
signUp: ({ email, metadata, }: {
|
|
781
|
+
email: string;
|
|
782
|
+
metadata: Record<string, any>;
|
|
783
|
+
}) => Promise<bson.ObjectId>;
|
|
2248
784
|
};
|
|
2249
785
|
|
|
2250
|
-
declare function
|
|
2251
|
-
|
|
786
|
+
declare function useVerificationController(): {
|
|
787
|
+
getVerifications: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
788
|
+
createUserInvite: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
789
|
+
createForgetPassword: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
790
|
+
verify: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
791
|
+
cancelUserInvitation: (req: Request, res: Response, next: NextFunction) => Promise<Response<any, Record<string, any>> | undefined>;
|
|
2252
792
|
};
|
|
2253
793
|
|
|
2254
|
-
type
|
|
794
|
+
type TApp = {
|
|
2255
795
|
_id?: ObjectId;
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
streetAddress: string;
|
|
2260
|
-
barangay: string;
|
|
2261
|
-
city: string;
|
|
2262
|
-
province: string;
|
|
2263
|
-
region: string;
|
|
2264
|
-
zipCode?: string;
|
|
2265
|
-
latitude?: string;
|
|
2266
|
-
longitude?: string;
|
|
2267
|
-
ownerId?: string;
|
|
2268
|
-
managerName?: string;
|
|
2269
|
-
managerEmail?: string;
|
|
2270
|
-
managerPhone?: string;
|
|
2271
|
-
amenities?: Array<string>;
|
|
2272
|
-
numberOfFloors: string;
|
|
2273
|
-
floorLabels?: string;
|
|
2274
|
-
coverPhoto: object;
|
|
2275
|
-
photoGallery: Array<object>;
|
|
2276
|
-
stayType: string;
|
|
796
|
+
code: string;
|
|
797
|
+
name: string;
|
|
798
|
+
description: string;
|
|
2277
799
|
status?: string;
|
|
2278
|
-
createdAt?: Date;
|
|
2279
|
-
updatedAt?: Date;
|
|
2280
|
-
deletedAt?: Date;
|
|
800
|
+
createdAt?: string | Date;
|
|
801
|
+
updatedAt?: string | Date;
|
|
802
|
+
deletedAt?: string | Date;
|
|
2281
803
|
};
|
|
2282
|
-
declare const
|
|
2283
|
-
declare
|
|
2284
|
-
declare function modelProperty(value: TProperty): TProperty;
|
|
804
|
+
declare const schemaApp: Joi.ObjectSchema<any>;
|
|
805
|
+
declare function modelApp(value: TApp): TApp;
|
|
2285
806
|
|
|
2286
|
-
declare function
|
|
2287
|
-
|
|
2288
|
-
add: (value:
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
getAll: ({ page, limit, status, search, }?: {
|
|
807
|
+
declare function useAppRepo(): {
|
|
808
|
+
createIndexes: () => Promise<void>;
|
|
809
|
+
add: (value: TApp, session?: ClientSession) => Promise<ObjectId>;
|
|
810
|
+
getAll: ({ search, page, limit, sort, school, status, }?: {
|
|
811
|
+
search?: string | undefined;
|
|
2292
812
|
page?: number | undefined;
|
|
2293
813
|
limit?: number | undefined;
|
|
814
|
+
sort?: {} | undefined;
|
|
815
|
+
school?: string | undefined;
|
|
2294
816
|
status?: string | undefined;
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
817
|
+
}) => Promise<Record<string, any>>;
|
|
818
|
+
getById: (_id: string | ObjectId) => Promise<TApp | null>;
|
|
819
|
+
updateById: (_id: ObjectId | string, value: {
|
|
820
|
+
name: string;
|
|
821
|
+
serial: string;
|
|
822
|
+
levels: number;
|
|
823
|
+
}, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
824
|
+
deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
825
|
+
};
|
|
826
|
+
|
|
827
|
+
declare function useAppService(): {
|
|
828
|
+
deleteById: (id: string) => Promise<string>;
|
|
2298
829
|
};
|
|
2299
830
|
|
|
2300
|
-
declare function
|
|
831
|
+
declare function useAppController(): {
|
|
2301
832
|
add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
2302
|
-
updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
2303
833
|
getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
2304
834
|
getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
2305
835
|
deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
2306
836
|
};
|
|
2307
837
|
|
|
2308
|
-
type
|
|
838
|
+
type TPermission = {
|
|
2309
839
|
_id?: ObjectId;
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
status?: string;
|
|
2319
|
-
createdAt?: Date;
|
|
2320
|
-
updatedAt?: Date;
|
|
2321
|
-
deletedAt?: Date;
|
|
840
|
+
app: string;
|
|
841
|
+
key: string;
|
|
842
|
+
group: string;
|
|
843
|
+
description: string;
|
|
844
|
+
deprecated: boolean;
|
|
845
|
+
createdAt?: string | Date;
|
|
846
|
+
updatedAt?: string | Date;
|
|
847
|
+
deletedAt?: string | Date;
|
|
2322
848
|
};
|
|
2323
|
-
declare const
|
|
2324
|
-
declare
|
|
2325
|
-
declare function modelUnitType(value: TUnitType): TUnitType;
|
|
849
|
+
declare const schemaPermission: Joi.ObjectSchema<any>;
|
|
850
|
+
declare function modelPermission(value: TPermission): TPermission;
|
|
2326
851
|
|
|
2327
|
-
declare function
|
|
2328
|
-
|
|
2329
|
-
add: (value:
|
|
2330
|
-
getAll: ({ page, limit,
|
|
852
|
+
declare function usePermissionRepo(): {
|
|
853
|
+
createIndexes: () => Promise<void>;
|
|
854
|
+
add: (value: TPermission, session?: ClientSession) => Promise<ObjectId>;
|
|
855
|
+
getAll: ({ search, page, limit, sort, school, status, }?: {
|
|
856
|
+
search?: string | undefined;
|
|
2331
857
|
page?: number | undefined;
|
|
2332
858
|
limit?: number | undefined;
|
|
859
|
+
sort?: {} | undefined;
|
|
860
|
+
school?: string | undefined;
|
|
2333
861
|
status?: string | undefined;
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
862
|
+
}) => Promise<Record<string, any>>;
|
|
863
|
+
getById: (_id: string | ObjectId) => Promise<TPermission | null>;
|
|
864
|
+
updateById: (_id: ObjectId | string, value: {
|
|
865
|
+
name: string;
|
|
866
|
+
serial: string;
|
|
867
|
+
levels: number;
|
|
868
|
+
}, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
869
|
+
deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
870
|
+
countByGroup: (group: string) => Promise<number>;
|
|
871
|
+
};
|
|
872
|
+
|
|
873
|
+
declare function usePermissionService(): {
|
|
874
|
+
deleteById: (id: string) => Promise<string>;
|
|
2340
875
|
};
|
|
2341
876
|
|
|
2342
|
-
declare function
|
|
877
|
+
declare function usePermissionController(): {
|
|
2343
878
|
add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
2344
879
|
getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
2345
880
|
getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
2346
|
-
updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
2347
881
|
deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
2348
|
-
getByPropertyId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
2349
882
|
};
|
|
2350
883
|
|
|
2351
|
-
type
|
|
884
|
+
type TPermissionGroup = {
|
|
2352
885
|
_id?: ObjectId;
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
status?: string;
|
|
2361
|
-
availableDays: Array<string>;
|
|
2362
|
-
createdAt?: Date;
|
|
2363
|
-
updatedAt?: Date;
|
|
2364
|
-
deletedAt?: Date;
|
|
886
|
+
app: string;
|
|
887
|
+
key: string;
|
|
888
|
+
label: string;
|
|
889
|
+
order: number;
|
|
890
|
+
createdAt?: string | Date;
|
|
891
|
+
updatedAt?: string | Date;
|
|
892
|
+
deletedAt?: string | Date;
|
|
2365
893
|
};
|
|
2366
|
-
declare const
|
|
2367
|
-
declare function
|
|
894
|
+
declare const schemaPermissionGroup: Joi.ObjectSchema<any>;
|
|
895
|
+
declare function modelPermissionGroup(value: TPermissionGroup): TPermissionGroup;
|
|
2368
896
|
|
|
2369
|
-
declare function
|
|
2370
|
-
|
|
2371
|
-
add: (value:
|
|
2372
|
-
getAll: ({ page, limit,
|
|
897
|
+
declare function usePermissionGroupRepo(): {
|
|
898
|
+
createIndexes: () => Promise<void>;
|
|
899
|
+
add: (value: TPermissionGroup, session?: ClientSession) => Promise<ObjectId>;
|
|
900
|
+
getAll: ({ search, page, limit, sort, school, status, }?: {
|
|
901
|
+
search?: string | undefined;
|
|
2373
902
|
page?: number | undefined;
|
|
2374
903
|
limit?: number | undefined;
|
|
904
|
+
sort?: {} | undefined;
|
|
905
|
+
school?: string | undefined;
|
|
2375
906
|
status?: string | undefined;
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
907
|
+
}) => Promise<Record<string, any>>;
|
|
908
|
+
getById: (_id: string | ObjectId) => Promise<TPermissionGroup | null>;
|
|
909
|
+
updateById: (_id: ObjectId | string, value: {
|
|
910
|
+
name: string;
|
|
911
|
+
serial: string;
|
|
912
|
+
levels: number;
|
|
913
|
+
}, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
914
|
+
deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
915
|
+
};
|
|
916
|
+
|
|
917
|
+
declare function usePermissionGroupService(): {
|
|
918
|
+
deleteById: (id: string) => Promise<string>;
|
|
2381
919
|
};
|
|
2382
920
|
|
|
2383
|
-
declare function
|
|
921
|
+
declare function usePermissionGroupController(): {
|
|
2384
922
|
add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
2385
923
|
getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
2386
924
|
getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
2387
|
-
updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
2388
925
|
deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
2389
926
|
};
|
|
2390
927
|
|
|
2391
|
-
declare function usePaypalService(): {
|
|
2392
|
-
createInvoice: (data: {
|
|
2393
|
-
invoiceNumber?: string | undefined;
|
|
2394
|
-
invoiceDate?: string | undefined;
|
|
2395
|
-
invoiceDueDate?: string | undefined;
|
|
2396
|
-
customerEmail: string;
|
|
2397
|
-
customerName?: string | undefined;
|
|
2398
|
-
quantity: number;
|
|
2399
|
-
ratePerSeat: number;
|
|
2400
|
-
currency: string;
|
|
2401
|
-
items?: Record<string, any>[] | undefined;
|
|
2402
|
-
note?: string | undefined;
|
|
2403
|
-
}) => Promise<string>;
|
|
2404
|
-
getInvoiceById: (invoiceId: string) => Promise<any>;
|
|
2405
|
-
};
|
|
2406
|
-
|
|
2407
|
-
declare function useUtilController(): {
|
|
2408
|
-
healthCheck: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
2409
|
-
setGitHubVariables: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
2410
|
-
};
|
|
2411
|
-
|
|
2412
928
|
declare const MONGO_URI: string;
|
|
2413
929
|
declare const MONGO_DB: string;
|
|
2414
930
|
declare const PORT: number;
|
|
@@ -2446,4 +962,4 @@ declare const XENDIT_SECRET_KEY: string;
|
|
|
2446
962
|
declare const XENDIT_BASE_URL: string;
|
|
2447
963
|
declare const DOMAIN: string;
|
|
2448
964
|
|
|
2449
|
-
export { ACCESS_TOKEN_EXPIRY, ACCESS_TOKEN_SECRET, APP_ACCOUNT, APP_MAIN,
|
|
965
|
+
export { ACCESS_TOKEN_EXPIRY, ACCESS_TOKEN_SECRET, APP_ACCOUNT, APP_MAIN, DEFAULT_USER_EMAIL, DEFAULT_USER_FIRST_NAME, DEFAULT_USER_LAST_NAME, DEFAULT_USER_PASSWORD, DOMAIN, MAILER_EMAIL, MAILER_PASSWORD, MAILER_TRANSPORT_HOST, MAILER_TRANSPORT_PORT, MAILER_TRANSPORT_SECURE, MAddress, MBuilding, MBuildingUnit, MFile, MMember, MONGO_DB, MONGO_URI, MOrg, MRole, MUser, MUserRole, MVerification, OrgTypes, PAYPAL_API_URL, PAYPAL_CLIENT_ID, PAYPAL_CLIENT_SECRET, PORT, REDIS_HOST, REDIS_PASSWORD, REDIS_PORT, REFRESH_TOKEN_EXPIRY, REFRESH_TOKEN_SECRET, SECRET_KEY, SPACES_ACCESS_KEY, SPACES_BUCKET, SPACES_ENDPOINT, SPACES_REGION, SPACES_SECRET_KEY, TAddress, TApp, TBuilding, TBuildingUnit, TCounter, TFile, TMember, TMiniRole, TOrg, TPSGC, TPermission, TPermissionGroup, TRole, TUser, TUserRole, TVerification, TVerificationMetadata, VERIFICATION_FORGET_PASSWORD_DURATION, VERIFICATION_USER_INVITE_DURATION, XENDIT_BASE_URL, XENDIT_SECRET_KEY, addressSchema, isDev, modelApp, modelPSGC, modelPermission, modelPermissionGroup, schemaApp, schemaBuilding, schemaBuildingUnit, schemaOrg, schemaPSGC, schemaPermission, schemaPermissionGroup, schemaUpdateOptions, transactionSchema, useAddressController, useAddressRepo, useAppController, useAppRepo, useAppService, useAuthController, useAuthService, useBuildingController, useBuildingRepo, useBuildingService, useBuildingUnitController, useBuildingUnitRepo, useBuildingUnitService, useCounterModel, useCounterRepo, useFileController, useFileRepo, useFileService, useGitHubService, useMemberController, useMemberRepo, useOrgController, useOrgRepo, useOrgService, usePSGCController, usePSGCRepo, usePermissionController, usePermissionGroupController, usePermissionGroupRepo, usePermissionGroupService, usePermissionRepo, usePermissionService, useRoleController, useRoleRepo, useUserController, useUserRepo, useUserService, useUtilController, useVerificationController, useVerificationRepo, useVerificationService };
|