@goweekdays/core 1.1.4 → 1.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/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,22 +39,24 @@ 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?: {} | undefined;
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;
50
- }) => Promise<{
52
+ app?: string | undefined;
53
+ }) => Promise<TVerification[] | {
51
54
  items: any[];
52
55
  pages: number;
53
56
  pageRange: string;
54
57
  }>;
55
58
  getById: (_id: ObjectId | string) => Promise<TVerification | null>;
56
- getByIdByType: (type: string) => Promise<TVerification[][]>;
59
+ getByIdByType: (type: string) => Promise<TVerification[] | TVerification[][]>;
57
60
  updateStatusById: (_id: ObjectId | string, status: string, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
58
61
  };
59
62
 
@@ -65,18 +68,19 @@ declare function useVerificationService(): {
65
68
  createForgetPassword: (email: string) => Promise<string>;
66
69
  createUserInvite: ({ email, metadata, }: {
67
70
  email: string;
68
- metadata: TKeyValuePair;
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;
79
- }) => Promise<{
82
+ app?: string | undefined;
83
+ }) => Promise<TVerification[] | {
80
84
  items: any[];
81
85
  pages: number;
82
86
  pageRange: string;
@@ -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<string>;
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<string>;
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;
@@ -1612,11 +1234,7 @@ declare function useMemberRepo(): {
1612
1234
  org?: string | ObjectId | undefined;
1613
1235
  type: string;
1614
1236
  status: string;
1615
- }) => Promise<{
1616
- items: any[];
1617
- pages: number;
1618
- pageRange: string;
1619
- }>;
1237
+ }) => Promise<Record<string, any>>;
1620
1238
  getOrgsByUserId: ({ search, page, limit, sort, user, status, }?: {
1621
1239
  user: string | ObjectId;
1622
1240
  page: number;
@@ -1628,7 +1246,10 @@ declare function useMemberRepo(): {
1628
1246
  items: any[];
1629
1247
  pages: number;
1630
1248
  pageRange: string;
1631
- }>;
1249
+ } | {
1250
+ _id: ObjectId;
1251
+ name: string;
1252
+ }[]>;
1632
1253
  updateStatusByUserId: (user: string | ObjectId, status: string) => Promise<string>;
1633
1254
  updateName: (value: Pick<TMember, "name" | "user">, session?: ClientSession) => Promise<string>;
1634
1255
  getByUserId: (user: string | ObjectId) => Promise<TMember | null>;
@@ -1641,14 +1262,19 @@ declare function useMemberRepo(): {
1641
1262
  items: any[];
1642
1263
  pages: number;
1643
1264
  pageRange: string;
1644
- }>;
1265
+ } | {
1266
+ text: string;
1267
+ value: ObjectId;
1268
+ }[]>;
1645
1269
  countByOrg: (org: string | ObjectId) => Promise<number>;
1270
+ countByUser: (user: string | ObjectId) => Promise<number>;
1646
1271
  };
1647
1272
 
1648
1273
  declare function useMemberController(): {
1649
1274
  getByUserId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1650
1275
  getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1651
1276
  getOrgsByMembership: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1277
+ updateStatusByUserId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1652
1278
  };
1653
1279
 
1654
1280
  declare const schema: Joi.ObjectSchema<any>;
@@ -1822,9 +1448,6 @@ declare const TInvoice: z.ZodObject<{
1822
1448
  }, "strip", z.ZodTypeAny, {
1823
1449
  type: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other";
1824
1450
  status: "pending" | "cancelled" | "paid" | "overdue";
1825
- amount: number;
1826
- invoiceNumber: string;
1827
- dueDate: Date;
1828
1451
  items: {
1829
1452
  description: string;
1830
1453
  unitPrice: number;
@@ -1832,8 +1455,12 @@ declare const TInvoice: z.ZodObject<{
1832
1455
  total: number;
1833
1456
  seats?: number | undefined;
1834
1457
  }[];
1458
+ amount: number;
1459
+ invoiceNumber: string;
1460
+ dueDate: Date;
1835
1461
  _id?: ObjectId | undefined;
1836
1462
  updatedAt?: Date | undefined;
1463
+ createdAt?: Date | undefined;
1837
1464
  metadata?: {
1838
1465
  description?: string | undefined;
1839
1466
  userId?: string | ObjectId | undefined;
@@ -1843,11 +1470,7 @@ declare const TInvoice: z.ZodObject<{
1843
1470
  subscriptionId?: string | ObjectId | undefined;
1844
1471
  billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
1845
1472
  } | undefined;
1846
- createdAt?: Date | undefined;
1847
1473
  }, {
1848
- amount: number;
1849
- invoiceNumber: string;
1850
- dueDate: Date;
1851
1474
  items: {
1852
1475
  description: string;
1853
1476
  unitPrice: number;
@@ -1855,10 +1478,14 @@ declare const TInvoice: z.ZodObject<{
1855
1478
  total: number;
1856
1479
  seats?: number | undefined;
1857
1480
  }[];
1481
+ amount: number;
1482
+ invoiceNumber: string;
1483
+ dueDate: Date;
1858
1484
  type?: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other" | undefined;
1859
1485
  status?: "pending" | "cancelled" | "paid" | "overdue" | undefined;
1860
1486
  _id?: string | ObjectId | undefined;
1861
1487
  updatedAt?: Date | undefined;
1488
+ createdAt?: Date | undefined;
1862
1489
  metadata?: {
1863
1490
  description?: string | undefined;
1864
1491
  userId?: string | ObjectId | undefined;
@@ -1868,7 +1495,6 @@ declare const TInvoice: z.ZodObject<{
1868
1495
  subscriptionId?: string | ObjectId | undefined;
1869
1496
  billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
1870
1497
  } | undefined;
1871
- createdAt?: Date | undefined;
1872
1498
  }>;
1873
1499
  type TInvoice = z.infer<typeof TInvoice>;
1874
1500
  declare function useInvoiceModel(db: Db): {
@@ -1876,9 +1502,6 @@ declare function useInvoiceModel(db: Db): {
1876
1502
  collection: Collection<{
1877
1503
  type: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other";
1878
1504
  status: "pending" | "cancelled" | "paid" | "overdue";
1879
- amount: number;
1880
- invoiceNumber: string;
1881
- dueDate: Date;
1882
1505
  items: {
1883
1506
  description: string;
1884
1507
  unitPrice: number;
@@ -1886,8 +1509,12 @@ declare function useInvoiceModel(db: Db): {
1886
1509
  total: number;
1887
1510
  seats?: number | undefined;
1888
1511
  }[];
1512
+ amount: number;
1513
+ invoiceNumber: string;
1514
+ dueDate: Date;
1889
1515
  _id?: ObjectId | undefined;
1890
1516
  updatedAt?: Date | undefined;
1517
+ createdAt?: Date | undefined;
1891
1518
  metadata?: {
1892
1519
  description?: string | undefined;
1893
1520
  userId?: string | ObjectId | undefined;
@@ -1897,7 +1524,6 @@ declare function useInvoiceModel(db: Db): {
1897
1524
  subscriptionId?: string | ObjectId | undefined;
1898
1525
  billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
1899
1526
  } | undefined;
1900
- createdAt?: Date | undefined;
1901
1527
  }>;
1902
1528
  };
1903
1529
 
@@ -1908,9 +1534,6 @@ declare function useInvoiceRepo(): {
1908
1534
  getByDueDate: (id: string | ObjectId, dueDate: Date, status?: TInvoice["status"]) => Promise<{
1909
1535
  type: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other";
1910
1536
  status: "pending" | "cancelled" | "paid" | "overdue";
1911
- amount: number;
1912
- invoiceNumber: string;
1913
- dueDate: Date;
1914
1537
  items: {
1915
1538
  description: string;
1916
1539
  unitPrice: number;
@@ -1918,8 +1541,12 @@ declare function useInvoiceRepo(): {
1918
1541
  total: number;
1919
1542
  seats?: number | undefined;
1920
1543
  }[];
1544
+ amount: number;
1545
+ invoiceNumber: string;
1546
+ dueDate: Date;
1921
1547
  _id?: ObjectId | undefined;
1922
1548
  updatedAt?: Date | undefined;
1549
+ createdAt?: Date | undefined;
1923
1550
  metadata?: {
1924
1551
  description?: string | undefined;
1925
1552
  userId?: string | ObjectId | undefined;
@@ -1929,15 +1556,11 @@ declare function useInvoiceRepo(): {
1929
1556
  subscriptionId?: string | ObjectId | undefined;
1930
1557
  billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
1931
1558
  } | undefined;
1932
- createdAt?: Date | undefined;
1933
1559
  } | null>;
1934
1560
  updateStatusByInvoiceNumber: (invoiceNumber: string, status: TInvoice["status"], session?: ClientSession) => Promise<void>;
1935
1561
  getOverdueInvoices: (BATCH_SIZE?: number) => Promise<{
1936
1562
  type: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other";
1937
1563
  status: "pending" | "cancelled" | "paid" | "overdue";
1938
- amount: number;
1939
- invoiceNumber: string;
1940
- dueDate: Date;
1941
1564
  items: {
1942
1565
  description: string;
1943
1566
  unitPrice: number;
@@ -1945,8 +1568,12 @@ declare function useInvoiceRepo(): {
1945
1568
  total: number;
1946
1569
  seats?: number | undefined;
1947
1570
  }[];
1571
+ amount: number;
1572
+ invoiceNumber: string;
1573
+ dueDate: Date;
1948
1574
  _id?: ObjectId | undefined;
1949
1575
  updatedAt?: Date | undefined;
1576
+ createdAt?: Date | undefined;
1950
1577
  metadata?: {
1951
1578
  description?: string | undefined;
1952
1579
  userId?: string | ObjectId | undefined;
@@ -1956,7 +1583,6 @@ declare function useInvoiceRepo(): {
1956
1583
  subscriptionId?: string | ObjectId | undefined;
1957
1584
  billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
1958
1585
  } | undefined;
1959
- createdAt?: Date | undefined;
1960
1586
  }[]>;
1961
1587
  getBySubscriptionId: ({ page, search, limit, sort, id }?: {
1962
1588
  page?: number | undefined;
@@ -1972,9 +1598,6 @@ declare function useInvoiceRepo(): {
1972
1598
  getByNumber: (number: string) => Promise<{
1973
1599
  type: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other";
1974
1600
  status: "pending" | "cancelled" | "paid" | "overdue";
1975
- amount: number;
1976
- invoiceNumber: string;
1977
- dueDate: Date;
1978
1601
  items: {
1979
1602
  description: string;
1980
1603
  unitPrice: number;
@@ -1982,8 +1605,12 @@ declare function useInvoiceRepo(): {
1982
1605
  total: number;
1983
1606
  seats?: number | undefined;
1984
1607
  }[];
1608
+ amount: number;
1609
+ invoiceNumber: string;
1610
+ dueDate: Date;
1985
1611
  _id?: ObjectId | undefined;
1986
1612
  updatedAt?: Date | undefined;
1613
+ createdAt?: Date | undefined;
1987
1614
  metadata?: {
1988
1615
  description?: string | undefined;
1989
1616
  userId?: string | ObjectId | undefined;
@@ -1993,14 +1620,10 @@ declare function useInvoiceRepo(): {
1993
1620
  subscriptionId?: string | ObjectId | undefined;
1994
1621
  billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
1995
1622
  } | undefined;
1996
- createdAt?: Date | undefined;
1997
1623
  } | null>;
1998
1624
  getByTransactionId: (id: string) => Promise<{
1999
1625
  type: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other";
2000
1626
  status: "pending" | "cancelled" | "paid" | "overdue";
2001
- amount: number;
2002
- invoiceNumber: string;
2003
- dueDate: Date;
2004
1627
  items: {
2005
1628
  description: string;
2006
1629
  unitPrice: number;
@@ -2008,8 +1631,12 @@ declare function useInvoiceRepo(): {
2008
1631
  total: number;
2009
1632
  seats?: number | undefined;
2010
1633
  }[];
1634
+ amount: number;
1635
+ invoiceNumber: string;
1636
+ dueDate: Date;
2011
1637
  _id?: ObjectId | undefined;
2012
1638
  updatedAt?: Date | undefined;
1639
+ createdAt?: Date | undefined;
2013
1640
  metadata?: {
2014
1641
  description?: string | undefined;
2015
1642
  userId?: string | ObjectId | undefined;
@@ -2019,7 +1646,6 @@ declare function useInvoiceRepo(): {
2019
1646
  subscriptionId?: string | ObjectId | undefined;
2020
1647
  billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
2021
1648
  } | undefined;
2022
- createdAt?: Date | undefined;
2023
1649
  } | null>;
2024
1650
  };
2025
1651
 
@@ -2709,4 +2335,4 @@ declare const PAYPAL_API_URL: string;
2709
2335
  declare const XENDIT_SECRET_KEY: string;
2710
2336
  declare const XENDIT_BASE_URL: string;
2711
2337
 
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, MCapBldgAct, MComment, MEntity, MFile, MMember, MONGO_DB, MONGO_URI, MOrder, MOrg, MPaymentMethod, MPromoCode, MRole, MSubscription, MToken, MUser, MUserRole, MVerification, MWorkflow, 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, TAttachment, TBillingRecipient, TCapBldgAct, TCapBldgActAssmtCriteria, TCapBldgActBasicInfo, TCapBldgActInitRevEval, TComment, 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, TWorkflow, TWorkflowStep, VERIFICATION_FORGET_PASSWORD_DURATION, VERIFICATION_USER_INVITE_DURATION, XENDIT_BASE_URL, XENDIT_SECRET_KEY, addressSchema, isDev, schema, useAddressController, useAddressRepo, useAuthController, useAuthService, useCapBldgActController, useCapBldgActRepo, useCapBldgActService, useCommentController, useCommentRepo, useCommentService, useCounterModel, useCounterRepo, useEntityController, useEntityRepo, useEntityService, 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, useRoleService, useSubscriptionController, useSubscriptionRepo, useSubscriptionService, useTokenRepo, useUserController, useUserRepo, useUserService, useVerificationController, useVerificationRepo, useVerificationService, useWorkflowController, useWorkflowRepo, useWorkflowService, useXenditService, validateCardPayment, validateDirectDebit, validateEWalletPayment };
2338
+ 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 };