@goweekdays/core 1.1.3 → 1.1.6
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 +18 -0
- package/dist/index.d.ts +43 -413
- package/dist/index.js +5672 -6347
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3170 -3836
- package/dist/index.mjs.map +1 -1
- package/dist/public/handlebars/member-invite.hbs +17 -16
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import * as mongodb from 'mongodb';
|
|
|
2
2
|
import { ObjectId, ClientSession, Db, Collection } from 'mongodb';
|
|
3
3
|
import * as bson from 'bson';
|
|
4
4
|
import { Request, Response, NextFunction } from 'express';
|
|
5
|
-
import { paginate } from '@goweekdays/utils';
|
|
6
5
|
import Joi from 'joi';
|
|
7
6
|
import { z } from 'zod';
|
|
8
7
|
|
|
@@ -10,8 +9,10 @@ type TVerificationMetadata = {
|
|
|
10
9
|
name?: string;
|
|
11
10
|
app?: string;
|
|
12
11
|
role?: string;
|
|
12
|
+
roleName?: string;
|
|
13
13
|
referralCode?: string;
|
|
14
14
|
org?: string | ObjectId;
|
|
15
|
+
orgName?: string;
|
|
15
16
|
};
|
|
16
17
|
type TVerification = {
|
|
17
18
|
_id?: ObjectId;
|
|
@@ -38,15 +39,17 @@ declare class MVerification implements TVerification {
|
|
|
38
39
|
declare function useVerificationRepo(): {
|
|
39
40
|
createIndex: () => Promise<void>;
|
|
40
41
|
createTextIndex: () => Promise<void>;
|
|
42
|
+
createUniqueIndex: () => Promise<void>;
|
|
41
43
|
add: (value: TVerification, session?: ClientSession) => Promise<ObjectId>;
|
|
42
|
-
getVerifications: ({ search, page, limit, sort, status, type, email, }?: {
|
|
44
|
+
getVerifications: ({ search, page, limit, sort, status, type, email, app, }?: {
|
|
43
45
|
search?: string | undefined;
|
|
44
46
|
page?: number | undefined;
|
|
45
47
|
limit?: number | undefined;
|
|
46
|
-
sort?:
|
|
48
|
+
sort?: Record<string, number> | undefined;
|
|
47
49
|
status?: string | undefined;
|
|
48
|
-
type?: string | undefined;
|
|
50
|
+
type?: string | string[] | undefined;
|
|
49
51
|
email?: string | undefined;
|
|
52
|
+
app?: string | undefined;
|
|
50
53
|
}) => Promise<{
|
|
51
54
|
items: any[];
|
|
52
55
|
pages: number;
|
|
@@ -65,17 +68,18 @@ declare function useVerificationService(): {
|
|
|
65
68
|
createForgetPassword: (email: string) => Promise<string>;
|
|
66
69
|
createUserInvite: ({ email, metadata, }: {
|
|
67
70
|
email: string;
|
|
68
|
-
metadata:
|
|
71
|
+
metadata: TVerificationMetadata;
|
|
69
72
|
}) => Promise<bson.ObjectId>;
|
|
70
|
-
verify: (id: string) => Promise<TVerification>;
|
|
73
|
+
verify: (id: string) => Promise<TVerification | "Member invitation verified successfully.">;
|
|
71
74
|
getById: (id: string) => Promise<TVerification>;
|
|
72
|
-
getVerifications: ({ search, page, status, type, email, limit, }?: {
|
|
75
|
+
getVerifications: ({ search, page, status, type, email, limit, app, }?: {
|
|
73
76
|
search?: string | undefined;
|
|
74
77
|
page?: number | undefined;
|
|
75
78
|
status?: string | undefined;
|
|
76
79
|
type?: string | undefined;
|
|
77
80
|
email?: string | undefined;
|
|
78
81
|
limit?: number | undefined;
|
|
82
|
+
app?: string | undefined;
|
|
79
83
|
}) => Promise<{
|
|
80
84
|
items: any[];
|
|
81
85
|
pages: number;
|
|
@@ -144,7 +148,7 @@ type TUser = {
|
|
|
144
148
|
birthDay?: number;
|
|
145
149
|
birthYear?: number;
|
|
146
150
|
gender?: string;
|
|
147
|
-
defaultOrg?: ObjectId;
|
|
151
|
+
defaultOrg?: ObjectId | string;
|
|
148
152
|
xenditCustomerId?: string;
|
|
149
153
|
type?: string;
|
|
150
154
|
status?: string;
|
|
@@ -176,6 +180,7 @@ declare class MUser implements TUser {
|
|
|
176
180
|
createdAt?: string;
|
|
177
181
|
updatedAt?: string;
|
|
178
182
|
deletedAt?: string;
|
|
183
|
+
defaultOrg?: ObjectId | string;
|
|
179
184
|
constructor(value: TUser);
|
|
180
185
|
}
|
|
181
186
|
|
|
@@ -192,11 +197,7 @@ declare function useUserRepo(): {
|
|
|
192
197
|
sort?: {} | undefined;
|
|
193
198
|
status?: string | undefined;
|
|
194
199
|
type?: string | undefined;
|
|
195
|
-
}) => Promise<
|
|
196
|
-
items: any[];
|
|
197
|
-
pages: number;
|
|
198
|
-
pageRange: string;
|
|
199
|
-
}>;
|
|
200
|
+
}) => Promise<Record<string, any>>;
|
|
200
201
|
updatePassword: ({ _id, password }?: {
|
|
201
202
|
_id: string | ObjectId;
|
|
202
203
|
password: string;
|
|
@@ -216,28 +217,22 @@ declare function useUserRepo(): {
|
|
|
216
217
|
_id: string | ObjectId;
|
|
217
218
|
field: string;
|
|
218
219
|
value: string | ObjectId;
|
|
219
|
-
}, session?: ClientSession) => Promise<
|
|
220
|
+
}, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
220
221
|
addUserRole: ({ _id, role }?: {
|
|
221
222
|
_id: string | ObjectId;
|
|
222
223
|
role: TUserRole;
|
|
223
224
|
}, session?: ClientSession) => Promise<void>;
|
|
224
|
-
getByEmailApp: (email: string, app: string) => Promise<TUser | null>;
|
|
225
225
|
getUserByReferralCode: (referralCode: string) => Promise<TUser | null>;
|
|
226
226
|
};
|
|
227
227
|
|
|
228
228
|
declare function useUserService(): {
|
|
229
|
-
getUserById: (id: string) => Promise<TUser | null>;
|
|
230
229
|
getUsers: ({ search, page, status, type, limit, }?: {
|
|
231
230
|
search?: string | undefined;
|
|
232
231
|
page?: number | undefined;
|
|
233
232
|
status?: string | undefined;
|
|
234
233
|
type?: string | undefined;
|
|
235
234
|
limit?: number | undefined;
|
|
236
|
-
}) => Promise<
|
|
237
|
-
items: any[];
|
|
238
|
-
pages: number;
|
|
239
|
-
pageRange: string;
|
|
240
|
-
}>;
|
|
235
|
+
}) => Promise<Record<string, any>>;
|
|
241
236
|
createUser: (value: Pick<TUser, "email" | "firstName" | "middleName" | "lastName" | "password" | "prefix" | "suffix">) => Promise<ObjectId>;
|
|
242
237
|
resetPassword: (id: string, newPassword: string, passwordConfirmation: string) => Promise<string>;
|
|
243
238
|
updateName: (_id: string, firstName?: string, lastName?: string) => Promise<string>;
|
|
@@ -246,7 +241,7 @@ declare function useUserService(): {
|
|
|
246
241
|
_id: string;
|
|
247
242
|
field: string;
|
|
248
243
|
value: string;
|
|
249
|
-
}) => Promise<
|
|
244
|
+
}) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
250
245
|
updateUserProfile: ({ file, user, previousProfile }?: {
|
|
251
246
|
file: Express.Multer.File;
|
|
252
247
|
user: string;
|
|
@@ -257,7 +252,7 @@ declare function useUserService(): {
|
|
|
257
252
|
firstName?: string | undefined;
|
|
258
253
|
lastName?: string | undefined;
|
|
259
254
|
password?: string | undefined;
|
|
260
|
-
}) => Promise<ObjectId>;
|
|
255
|
+
}) => Promise<string | ObjectId>;
|
|
261
256
|
createUserBySignUp: ({ id, firstName, lastName, password, }?: {
|
|
262
257
|
id?: string | undefined;
|
|
263
258
|
firstName?: string | undefined;
|
|
@@ -345,10 +340,10 @@ declare function useRoleRepo(): {
|
|
|
345
340
|
items: any[];
|
|
346
341
|
pages: number;
|
|
347
342
|
pageRange: string;
|
|
348
|
-
}>;
|
|
343
|
+
} | TRole[]>;
|
|
349
344
|
getRoleByUserId: (value: ObjectId | string) => Promise<TRole | null>;
|
|
350
|
-
getRoleById: (_id: ObjectId | string) => Promise<mongodb.WithId<bson.Document> | null>;
|
|
351
|
-
getRoleByName: (name: string) => Promise<mongodb.WithId<bson.Document> | null>;
|
|
345
|
+
getRoleById: (_id: ObjectId | string) => Promise<mongodb.WithId<bson.Document> | TRole | null>;
|
|
346
|
+
getRoleByName: (name: string) => Promise<mongodb.WithId<bson.Document> | TRole | null>;
|
|
352
347
|
updateRole: (_id: string | ObjectId, value: TMiniRole, session?: ClientSession) => Promise<string>;
|
|
353
348
|
deleteRole: (_id: ObjectId | string, session?: ClientSession) => Promise<string>;
|
|
354
349
|
updatePermissionsById: (_id: string | ObjectId, permissions: TRole["permissions"], session?: ClientSession) => Promise<string>;
|
|
@@ -387,26 +382,6 @@ declare function useFileController(): {
|
|
|
387
382
|
deleteFile: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
388
383
|
};
|
|
389
384
|
|
|
390
|
-
declare function useRoleService(): {
|
|
391
|
-
createRole: (value: Pick<TRole, "type" | "name" | "permissions">) => Promise<bson.ObjectId>;
|
|
392
|
-
getRoles: ({ search, page, limit, type, org, }?: {
|
|
393
|
-
search?: string | undefined;
|
|
394
|
-
page?: number | undefined;
|
|
395
|
-
limit?: number | undefined;
|
|
396
|
-
type?: string | undefined;
|
|
397
|
-
org?: string | undefined;
|
|
398
|
-
}) => Promise<{
|
|
399
|
-
items: any[];
|
|
400
|
-
pages: number;
|
|
401
|
-
pageRange: string;
|
|
402
|
-
}>;
|
|
403
|
-
getRoleByUserId: (value: string) => Promise<TRole | null>;
|
|
404
|
-
getRoleById: (_id: string) => Promise<mongodb.WithId<bson.Document> | null>;
|
|
405
|
-
getRoleByName: (name: string) => Promise<mongodb.WithId<bson.Document> | null>;
|
|
406
|
-
updateRole: (_id: string, value: TMiniRole) => Promise<string>;
|
|
407
|
-
deleteRole: (_id: string) => Promise<string>;
|
|
408
|
-
};
|
|
409
|
-
|
|
410
385
|
declare function useRoleController(): {
|
|
411
386
|
createRole: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
412
387
|
getRoles: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
@@ -461,17 +436,6 @@ declare function useEntityRepo(): {
|
|
|
461
436
|
deleteEntity: (_id: string | ObjectId) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
462
437
|
};
|
|
463
438
|
|
|
464
|
-
declare function useEntityService(): {
|
|
465
|
-
createEntity: (value: any) => Promise<string>;
|
|
466
|
-
getEntities: (value: any) => Promise<{
|
|
467
|
-
items: any[];
|
|
468
|
-
pages: number;
|
|
469
|
-
pageRange: string;
|
|
470
|
-
}>;
|
|
471
|
-
updateEntityFieldById: (_id: string, field: string, value: string) => Promise<string>;
|
|
472
|
-
deleteEntity: (_id: string) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
473
|
-
};
|
|
474
|
-
|
|
475
439
|
declare function useEntityController(): {
|
|
476
440
|
createEntity: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
477
441
|
getEntities: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
@@ -479,346 +443,6 @@ declare function useEntityController(): {
|
|
|
479
443
|
deleteEntity: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
480
444
|
};
|
|
481
445
|
|
|
482
|
-
type TWorkflowStep = {
|
|
483
|
-
name: string;
|
|
484
|
-
assignedTo?: string;
|
|
485
|
-
nextStep?: string;
|
|
486
|
-
};
|
|
487
|
-
type TWorkflow = {
|
|
488
|
-
_id?: ObjectId;
|
|
489
|
-
name: string;
|
|
490
|
-
steps: TWorkflowStep[];
|
|
491
|
-
status?: string;
|
|
492
|
-
createdAt?: string;
|
|
493
|
-
updatedAt?: string;
|
|
494
|
-
deletedAt?: string;
|
|
495
|
-
};
|
|
496
|
-
declare class MWorkflow implements TWorkflow {
|
|
497
|
-
_id?: ObjectId;
|
|
498
|
-
name: string;
|
|
499
|
-
steps: TWorkflowStep[];
|
|
500
|
-
status?: string;
|
|
501
|
-
createdAt?: string;
|
|
502
|
-
updatedAt?: string;
|
|
503
|
-
deletedAt?: string;
|
|
504
|
-
constructor(value: TWorkflow);
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
declare function useWorkflowRepo(): {
|
|
508
|
-
createIndex: () => Promise<void>;
|
|
509
|
-
createUniqueIndex: () => Promise<void>;
|
|
510
|
-
createWorkflow: (value: TWorkflow) => Promise<string>;
|
|
511
|
-
getWorkflows: ({ search, page, limit, sort, }?: {
|
|
512
|
-
search?: string | undefined;
|
|
513
|
-
page?: number | undefined;
|
|
514
|
-
limit?: number | undefined;
|
|
515
|
-
sort?: {} | undefined;
|
|
516
|
-
}) => Promise<{
|
|
517
|
-
items: any[];
|
|
518
|
-
pages: number;
|
|
519
|
-
pageRange: string;
|
|
520
|
-
}>;
|
|
521
|
-
getWorkflowById: (_id: string | ObjectId) => Promise<mongodb.WithId<bson.Document> | null>;
|
|
522
|
-
updateWorkflowFieldById: ({ _id, field, value }?: {
|
|
523
|
-
_id: string | ObjectId;
|
|
524
|
-
field: string;
|
|
525
|
-
value: string;
|
|
526
|
-
}, session?: ClientSession) => Promise<string>;
|
|
527
|
-
deleteWorkflow: (_id: string | ObjectId) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
528
|
-
};
|
|
529
|
-
|
|
530
|
-
declare function useWorkflowService(): {
|
|
531
|
-
createWorkflow: (value: any) => Promise<string>;
|
|
532
|
-
getWorkflows: ({ search, page, limit, sort, }?: {
|
|
533
|
-
search?: string | undefined;
|
|
534
|
-
page?: number | undefined;
|
|
535
|
-
limit?: number | undefined;
|
|
536
|
-
sort?: {} | undefined;
|
|
537
|
-
}) => Promise<{
|
|
538
|
-
items: any[];
|
|
539
|
-
pages: number;
|
|
540
|
-
pageRange: string;
|
|
541
|
-
}>;
|
|
542
|
-
getWorkflowById: (_id: string) => Promise<mongodb.WithId<bson.Document> | null>;
|
|
543
|
-
updateWorkflowFieldById: (_id: string, field: string, value: string) => Promise<string>;
|
|
544
|
-
deleteWorkflow: (_id: string) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
545
|
-
};
|
|
546
|
-
|
|
547
|
-
declare function useWorkflowController(): {
|
|
548
|
-
createWorkflow: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
549
|
-
getWorkflows: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
550
|
-
getWorkflowById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
551
|
-
updateWorkflowFieldById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
552
|
-
deleteWorkflow: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
553
|
-
};
|
|
554
|
-
|
|
555
|
-
type TTentative = {
|
|
556
|
-
month: string;
|
|
557
|
-
day: number;
|
|
558
|
-
};
|
|
559
|
-
type TCapBldgAct = {
|
|
560
|
-
_id?: ObjectId;
|
|
561
|
-
title: string;
|
|
562
|
-
subject: string;
|
|
563
|
-
PMISActivityCode: string;
|
|
564
|
-
type: string;
|
|
565
|
-
strandMandateAddressed: string;
|
|
566
|
-
objectives: Array<string>;
|
|
567
|
-
withCPDUnits: boolean;
|
|
568
|
-
completeStaffWorkReport: string;
|
|
569
|
-
withATC: null | boolean;
|
|
570
|
-
ATC: string;
|
|
571
|
-
conceptNote: string;
|
|
572
|
-
certOfFundAvailability: string;
|
|
573
|
-
budgetProposal: string;
|
|
574
|
-
targets: Array<string>;
|
|
575
|
-
PRCFormsTemplate: string;
|
|
576
|
-
HGDGTool: string;
|
|
577
|
-
EXECOMLeadEndorsement: string;
|
|
578
|
-
individualResults: Array<string>;
|
|
579
|
-
organizationalResults: Array<string>;
|
|
580
|
-
indicative: string;
|
|
581
|
-
tentative: TTentative;
|
|
582
|
-
tentativeOption: TTentative;
|
|
583
|
-
tentativeYear: number;
|
|
584
|
-
GADAttrRate: number;
|
|
585
|
-
GADAttrRateAmount: number;
|
|
586
|
-
NTPCO: {
|
|
587
|
-
teaching: number;
|
|
588
|
-
nonteaching: number;
|
|
589
|
-
teachingRelated: number;
|
|
590
|
-
};
|
|
591
|
-
NTPRO: {
|
|
592
|
-
teaching: number;
|
|
593
|
-
nonteaching: number;
|
|
594
|
-
teachingRelated: number;
|
|
595
|
-
};
|
|
596
|
-
NTPSDO: {
|
|
597
|
-
teaching: number;
|
|
598
|
-
nonteaching: number;
|
|
599
|
-
teachingRelated: number;
|
|
600
|
-
};
|
|
601
|
-
NTPSchool: {
|
|
602
|
-
teaching: number;
|
|
603
|
-
nonteaching: number;
|
|
604
|
-
teachingRelated: number;
|
|
605
|
-
};
|
|
606
|
-
withSkeletonWorkforce: null | boolean;
|
|
607
|
-
skeletonWorkforce: string;
|
|
608
|
-
roles: Array<string>;
|
|
609
|
-
rolesRate: Array<number>;
|
|
610
|
-
skills: Array<string>;
|
|
611
|
-
skillsRate: Array<number>;
|
|
612
|
-
resourceEfficiencyRate: Array<number>;
|
|
613
|
-
AOOR: Array<number>;
|
|
614
|
-
AOOS: Array<string>;
|
|
615
|
-
status?: string;
|
|
616
|
-
createdBy: ObjectId | string;
|
|
617
|
-
createdAt?: string;
|
|
618
|
-
updatedAt?: string;
|
|
619
|
-
deletedAt?: string;
|
|
620
|
-
};
|
|
621
|
-
type TCapBldgActBasicInfo = Pick<TCapBldgAct, "_id" | "title" | "subject" | "PMISActivityCode" | "type" | "strandMandateAddressed" | "objectives" | "withCPDUnits" | "createdBy">;
|
|
622
|
-
type TCapBldgActInitRevEval = Pick<TCapBldgAct, "_id" | "completeStaffWorkReport" | "withATC" | "ATC" | "conceptNote" | "certOfFundAvailability" | "budgetProposal" | "targets" | "PRCFormsTemplate" | "HGDGTool" | "EXECOMLeadEndorsement" | "individualResults" | "organizationalResults" | "indicative" | "tentative" | "tentativeOption" | "tentativeYear" | "GADAttrRate" | "GADAttrRateAmount" | "NTPCO" | "NTPRO" | "NTPSDO" | "NTPSchool" | "withSkeletonWorkforce" | "skeletonWorkforce">;
|
|
623
|
-
type TCapBldgActAssmtCriteria = Pick<TCapBldgAct, "_id" | "roles" | "rolesRate" | "skills" | "skillsRate" | "resourceEfficiencyRate" | "AOOR" | "AOOS">;
|
|
624
|
-
declare class MCapBldgAct implements TCapBldgAct {
|
|
625
|
-
_id?: ObjectId;
|
|
626
|
-
title: string;
|
|
627
|
-
subject: string;
|
|
628
|
-
PMISActivityCode: string;
|
|
629
|
-
type: string;
|
|
630
|
-
strandMandateAddressed: string;
|
|
631
|
-
objectives: Array<string>;
|
|
632
|
-
withCPDUnits: boolean;
|
|
633
|
-
completeStaffWorkReport: string;
|
|
634
|
-
withATC: null | boolean;
|
|
635
|
-
ATC: string;
|
|
636
|
-
conceptNote: string;
|
|
637
|
-
certOfFundAvailability: string;
|
|
638
|
-
budgetProposal: string;
|
|
639
|
-
targets: Array<string>;
|
|
640
|
-
PRCFormsTemplate: string;
|
|
641
|
-
HGDGTool: string;
|
|
642
|
-
EXECOMLeadEndorsement: string;
|
|
643
|
-
individualResults: Array<string>;
|
|
644
|
-
organizationalResults: Array<string>;
|
|
645
|
-
indicative: string;
|
|
646
|
-
tentative: TTentative;
|
|
647
|
-
tentativeOption: TTentative;
|
|
648
|
-
tentativeYear: number;
|
|
649
|
-
GADAttrRate: number;
|
|
650
|
-
GADAttrRateAmount: number;
|
|
651
|
-
NTPCO: {
|
|
652
|
-
teaching: number;
|
|
653
|
-
nonteaching: number;
|
|
654
|
-
teachingRelated: number;
|
|
655
|
-
};
|
|
656
|
-
NTPRO: {
|
|
657
|
-
teaching: number;
|
|
658
|
-
nonteaching: number;
|
|
659
|
-
teachingRelated: number;
|
|
660
|
-
};
|
|
661
|
-
NTPSDO: {
|
|
662
|
-
teaching: number;
|
|
663
|
-
nonteaching: number;
|
|
664
|
-
teachingRelated: number;
|
|
665
|
-
};
|
|
666
|
-
NTPSchool: {
|
|
667
|
-
teaching: number;
|
|
668
|
-
nonteaching: number;
|
|
669
|
-
teachingRelated: number;
|
|
670
|
-
};
|
|
671
|
-
withSkeletonWorkforce: null | boolean;
|
|
672
|
-
skeletonWorkforce: string;
|
|
673
|
-
roles: Array<string>;
|
|
674
|
-
rolesRate: Array<number>;
|
|
675
|
-
skills: Array<string>;
|
|
676
|
-
skillsRate: Array<number>;
|
|
677
|
-
resourceEfficiencyRate: Array<number>;
|
|
678
|
-
AOOR: Array<number>;
|
|
679
|
-
AOOS: Array<string>;
|
|
680
|
-
status?: string;
|
|
681
|
-
createdBy: ObjectId | string;
|
|
682
|
-
createdAt?: string;
|
|
683
|
-
updatedAt?: string;
|
|
684
|
-
deletedAt?: string;
|
|
685
|
-
constructor(value: TCapBldgAct);
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
declare function useCapBldgActRepo(): {
|
|
689
|
-
createIndex: () => Promise<void>;
|
|
690
|
-
createTextIndex: () => Promise<void>;
|
|
691
|
-
createCapBldgAct: (value: TCapBldgAct, session?: ClientSession) => Promise<string>;
|
|
692
|
-
getById: (_id: string | ObjectId) => Promise<TCapBldgAct | null>;
|
|
693
|
-
getCapBldgActs: (params?: {
|
|
694
|
-
search?: string;
|
|
695
|
-
page?: number;
|
|
696
|
-
limit?: number;
|
|
697
|
-
sort?: TKeyValuePair;
|
|
698
|
-
status?: string;
|
|
699
|
-
}) => Promise<ReturnType<typeof paginate>>;
|
|
700
|
-
updateCapBldgActFieldById: (params: {
|
|
701
|
-
_id: string | ObjectId;
|
|
702
|
-
field: string;
|
|
703
|
-
value: string;
|
|
704
|
-
}, session?: ClientSession) => Promise<string>;
|
|
705
|
-
deleteCapBldgAct: (_id: string | ObjectId) => Promise<any>;
|
|
706
|
-
updateCapBldgActBasicInfo: (params: {
|
|
707
|
-
_id: string | ObjectId;
|
|
708
|
-
value: TCapBldgActBasicInfo;
|
|
709
|
-
}, session?: ClientSession) => Promise<void>;
|
|
710
|
-
updateCapBldgActInitRevEval: (params: {
|
|
711
|
-
_id: string | ObjectId;
|
|
712
|
-
value: TCapBldgActInitRevEval;
|
|
713
|
-
}, session?: ClientSession) => Promise<void>;
|
|
714
|
-
updateCapBldgActAssmtCriteria: (params: {
|
|
715
|
-
_id: string | ObjectId;
|
|
716
|
-
value: TCapBldgActAssmtCriteria;
|
|
717
|
-
}, session?: ClientSession) => Promise<void>;
|
|
718
|
-
};
|
|
719
|
-
|
|
720
|
-
declare function useCapBldgActService(): {
|
|
721
|
-
createCapBldgAct: (value: TCapBldgAct) => Promise<string>;
|
|
722
|
-
getCapBldgActs: ({ search, page, status, limit, }?: {
|
|
723
|
-
search?: string | undefined;
|
|
724
|
-
page?: number | undefined;
|
|
725
|
-
status?: string | undefined;
|
|
726
|
-
limit?: number | undefined;
|
|
727
|
-
}) => Promise<{
|
|
728
|
-
items: any[];
|
|
729
|
-
pages: number;
|
|
730
|
-
pageRange: string;
|
|
731
|
-
}>;
|
|
732
|
-
getById: (id: string) => Promise<TCapBldgAct | null>;
|
|
733
|
-
updateCapBldgActFieldById: ({ _id, field, value, }?: {
|
|
734
|
-
_id?: string | undefined;
|
|
735
|
-
field?: string | undefined;
|
|
736
|
-
value?: string | undefined;
|
|
737
|
-
}) => Promise<string>;
|
|
738
|
-
deleteCapBldgAct: (id: string) => Promise<any>;
|
|
739
|
-
updateCapBldgActBasicInfo: (_id: string, value: TCapBldgActBasicInfo) => Promise<void>;
|
|
740
|
-
updateCapBldgActInitRevEval: (_id: string, value: TCapBldgActInitRevEval) => Promise<void>;
|
|
741
|
-
updateCapBldgActAssmtCriteria: (_id: string, value: TCapBldgActAssmtCriteria) => Promise<void>;
|
|
742
|
-
uploadAttachment: (value: Express.Multer.File, id: string, field: string) => Promise<string>;
|
|
743
|
-
deleteAttachment: (attachment: string, id: string, field: string) => Promise<string>;
|
|
744
|
-
};
|
|
745
|
-
|
|
746
|
-
declare function useCapBldgActController(): {
|
|
747
|
-
createCapBldgAct: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
748
|
-
getCapBldgActs: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
749
|
-
getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
750
|
-
updateBasicInformation: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
751
|
-
updateInitRevEval: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
752
|
-
updateAssmtCriteria: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
753
|
-
updateFieldById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
754
|
-
uploadAttachment: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
755
|
-
deleteAttachment: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
756
|
-
};
|
|
757
|
-
|
|
758
|
-
type TAttachment = Pick<TFile, "_id" | "name">;
|
|
759
|
-
type TComment = {
|
|
760
|
-
_id?: ObjectId;
|
|
761
|
-
comment: string;
|
|
762
|
-
type?: string;
|
|
763
|
-
user: ObjectId | string;
|
|
764
|
-
collection: string;
|
|
765
|
-
document: ObjectId | string;
|
|
766
|
-
createdAt?: string;
|
|
767
|
-
updatedAt?: string;
|
|
768
|
-
deletedAt?: string;
|
|
769
|
-
};
|
|
770
|
-
declare class MComment implements TComment {
|
|
771
|
-
_id?: ObjectId;
|
|
772
|
-
comment: string;
|
|
773
|
-
type?: string;
|
|
774
|
-
user: ObjectId | string;
|
|
775
|
-
collection: string;
|
|
776
|
-
document: ObjectId | string;
|
|
777
|
-
createdAt?: string;
|
|
778
|
-
updatedAt?: string;
|
|
779
|
-
deletedAt?: string;
|
|
780
|
-
constructor(value: TComment);
|
|
781
|
-
}
|
|
782
|
-
|
|
783
|
-
declare function useCommentRepo(): {
|
|
784
|
-
createIndex: () => Promise<void>;
|
|
785
|
-
addComment: (value: TComment) => Promise<string>;
|
|
786
|
-
getComments: ({ search, page, limit, sort, document }?: {
|
|
787
|
-
search?: string | undefined;
|
|
788
|
-
page?: number | undefined;
|
|
789
|
-
limit?: number | undefined;
|
|
790
|
-
sort?: TKeyValuePair<string, any> | undefined;
|
|
791
|
-
document?: string | ObjectId | undefined;
|
|
792
|
-
}) => Promise<{
|
|
793
|
-
items: any[];
|
|
794
|
-
pages: number;
|
|
795
|
-
pageRange: string;
|
|
796
|
-
}>;
|
|
797
|
-
};
|
|
798
|
-
|
|
799
|
-
declare function useCommentService(): {
|
|
800
|
-
addComment: ({ comment, type, user, collection, document }?: {
|
|
801
|
-
comment: string;
|
|
802
|
-
type: string;
|
|
803
|
-
user: string;
|
|
804
|
-
collection: string;
|
|
805
|
-
document: string;
|
|
806
|
-
}) => Promise<string>;
|
|
807
|
-
getComments: ({ page, document }?: {
|
|
808
|
-
page?: number | undefined;
|
|
809
|
-
document?: string | undefined;
|
|
810
|
-
}) => Promise<{
|
|
811
|
-
items: any[];
|
|
812
|
-
pages: number;
|
|
813
|
-
pageRange: string;
|
|
814
|
-
}>;
|
|
815
|
-
};
|
|
816
|
-
|
|
817
|
-
declare function useCommentController(): {
|
|
818
|
-
addComment: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
819
|
-
getComments: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
820
|
-
};
|
|
821
|
-
|
|
822
446
|
type TBillingRecipient = {
|
|
823
447
|
addedAt?: Date | string;
|
|
824
448
|
email: string;
|
|
@@ -1553,11 +1177,7 @@ declare function useOrgRepo(): {
|
|
|
1553
1177
|
limit?: number | undefined;
|
|
1554
1178
|
sort?: {} | undefined;
|
|
1555
1179
|
status?: string | undefined;
|
|
1556
|
-
}) => Promise<
|
|
1557
|
-
items: any[];
|
|
1558
|
-
pages: number;
|
|
1559
|
-
pageRange: string;
|
|
1560
|
-
}>;
|
|
1180
|
+
}) => Promise<Record<string, any>>;
|
|
1561
1181
|
getById: (_id: string | ObjectId) => Promise<TOrg>;
|
|
1562
1182
|
updateFieldById: ({ _id, field, value }?: {
|
|
1563
1183
|
_id: string | ObjectId;
|
|
@@ -1581,6 +1201,7 @@ declare function useOrgController(): {
|
|
|
1581
1201
|
getOrgsByUserId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1582
1202
|
getByName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1583
1203
|
getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1204
|
+
getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1584
1205
|
};
|
|
1585
1206
|
|
|
1586
1207
|
type TMember = {
|
|
@@ -1590,6 +1211,7 @@ type TMember = {
|
|
|
1590
1211
|
name: string;
|
|
1591
1212
|
user: string | ObjectId;
|
|
1592
1213
|
role: string | ObjectId;
|
|
1214
|
+
roleName?: string;
|
|
1593
1215
|
type: string;
|
|
1594
1216
|
status?: string;
|
|
1595
1217
|
createdAt?: string;
|
|
@@ -1616,7 +1238,7 @@ declare function useMemberRepo(): {
|
|
|
1616
1238
|
items: any[];
|
|
1617
1239
|
pages: number;
|
|
1618
1240
|
pageRange: string;
|
|
1619
|
-
}>;
|
|
1241
|
+
} | TMember[]>;
|
|
1620
1242
|
getOrgsByUserId: ({ search, page, limit, sort, user, status, }?: {
|
|
1621
1243
|
user: string | ObjectId;
|
|
1622
1244
|
page: number;
|
|
@@ -1628,7 +1250,10 @@ declare function useMemberRepo(): {
|
|
|
1628
1250
|
items: any[];
|
|
1629
1251
|
pages: number;
|
|
1630
1252
|
pageRange: string;
|
|
1631
|
-
}
|
|
1253
|
+
} | {
|
|
1254
|
+
_id: ObjectId;
|
|
1255
|
+
name: string;
|
|
1256
|
+
}[]>;
|
|
1632
1257
|
updateStatusByUserId: (user: string | ObjectId, status: string) => Promise<string>;
|
|
1633
1258
|
updateName: (value: Pick<TMember, "name" | "user">, session?: ClientSession) => Promise<string>;
|
|
1634
1259
|
getByUserId: (user: string | ObjectId) => Promise<TMember | null>;
|
|
@@ -1641,14 +1266,19 @@ declare function useMemberRepo(): {
|
|
|
1641
1266
|
items: any[];
|
|
1642
1267
|
pages: number;
|
|
1643
1268
|
pageRange: string;
|
|
1644
|
-
}
|
|
1269
|
+
} | {
|
|
1270
|
+
text: string;
|
|
1271
|
+
value: ObjectId;
|
|
1272
|
+
}[]>;
|
|
1645
1273
|
countByOrg: (org: string | ObjectId) => Promise<number>;
|
|
1274
|
+
countByUser: (user: string | ObjectId) => Promise<number>;
|
|
1646
1275
|
};
|
|
1647
1276
|
|
|
1648
1277
|
declare function useMemberController(): {
|
|
1649
1278
|
getByUserId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1650
1279
|
getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1651
1280
|
getOrgsByMembership: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1281
|
+
updateStatusByUserId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1652
1282
|
};
|
|
1653
1283
|
|
|
1654
1284
|
declare const schema: Joi.ObjectSchema<any>;
|
|
@@ -1834,6 +1464,7 @@ declare const TInvoice: z.ZodObject<{
|
|
|
1834
1464
|
}[];
|
|
1835
1465
|
_id?: ObjectId | undefined;
|
|
1836
1466
|
updatedAt?: Date | undefined;
|
|
1467
|
+
createdAt?: Date | undefined;
|
|
1837
1468
|
metadata?: {
|
|
1838
1469
|
description?: string | undefined;
|
|
1839
1470
|
userId?: string | ObjectId | undefined;
|
|
@@ -1843,7 +1474,6 @@ declare const TInvoice: z.ZodObject<{
|
|
|
1843
1474
|
subscriptionId?: string | ObjectId | undefined;
|
|
1844
1475
|
billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
|
|
1845
1476
|
} | undefined;
|
|
1846
|
-
createdAt?: Date | undefined;
|
|
1847
1477
|
}, {
|
|
1848
1478
|
amount: number;
|
|
1849
1479
|
invoiceNumber: string;
|
|
@@ -1859,6 +1489,7 @@ declare const TInvoice: z.ZodObject<{
|
|
|
1859
1489
|
status?: "pending" | "cancelled" | "paid" | "overdue" | undefined;
|
|
1860
1490
|
_id?: string | ObjectId | undefined;
|
|
1861
1491
|
updatedAt?: Date | undefined;
|
|
1492
|
+
createdAt?: Date | undefined;
|
|
1862
1493
|
metadata?: {
|
|
1863
1494
|
description?: string | undefined;
|
|
1864
1495
|
userId?: string | ObjectId | undefined;
|
|
@@ -1868,7 +1499,6 @@ declare const TInvoice: z.ZodObject<{
|
|
|
1868
1499
|
subscriptionId?: string | ObjectId | undefined;
|
|
1869
1500
|
billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
|
|
1870
1501
|
} | undefined;
|
|
1871
|
-
createdAt?: Date | undefined;
|
|
1872
1502
|
}>;
|
|
1873
1503
|
type TInvoice = z.infer<typeof TInvoice>;
|
|
1874
1504
|
declare function useInvoiceModel(db: Db): {
|
|
@@ -1888,6 +1518,7 @@ declare function useInvoiceModel(db: Db): {
|
|
|
1888
1518
|
}[];
|
|
1889
1519
|
_id?: ObjectId | undefined;
|
|
1890
1520
|
updatedAt?: Date | undefined;
|
|
1521
|
+
createdAt?: Date | undefined;
|
|
1891
1522
|
metadata?: {
|
|
1892
1523
|
description?: string | undefined;
|
|
1893
1524
|
userId?: string | ObjectId | undefined;
|
|
@@ -1897,7 +1528,6 @@ declare function useInvoiceModel(db: Db): {
|
|
|
1897
1528
|
subscriptionId?: string | ObjectId | undefined;
|
|
1898
1529
|
billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
|
|
1899
1530
|
} | undefined;
|
|
1900
|
-
createdAt?: Date | undefined;
|
|
1901
1531
|
}>;
|
|
1902
1532
|
};
|
|
1903
1533
|
|
|
@@ -1920,6 +1550,7 @@ declare function useInvoiceRepo(): {
|
|
|
1920
1550
|
}[];
|
|
1921
1551
|
_id?: ObjectId | undefined;
|
|
1922
1552
|
updatedAt?: Date | undefined;
|
|
1553
|
+
createdAt?: Date | undefined;
|
|
1923
1554
|
metadata?: {
|
|
1924
1555
|
description?: string | undefined;
|
|
1925
1556
|
userId?: string | ObjectId | undefined;
|
|
@@ -1929,7 +1560,6 @@ declare function useInvoiceRepo(): {
|
|
|
1929
1560
|
subscriptionId?: string | ObjectId | undefined;
|
|
1930
1561
|
billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
|
|
1931
1562
|
} | undefined;
|
|
1932
|
-
createdAt?: Date | undefined;
|
|
1933
1563
|
} | null>;
|
|
1934
1564
|
updateStatusByInvoiceNumber: (invoiceNumber: string, status: TInvoice["status"], session?: ClientSession) => Promise<void>;
|
|
1935
1565
|
getOverdueInvoices: (BATCH_SIZE?: number) => Promise<{
|
|
@@ -1947,6 +1577,7 @@ declare function useInvoiceRepo(): {
|
|
|
1947
1577
|
}[];
|
|
1948
1578
|
_id?: ObjectId | undefined;
|
|
1949
1579
|
updatedAt?: Date | undefined;
|
|
1580
|
+
createdAt?: Date | undefined;
|
|
1950
1581
|
metadata?: {
|
|
1951
1582
|
description?: string | undefined;
|
|
1952
1583
|
userId?: string | ObjectId | undefined;
|
|
@@ -1956,7 +1587,6 @@ declare function useInvoiceRepo(): {
|
|
|
1956
1587
|
subscriptionId?: string | ObjectId | undefined;
|
|
1957
1588
|
billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
|
|
1958
1589
|
} | undefined;
|
|
1959
|
-
createdAt?: Date | undefined;
|
|
1960
1590
|
}[]>;
|
|
1961
1591
|
getBySubscriptionId: ({ page, search, limit, sort, id }?: {
|
|
1962
1592
|
page?: number | undefined;
|
|
@@ -1984,6 +1614,7 @@ declare function useInvoiceRepo(): {
|
|
|
1984
1614
|
}[];
|
|
1985
1615
|
_id?: ObjectId | undefined;
|
|
1986
1616
|
updatedAt?: Date | undefined;
|
|
1617
|
+
createdAt?: Date | undefined;
|
|
1987
1618
|
metadata?: {
|
|
1988
1619
|
description?: string | undefined;
|
|
1989
1620
|
userId?: string | ObjectId | undefined;
|
|
@@ -1993,7 +1624,6 @@ declare function useInvoiceRepo(): {
|
|
|
1993
1624
|
subscriptionId?: string | ObjectId | undefined;
|
|
1994
1625
|
billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
|
|
1995
1626
|
} | undefined;
|
|
1996
|
-
createdAt?: Date | undefined;
|
|
1997
1627
|
} | null>;
|
|
1998
1628
|
getByTransactionId: (id: string) => Promise<{
|
|
1999
1629
|
type: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other";
|
|
@@ -2010,6 +1640,7 @@ declare function useInvoiceRepo(): {
|
|
|
2010
1640
|
}[];
|
|
2011
1641
|
_id?: ObjectId | undefined;
|
|
2012
1642
|
updatedAt?: Date | undefined;
|
|
1643
|
+
createdAt?: Date | undefined;
|
|
2013
1644
|
metadata?: {
|
|
2014
1645
|
description?: string | undefined;
|
|
2015
1646
|
userId?: string | ObjectId | undefined;
|
|
@@ -2019,7 +1650,6 @@ declare function useInvoiceRepo(): {
|
|
|
2019
1650
|
subscriptionId?: string | ObjectId | undefined;
|
|
2020
1651
|
billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
|
|
2021
1652
|
} | undefined;
|
|
2022
|
-
createdAt?: Date | undefined;
|
|
2023
1653
|
} | null>;
|
|
2024
1654
|
};
|
|
2025
1655
|
|
|
@@ -2709,4 +2339,4 @@ declare const PAYPAL_API_URL: string;
|
|
|
2709
2339
|
declare const XENDIT_SECRET_KEY: string;
|
|
2710
2340
|
declare const XENDIT_BASE_URL: string;
|
|
2711
2341
|
|
|
2712
|
-
export { ACCESS_TOKEN_EXPIRY, ACCESS_TOKEN_SECRET, APP_ACCOUNT, APP_MAIN, CardPayment, CardPaymentSchema, DEFAULT_USER_EMAIL, DEFAULT_USER_FIRST_NAME, DEFAULT_USER_LAST_NAME, DEFAULT_USER_PASSWORD, DirectDebit, DirectDebitSchema, EWalletPayment, EWalletPaymentSchema, MAILER_EMAIL, MAILER_PASSWORD, MAILER_TRANSPORT_HOST, MAILER_TRANSPORT_PORT, MAILER_TRANSPORT_SECURE, MAddress,
|
|
2342
|
+
export { ACCESS_TOKEN_EXPIRY, ACCESS_TOKEN_SECRET, APP_ACCOUNT, APP_MAIN, CardPayment, CardPaymentSchema, DEFAULT_USER_EMAIL, DEFAULT_USER_FIRST_NAME, DEFAULT_USER_LAST_NAME, DEFAULT_USER_PASSWORD, DirectDebit, DirectDebitSchema, EWalletPayment, EWalletPaymentSchema, MAILER_EMAIL, MAILER_PASSWORD, MAILER_TRANSPORT_HOST, MAILER_TRANSPORT_PORT, MAILER_TRANSPORT_SECURE, MAddress, MEntity, MFile, MMember, MONGO_DB, MONGO_URI, MOrder, MOrg, MPaymentMethod, MPromoCode, MRole, MSubscription, MToken, MUser, MUserRole, MVerification, 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, TBillingRecipient, TCounter, TEntity, TFile, TInvoice, TMember, TMiniRole, TOrder, TOrderMetadata, TOrg, TPayment, TPaymentMethod$1 as TPaymentMethod, TPaymentMethodType, TPrice, TPriceType, TPromoCode, TPromoTier, TRole, TSubscription, TToken, TUser, TUserRole, TVerification, TVerificationMetadata, VERIFICATION_FORGET_PASSWORD_DURATION, VERIFICATION_USER_INVITE_DURATION, XENDIT_BASE_URL, XENDIT_SECRET_KEY, addressSchema, isDev, schema, useAddressController, useAddressRepo, useAuthController, useAuthService, useCounterModel, useCounterRepo, useEntityController, useEntityRepo, useFileController, useFileRepo, useFileService, useInvoiceController, useInvoiceModel, useInvoiceRepo, useInvoiceService, useMemberController, useMemberRepo, useOrderController, useOrderRepo, useOrgController, useOrgRepo, useOrgService, usePaymentController, usePaymentMethodController, usePaymentMethodRepo, usePaymentMethodService, usePaymentModel, usePaymentRepo, usePaypalService, usePriceController, usePriceModel, usePriceRepo, usePromoCodeController, usePromoCodeRepo, useRoleController, useRoleRepo, useSubscriptionController, useSubscriptionRepo, useSubscriptionService, useTokenRepo, useUserController, useUserRepo, useUserService, useVerificationController, useVerificationRepo, useVerificationService, useXenditService, validateCardPayment, validateDirectDebit, validateEWalletPayment };
|