@eeplatform/core 1.6.2 → 1.7.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/dist/index.d.ts CHANGED
@@ -1,123 +1,28 @@
1
+ import { Request, Response, NextFunction } from 'express';
1
2
  import * as mongodb from 'mongodb';
2
3
  import { ObjectId, ClientSession, Db, Collection } from 'mongodb';
3
4
  import * as bson from 'bson';
4
- import { Request, Response, NextFunction } from 'express';
5
- import { z } from 'zod';
6
5
  import Joi from 'joi';
6
+ import { z } from 'zod';
7
7
 
8
- type TVerificationMetadata = {
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 = {
18
- _id?: ObjectId;
19
- type: string;
20
- email: string;
21
- metadata?: TVerificationMetadata;
22
- status?: string;
23
- createdAt: string | Date;
24
- updatedAt?: string | Date | null;
25
- expireAt: string | Date;
26
- };
27
- declare class MVerification implements TVerification {
28
- _id?: ObjectId;
29
- type: string;
30
- email: string;
31
- metadata?: TVerificationMetadata;
32
- status?: string;
33
- createdAt: string | Date;
34
- updatedAt?: string | Date | null;
35
- expireAt: string | Date;
36
- constructor(value: TVerification);
37
- }
38
-
39
- declare function useVerificationRepo(): {
40
- createIndexes: () => Promise<void>;
41
- add: (value: TVerification, session?: ClientSession) => Promise<ObjectId>;
42
- getVerifications: ({ search, page, limit, sort, status, type, email, app, }?: {
43
- search?: string | undefined;
44
- page?: number | undefined;
45
- limit?: number | undefined;
46
- sort?: Record<string, number> | undefined;
47
- status?: string | undefined;
48
- type?: string | string[] | undefined;
49
- email?: string | undefined;
50
- app?: string | undefined;
51
- }) => Promise<TVerification[] | {
52
- items: any[];
53
- pages: number;
54
- pageRange: string;
55
- }>;
56
- getById: (_id: ObjectId | string) => Promise<TVerification | null>;
57
- getByIdByType: (type: string) => Promise<TVerification[] | TVerification[][]>;
58
- updateStatusById: (_id: ObjectId | string, status: string, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
59
- };
60
-
61
- type TKeyValuePair<K extends string | number | symbol = string, V = any> = {
62
- [key in K]: V;
63
- };
64
-
65
- declare function useVerificationService(): {
66
- createForgetPassword: (email: string) => Promise<string>;
67
- createUserInvite: ({ email, metadata, }: {
8
+ declare function useAuthService(): {
9
+ login: ({ email, password }?: {
68
10
  email: string;
69
- metadata: TVerificationMetadata;
70
- }) => Promise<bson.ObjectId>;
71
- verify: (id: string) => Promise<TVerification | "Member invitation verified successfully.">;
72
- getById: (id: string) => Promise<TVerification>;
73
- getVerifications: ({ search, page, status, type, email, limit, app, }?: {
74
- search?: string | undefined;
75
- page?: number | undefined;
76
- status?: string | undefined;
77
- type?: string | undefined;
78
- email?: string | undefined;
79
- limit?: number | undefined;
80
- app?: string | undefined;
81
- }) => Promise<TVerification[] | {
82
- items: any[];
83
- pages: number;
84
- pageRange: string;
11
+ password: string;
12
+ }) => Promise<{
13
+ sid: string;
14
+ user: string;
85
15
  }>;
86
- cancelUserInvitation: (id: string) => Promise<void>;
87
- updateStatusById: (_id: string, status: string) => Promise<string>;
88
- signUp: ({ email, metadata, }: {
89
- email: string;
90
- metadata: TKeyValuePair;
91
- }) => Promise<bson.ObjectId>;
92
- };
93
-
94
- declare function useVerificationController(): {
95
- getVerifications: (req: Request, res: Response, next: NextFunction) => Promise<void>;
96
- createUserInvite: (req: Request, res: Response, next: NextFunction) => Promise<void>;
97
- createForgetPassword: (req: Request, res: Response, next: NextFunction) => Promise<void>;
98
- verify: (req: Request, res: Response, next: NextFunction) => Promise<void>;
99
- cancelUserInvitation: (req: Request, res: Response, next: NextFunction) => Promise<Response<any, Record<string, any>> | undefined>;
100
- };
101
-
102
- type TToken = {
103
- token: string;
104
- user: ObjectId;
105
- createdAt?: string;
16
+ refreshToken: (token: string) => Promise<string>;
17
+ logout: (sid: string) => Promise<string>;
106
18
  };
107
- declare class MToken implements TToken {
108
- token: string;
109
- user: ObjectId;
110
- createdAt?: string;
111
- constructor(value: TToken);
112
- }
113
19
 
114
- declare function useTokenRepo(): {
115
- createToken: ({ token, user }?: {
116
- token: string;
117
- user: string | ObjectId;
118
- }) => Promise<string>;
119
- getToken: (token: string) => Promise<any>;
120
- deleteToken: (token: string) => Promise<mongodb.DeleteResult>;
20
+ declare function useAuthController(): {
21
+ login: (req: Request, res: Response, next: NextFunction) => Promise<void>;
22
+ refreshToken: (req: Request, res: Response, next: NextFunction) => Promise<void>;
23
+ logout: (req: Request, res: Response, next: NextFunction) => Promise<void>;
24
+ resetPassword: (req: Request, res: Response, next: NextFunction) => Promise<void>;
25
+ signUp: (req: Request, res: Response, next: NextFunction) => Promise<void>;
121
26
  };
122
27
 
123
28
  type TUserRole = {
@@ -231,7 +136,7 @@ declare function useUserService(): {
231
136
  type?: string | undefined;
232
137
  limit?: number | undefined;
233
138
  }) => Promise<Record<string, any>>;
234
- createUser: (value: Pick<TUser, "email" | "firstName" | "middleName" | "lastName" | "password" | "prefix" | "suffix">) => Promise<ObjectId>;
139
+ createUser: (value: Pick<TUser, "firstName" | "middleName" | "lastName" | "email" | "password" | "prefix" | "suffix">) => Promise<ObjectId>;
235
140
  resetPassword: (id: string, newPassword: string, passwordConfirmation: string) => Promise<string>;
236
141
  updateName: (_id: string, firstName?: string, lastName?: string) => Promise<string>;
237
142
  updateBirthday: (_id: string, month: string, day: number, year: number) => Promise<string>;
@@ -270,24 +175,63 @@ declare function useUserController(): {
270
175
  createUserByVerification: (req: Request, res: Response, next: NextFunction) => Promise<void>;
271
176
  };
272
177
 
273
- declare function useAuthService(): {
274
- login: ({ email, password }?: {
275
- email: string;
276
- password: string;
277
- }) => Promise<{
278
- sid: string;
279
- user: string;
280
- }>;
281
- refreshToken: (token: string) => Promise<string>;
282
- logout: (sid: string) => Promise<string>;
178
+ type TOrg = {
179
+ _id?: ObjectId;
180
+ name: string;
181
+ description: string;
182
+ type?: string;
183
+ sector: string;
184
+ sectorName?: string;
185
+ sectorType: string;
186
+ category: string;
187
+ email?: string;
188
+ contact?: string;
189
+ region?: string;
190
+ regionName?: string;
191
+ province?: string;
192
+ provinceName?: string;
193
+ cityMunicipality?: string;
194
+ cityMunicipalityName?: string;
195
+ barangay?: string;
196
+ barangayName?: string;
197
+ status?: string;
198
+ createdAt?: string;
199
+ updatedAt?: string;
200
+ deletedAt?: string;
201
+ };
202
+ declare const schemaOrg: Joi.ObjectSchema<any>;
203
+ declare function MOrg(value: TOrg): TOrg;
204
+
205
+ declare function useOrgRepo(): {
206
+ createIndexes: () => Promise<void>;
207
+ add: (value: TOrg, session?: ClientSession) => Promise<ObjectId>;
208
+ getAll: ({ search, page, limit, sort, status, }?: {
209
+ search?: string | undefined;
210
+ page?: number | undefined;
211
+ limit?: number | undefined;
212
+ sort?: {} | undefined;
213
+ status?: string | undefined;
214
+ }) => Promise<Record<string, any>>;
215
+ getById: (_id: string | ObjectId) => Promise<TOrg>;
216
+ updateFieldById: ({ _id, field, value }?: {
217
+ _id: string | ObjectId;
218
+ field: string;
219
+ value: string;
220
+ }, session?: ClientSession) => Promise<string>;
221
+ deleteById: (_id: string | ObjectId) => Promise<string>;
222
+ getByName: (name: string) => Promise<TOrg>;
283
223
  };
284
224
 
285
- declare function useAuthController(): {
286
- login: (req: Request, res: Response, next: NextFunction) => Promise<void>;
287
- refreshToken: (req: Request, res: Response, next: NextFunction) => Promise<void>;
288
- logout: (req: Request, res: Response, next: NextFunction) => Promise<void>;
289
- resetPassword: (req: Request, res: Response, next: NextFunction) => Promise<void>;
290
- signUp: (req: Request, res: Response, next: NextFunction) => Promise<void>;
225
+ declare function useOrgService(): {
226
+ add: (value: TOrg) => Promise<string>;
227
+ };
228
+
229
+ declare function useOrgController(): {
230
+ createOrg: (req: Request, res: Response, next: NextFunction) => Promise<void>;
231
+ getOrgsByUserId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
232
+ getByName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
233
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
234
+ getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
291
235
  };
292
236
 
293
237
  type TRole = {
@@ -346,6 +290,16 @@ declare function useRoleRepo(): {
346
290
  updatePermissionsById: (_id: string | ObjectId, permissions: TRole["permissions"], session?: ClientSession) => Promise<string>;
347
291
  };
348
292
 
293
+ declare function useRoleController(): {
294
+ createRole: (req: Request, res: Response, next: NextFunction) => Promise<void>;
295
+ getRoles: (req: Request, res: Response, next: NextFunction) => Promise<void>;
296
+ getRoleByUserId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
297
+ getRoleById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
298
+ updateRole: (req: Request, res: Response, next: NextFunction) => Promise<void>;
299
+ deleteRole: (req: Request, res: Response, next: NextFunction) => Promise<void>;
300
+ updatePermissionsById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
301
+ };
302
+
349
303
  type TFile = {
350
304
  _id?: ObjectId;
351
305
  name: string;
@@ -379,557 +333,98 @@ declare function useFileController(): {
379
333
  deleteFile: (req: Request, res: Response, next: NextFunction) => Promise<void>;
380
334
  };
381
335
 
382
- declare function useRoleController(): {
383
- createRole: (req: Request, res: Response, next: NextFunction) => Promise<void>;
384
- getRoles: (req: Request, res: Response, next: NextFunction) => Promise<void>;
385
- getRoleByUserId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
386
- getRoleById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
387
- updateRole: (req: Request, res: Response, next: NextFunction) => Promise<void>;
388
- deleteRole: (req: Request, res: Response, next: NextFunction) => Promise<void>;
389
- updatePermissionsById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
336
+ type TVerificationMetadata = {
337
+ name?: string;
338
+ app?: string;
339
+ role?: string;
340
+ roleName?: string;
341
+ referralCode?: string;
342
+ org?: string | ObjectId;
343
+ orgName?: string;
390
344
  };
391
-
392
- type TEntity = {
345
+ type TVerification = {
393
346
  _id?: ObjectId;
394
- name: string;
395
- username: string;
396
- type: "strand" | "office" | "bureau" | "service" | "person";
397
- createdAt?: string;
398
- updatedAt?: string;
399
- deletedAt?: string;
347
+ type: string;
348
+ email: string;
349
+ metadata?: TVerificationMetadata;
400
350
  status?: string;
351
+ createdAt: string | Date;
352
+ updatedAt?: string | Date | null;
353
+ expireAt: string | Date;
401
354
  };
402
- declare class MEntity implements TEntity {
355
+ declare class MVerification implements TVerification {
403
356
  _id?: ObjectId;
404
- name: string;
405
- username: string;
406
- type: "strand" | "office" | "bureau" | "service" | "person";
407
- createdAt?: string;
408
- updatedAt?: string;
409
- deletedAt?: string;
357
+ type: string;
358
+ email: string;
359
+ metadata?: TVerificationMetadata;
410
360
  status?: string;
411
- constructor(value: TEntity);
361
+ createdAt: string | Date;
362
+ updatedAt?: string | Date | null;
363
+ expireAt: string | Date;
364
+ constructor(value: TVerification);
412
365
  }
413
366
 
414
- declare function useEntityRepo(): {
415
- createIndex: () => Promise<void>;
416
- createUniqueIndex: () => Promise<void>;
417
- createEntity: (value: TEntity, session?: ClientSession) => Promise<string>;
418
- getEntities: ({ search, page, limit, sort, }?: {
367
+ declare function useVerificationRepo(): {
368
+ createIndexes: () => Promise<void>;
369
+ add: (value: TVerification, session?: ClientSession) => Promise<ObjectId>;
370
+ getVerifications: ({ search, page, limit, sort, status, type, email, app, }?: {
419
371
  search?: string | undefined;
420
372
  page?: number | undefined;
421
373
  limit?: number | undefined;
422
- sort?: {} | undefined;
423
- }) => Promise<Record<string, any>>;
424
- updateEntityFieldById: ({ _id, field, value }?: {
425
- _id: string | ObjectId;
426
- field: string;
427
- value: string;
428
- }, session?: ClientSession) => Promise<string>;
429
- deleteEntity: (_id: string | ObjectId) => Promise<mongodb.UpdateResult<bson.Document>>;
430
- };
431
-
432
- declare function useEntityController(): {
433
- createEntity: (req: Request, res: Response, next: NextFunction) => Promise<void>;
434
- getEntities: (req: Request, res: Response, next: NextFunction) => Promise<void>;
435
- updateEntityFieldById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
436
- deleteEntity: (req: Request, res: Response, next: NextFunction) => Promise<void>;
437
- };
438
-
439
- declare const CustomerSchema: z.ZodEffects<z.ZodObject<{
440
- reference_id: z.ZodString;
441
- type: z.ZodEnum<["INDIVIDUAL", "BUSINESS"]>;
442
- individual_detail: z.ZodOptional<z.ZodLazy<z.ZodObject<{
443
- given_names: z.ZodString;
444
- surname: z.ZodOptional<z.ZodString>;
445
- nationality: z.ZodOptional<z.ZodString>;
446
- place_of_birth: z.ZodOptional<z.ZodString>;
447
- date_of_birth: z.ZodOptional<z.ZodString>;
448
- gender: z.ZodOptional<z.ZodEnum<["MALE", "FEMALE", "OTHER"]>>;
449
- employment: z.ZodOptional<z.ZodString>;
450
- employer_name: z.ZodOptional<z.ZodString>;
451
- nature_of_business: z.ZodOptional<z.ZodString>;
452
- role_description: z.ZodOptional<z.ZodString>;
453
- }, "strip", z.ZodTypeAny, {
454
- given_names: string;
455
- gender?: "MALE" | "FEMALE" | "OTHER" | undefined;
456
- surname?: string | undefined;
457
- nationality?: string | undefined;
458
- place_of_birth?: string | undefined;
459
- date_of_birth?: string | undefined;
460
- employment?: string | undefined;
461
- employer_name?: string | undefined;
462
- nature_of_business?: string | undefined;
463
- role_description?: string | undefined;
464
- }, {
465
- given_names: string;
466
- gender?: "MALE" | "FEMALE" | "OTHER" | undefined;
467
- surname?: string | undefined;
468
- nationality?: string | undefined;
469
- place_of_birth?: string | undefined;
470
- date_of_birth?: string | undefined;
471
- employment?: string | undefined;
472
- employer_name?: string | undefined;
473
- nature_of_business?: string | undefined;
474
- role_description?: string | undefined;
475
- }>>>;
476
- business_detail: z.ZodOptional<z.ZodLazy<z.ZodObject<{
477
- business_name: z.ZodString;
478
- trading_name: z.ZodOptional<z.ZodString>;
479
- business_type: z.ZodEnum<["CORPORATION", "SOLE_PROPRIETOR", "PARTNERSHIP", "COOPERATIVE", "TRUST", "NON_PROFIT", "GOVERNMENT"]>;
480
- nature_of_business: z.ZodOptional<z.ZodString>;
481
- business_domicile: z.ZodOptional<z.ZodString>;
482
- date_of_registration: z.ZodOptional<z.ZodString>;
483
- }, "strip", z.ZodTypeAny, {
484
- business_name: string;
485
- business_type: "CORPORATION" | "SOLE_PROPRIETOR" | "PARTNERSHIP" | "COOPERATIVE" | "TRUST" | "NON_PROFIT" | "GOVERNMENT";
486
- nature_of_business?: string | undefined;
487
- trading_name?: string | undefined;
488
- business_domicile?: string | undefined;
489
- date_of_registration?: string | undefined;
490
- }, {
491
- business_name: string;
492
- business_type: "CORPORATION" | "SOLE_PROPRIETOR" | "PARTNERSHIP" | "COOPERATIVE" | "TRUST" | "NON_PROFIT" | "GOVERNMENT";
493
- nature_of_business?: string | undefined;
494
- trading_name?: string | undefined;
495
- business_domicile?: string | undefined;
496
- date_of_registration?: string | undefined;
497
- }>>>;
498
- mobile_number: z.ZodOptional<z.ZodString>;
499
- phone_number: z.ZodOptional<z.ZodString>;
500
- hashed_phone_number: z.ZodOptional<z.ZodString>;
501
- email: z.ZodOptional<z.ZodString>;
502
- addresses: z.ZodOptional<z.ZodArray<z.ZodObject<{
503
- country: z.ZodString;
504
- street_line1: z.ZodOptional<z.ZodString>;
505
- street_line2: z.ZodOptional<z.ZodString>;
506
- city: z.ZodOptional<z.ZodString>;
507
- province_state: z.ZodOptional<z.ZodString>;
508
- postal_code: z.ZodOptional<z.ZodString>;
509
- category: z.ZodOptional<z.ZodEnum<["HOME", "WORK", "PROVINCIAL"]>>;
510
- is_primary: z.ZodOptional<z.ZodBoolean>;
511
- }, "strip", z.ZodTypeAny, {
512
- country: string;
513
- street_line1?: string | undefined;
514
- street_line2?: string | undefined;
515
- city?: string | undefined;
516
- province_state?: string | undefined;
517
- postal_code?: string | undefined;
518
- category?: "HOME" | "WORK" | "PROVINCIAL" | undefined;
519
- is_primary?: boolean | undefined;
520
- }, {
521
- country: string;
522
- street_line1?: string | undefined;
523
- street_line2?: string | undefined;
524
- city?: string | undefined;
525
- province_state?: string | undefined;
526
- postal_code?: string | undefined;
527
- category?: "HOME" | "WORK" | "PROVINCIAL" | undefined;
528
- is_primary?: boolean | undefined;
529
- }>, "many">>;
530
- identity_accounts: z.ZodOptional<z.ZodArray<z.ZodObject<{
531
- type: z.ZodEnum<["BANK_ACCOUNT", "EWALLET", "CREDIT_CARD", "PAY_LATER", "OTC", "QR_CODE", "SOCIAL_MEDIA"]>;
532
- company: z.ZodOptional<z.ZodString>;
533
- description: z.ZodOptional<z.ZodString>;
534
- country: z.ZodOptional<z.ZodString>;
535
- properties: z.ZodOptional<z.ZodAny>;
536
- }, "strip", z.ZodTypeAny, {
537
- type: "BANK_ACCOUNT" | "EWALLET" | "CREDIT_CARD" | "PAY_LATER" | "OTC" | "QR_CODE" | "SOCIAL_MEDIA";
538
- country?: string | undefined;
539
- company?: string | undefined;
540
- description?: string | undefined;
541
- properties?: any;
542
- }, {
543
- type: "BANK_ACCOUNT" | "EWALLET" | "CREDIT_CARD" | "PAY_LATER" | "OTC" | "QR_CODE" | "SOCIAL_MEDIA";
544
- country?: string | undefined;
545
- company?: string | undefined;
546
- description?: string | undefined;
547
- properties?: any;
548
- }>, "many">>;
549
- kyc_documents: z.ZodOptional<z.ZodArray<z.ZodObject<{
550
- country: z.ZodString;
551
- type: z.ZodEnum<["BIRTH_CERTIFICATE", "BANK_STATEMENT", "DRIVING_LICENSE", "IDENTITY_CARD", "PASSPORT", "VISA", "BUSINESS_REGISTRATION", "BUSINESS_LICENSE"]>;
552
- sub_type: z.ZodOptional<z.ZodEnum<["NATIONAL_ID", "CONSULAR_ID", "VOTER_ID", "POSTAL_ID", "RESIDENCE_PERMIT", "TAX_ID", "STUDENT_ID", "MILITARY_ID", "MEDICAL_ID"]>>;
553
- document_name: z.ZodOptional<z.ZodString>;
554
- document_number: z.ZodOptional<z.ZodString>;
555
- expires_at: z.ZodOptional<z.ZodString>;
556
- holder_name: z.ZodOptional<z.ZodString>;
557
- document_images: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
558
- }, "strip", z.ZodTypeAny, {
559
- type: "BIRTH_CERTIFICATE" | "BANK_STATEMENT" | "DRIVING_LICENSE" | "IDENTITY_CARD" | "PASSPORT" | "VISA" | "BUSINESS_REGISTRATION" | "BUSINESS_LICENSE";
560
- country: string;
561
- sub_type?: "NATIONAL_ID" | "CONSULAR_ID" | "VOTER_ID" | "POSTAL_ID" | "RESIDENCE_PERMIT" | "TAX_ID" | "STUDENT_ID" | "MILITARY_ID" | "MEDICAL_ID" | undefined;
562
- document_name?: string | undefined;
563
- document_number?: string | undefined;
564
- expires_at?: string | undefined;
565
- holder_name?: string | undefined;
566
- document_images?: string[] | undefined;
567
- }, {
568
- type: "BIRTH_CERTIFICATE" | "BANK_STATEMENT" | "DRIVING_LICENSE" | "IDENTITY_CARD" | "PASSPORT" | "VISA" | "BUSINESS_REGISTRATION" | "BUSINESS_LICENSE";
569
- country: string;
570
- sub_type?: "NATIONAL_ID" | "CONSULAR_ID" | "VOTER_ID" | "POSTAL_ID" | "RESIDENCE_PERMIT" | "TAX_ID" | "STUDENT_ID" | "MILITARY_ID" | "MEDICAL_ID" | undefined;
571
- document_name?: string | undefined;
572
- document_number?: string | undefined;
573
- expires_at?: string | undefined;
574
- holder_name?: string | undefined;
575
- document_images?: string[] | undefined;
576
- }>, "many">>;
577
- description: z.ZodOptional<z.ZodString>;
578
- date_of_registration: z.ZodOptional<z.ZodString>;
579
- }, "strip", z.ZodTypeAny, {
580
- type: "INDIVIDUAL" | "BUSINESS";
581
- reference_id: string;
582
- email?: string | undefined;
583
- description?: string | undefined;
584
- date_of_registration?: string | undefined;
585
- individual_detail?: {
586
- given_names: string;
587
- gender?: "MALE" | "FEMALE" | "OTHER" | undefined;
588
- surname?: string | undefined;
589
- nationality?: string | undefined;
590
- place_of_birth?: string | undefined;
591
- date_of_birth?: string | undefined;
592
- employment?: string | undefined;
593
- employer_name?: string | undefined;
594
- nature_of_business?: string | undefined;
595
- role_description?: string | undefined;
596
- } | undefined;
597
- business_detail?: {
598
- business_name: string;
599
- business_type: "CORPORATION" | "SOLE_PROPRIETOR" | "PARTNERSHIP" | "COOPERATIVE" | "TRUST" | "NON_PROFIT" | "GOVERNMENT";
600
- nature_of_business?: string | undefined;
601
- trading_name?: string | undefined;
602
- business_domicile?: string | undefined;
603
- date_of_registration?: string | undefined;
604
- } | undefined;
605
- mobile_number?: string | undefined;
606
- phone_number?: string | undefined;
607
- hashed_phone_number?: string | undefined;
608
- addresses?: {
609
- country: string;
610
- street_line1?: string | undefined;
611
- street_line2?: string | undefined;
612
- city?: string | undefined;
613
- province_state?: string | undefined;
614
- postal_code?: string | undefined;
615
- category?: "HOME" | "WORK" | "PROVINCIAL" | undefined;
616
- is_primary?: boolean | undefined;
617
- }[] | undefined;
618
- identity_accounts?: {
619
- type: "BANK_ACCOUNT" | "EWALLET" | "CREDIT_CARD" | "PAY_LATER" | "OTC" | "QR_CODE" | "SOCIAL_MEDIA";
620
- country?: string | undefined;
621
- company?: string | undefined;
622
- description?: string | undefined;
623
- properties?: any;
624
- }[] | undefined;
625
- kyc_documents?: {
626
- type: "BIRTH_CERTIFICATE" | "BANK_STATEMENT" | "DRIVING_LICENSE" | "IDENTITY_CARD" | "PASSPORT" | "VISA" | "BUSINESS_REGISTRATION" | "BUSINESS_LICENSE";
627
- country: string;
628
- sub_type?: "NATIONAL_ID" | "CONSULAR_ID" | "VOTER_ID" | "POSTAL_ID" | "RESIDENCE_PERMIT" | "TAX_ID" | "STUDENT_ID" | "MILITARY_ID" | "MEDICAL_ID" | undefined;
629
- document_name?: string | undefined;
630
- document_number?: string | undefined;
631
- expires_at?: string | undefined;
632
- holder_name?: string | undefined;
633
- document_images?: string[] | undefined;
634
- }[] | undefined;
635
- }, {
636
- type: "INDIVIDUAL" | "BUSINESS";
637
- reference_id: string;
638
- email?: string | undefined;
639
- description?: string | undefined;
640
- date_of_registration?: string | undefined;
641
- individual_detail?: {
642
- given_names: string;
643
- gender?: "MALE" | "FEMALE" | "OTHER" | undefined;
644
- surname?: string | undefined;
645
- nationality?: string | undefined;
646
- place_of_birth?: string | undefined;
647
- date_of_birth?: string | undefined;
648
- employment?: string | undefined;
649
- employer_name?: string | undefined;
650
- nature_of_business?: string | undefined;
651
- role_description?: string | undefined;
652
- } | undefined;
653
- business_detail?: {
654
- business_name: string;
655
- business_type: "CORPORATION" | "SOLE_PROPRIETOR" | "PARTNERSHIP" | "COOPERATIVE" | "TRUST" | "NON_PROFIT" | "GOVERNMENT";
656
- nature_of_business?: string | undefined;
657
- trading_name?: string | undefined;
658
- business_domicile?: string | undefined;
659
- date_of_registration?: string | undefined;
660
- } | undefined;
661
- mobile_number?: string | undefined;
662
- phone_number?: string | undefined;
663
- hashed_phone_number?: string | undefined;
664
- addresses?: {
665
- country: string;
666
- street_line1?: string | undefined;
667
- street_line2?: string | undefined;
668
- city?: string | undefined;
669
- province_state?: string | undefined;
670
- postal_code?: string | undefined;
671
- category?: "HOME" | "WORK" | "PROVINCIAL" | undefined;
672
- is_primary?: boolean | undefined;
673
- }[] | undefined;
674
- identity_accounts?: {
675
- type: "BANK_ACCOUNT" | "EWALLET" | "CREDIT_CARD" | "PAY_LATER" | "OTC" | "QR_CODE" | "SOCIAL_MEDIA";
676
- country?: string | undefined;
677
- company?: string | undefined;
678
- description?: string | undefined;
679
- properties?: any;
680
- }[] | undefined;
681
- kyc_documents?: {
682
- type: "BIRTH_CERTIFICATE" | "BANK_STATEMENT" | "DRIVING_LICENSE" | "IDENTITY_CARD" | "PASSPORT" | "VISA" | "BUSINESS_REGISTRATION" | "BUSINESS_LICENSE";
683
- country: string;
684
- sub_type?: "NATIONAL_ID" | "CONSULAR_ID" | "VOTER_ID" | "POSTAL_ID" | "RESIDENCE_PERMIT" | "TAX_ID" | "STUDENT_ID" | "MILITARY_ID" | "MEDICAL_ID" | undefined;
685
- document_name?: string | undefined;
686
- document_number?: string | undefined;
687
- expires_at?: string | undefined;
688
- holder_name?: string | undefined;
689
- document_images?: string[] | undefined;
690
- }[] | undefined;
691
- }>, {
692
- type: "INDIVIDUAL" | "BUSINESS";
693
- reference_id: string;
694
- email?: string | undefined;
695
- description?: string | undefined;
696
- date_of_registration?: string | undefined;
697
- individual_detail?: {
698
- given_names: string;
699
- gender?: "MALE" | "FEMALE" | "OTHER" | undefined;
700
- surname?: string | undefined;
701
- nationality?: string | undefined;
702
- place_of_birth?: string | undefined;
703
- date_of_birth?: string | undefined;
704
- employment?: string | undefined;
705
- employer_name?: string | undefined;
706
- nature_of_business?: string | undefined;
707
- role_description?: string | undefined;
708
- } | undefined;
709
- business_detail?: {
710
- business_name: string;
711
- business_type: "CORPORATION" | "SOLE_PROPRIETOR" | "PARTNERSHIP" | "COOPERATIVE" | "TRUST" | "NON_PROFIT" | "GOVERNMENT";
712
- nature_of_business?: string | undefined;
713
- trading_name?: string | undefined;
714
- business_domicile?: string | undefined;
715
- date_of_registration?: string | undefined;
716
- } | undefined;
717
- mobile_number?: string | undefined;
718
- phone_number?: string | undefined;
719
- hashed_phone_number?: string | undefined;
720
- addresses?: {
721
- country: string;
722
- street_line1?: string | undefined;
723
- street_line2?: string | undefined;
724
- city?: string | undefined;
725
- province_state?: string | undefined;
726
- postal_code?: string | undefined;
727
- category?: "HOME" | "WORK" | "PROVINCIAL" | undefined;
728
- is_primary?: boolean | undefined;
729
- }[] | undefined;
730
- identity_accounts?: {
731
- type: "BANK_ACCOUNT" | "EWALLET" | "CREDIT_CARD" | "PAY_LATER" | "OTC" | "QR_CODE" | "SOCIAL_MEDIA";
732
- country?: string | undefined;
733
- company?: string | undefined;
734
- description?: string | undefined;
735
- properties?: any;
736
- }[] | undefined;
737
- kyc_documents?: {
738
- type: "BIRTH_CERTIFICATE" | "BANK_STATEMENT" | "DRIVING_LICENSE" | "IDENTITY_CARD" | "PASSPORT" | "VISA" | "BUSINESS_REGISTRATION" | "BUSINESS_LICENSE";
739
- country: string;
740
- sub_type?: "NATIONAL_ID" | "CONSULAR_ID" | "VOTER_ID" | "POSTAL_ID" | "RESIDENCE_PERMIT" | "TAX_ID" | "STUDENT_ID" | "MILITARY_ID" | "MEDICAL_ID" | undefined;
741
- document_name?: string | undefined;
742
- document_number?: string | undefined;
743
- expires_at?: string | undefined;
744
- holder_name?: string | undefined;
745
- document_images?: string[] | undefined;
746
- }[] | undefined;
747
- }, {
748
- type: "INDIVIDUAL" | "BUSINESS";
749
- reference_id: string;
750
- email?: string | undefined;
751
- description?: string | undefined;
752
- date_of_registration?: string | undefined;
753
- individual_detail?: {
754
- given_names: string;
755
- gender?: "MALE" | "FEMALE" | "OTHER" | undefined;
756
- surname?: string | undefined;
757
- nationality?: string | undefined;
758
- place_of_birth?: string | undefined;
759
- date_of_birth?: string | undefined;
760
- employment?: string | undefined;
761
- employer_name?: string | undefined;
762
- nature_of_business?: string | undefined;
763
- role_description?: string | undefined;
764
- } | undefined;
765
- business_detail?: {
766
- business_name: string;
767
- business_type: "CORPORATION" | "SOLE_PROPRIETOR" | "PARTNERSHIP" | "COOPERATIVE" | "TRUST" | "NON_PROFIT" | "GOVERNMENT";
768
- nature_of_business?: string | undefined;
769
- trading_name?: string | undefined;
770
- business_domicile?: string | undefined;
771
- date_of_registration?: string | undefined;
772
- } | undefined;
773
- mobile_number?: string | undefined;
774
- phone_number?: string | undefined;
775
- hashed_phone_number?: string | undefined;
776
- addresses?: {
777
- country: string;
778
- street_line1?: string | undefined;
779
- street_line2?: string | undefined;
780
- city?: string | undefined;
781
- province_state?: string | undefined;
782
- postal_code?: string | undefined;
783
- category?: "HOME" | "WORK" | "PROVINCIAL" | undefined;
784
- is_primary?: boolean | undefined;
785
- }[] | undefined;
786
- identity_accounts?: {
787
- type: "BANK_ACCOUNT" | "EWALLET" | "CREDIT_CARD" | "PAY_LATER" | "OTC" | "QR_CODE" | "SOCIAL_MEDIA";
788
- country?: string | undefined;
789
- company?: string | undefined;
790
- description?: string | undefined;
791
- properties?: any;
792
- }[] | undefined;
793
- kyc_documents?: {
794
- type: "BIRTH_CERTIFICATE" | "BANK_STATEMENT" | "DRIVING_LICENSE" | "IDENTITY_CARD" | "PASSPORT" | "VISA" | "BUSINESS_REGISTRATION" | "BUSINESS_LICENSE";
795
- country: string;
796
- sub_type?: "NATIONAL_ID" | "CONSULAR_ID" | "VOTER_ID" | "POSTAL_ID" | "RESIDENCE_PERMIT" | "TAX_ID" | "STUDENT_ID" | "MILITARY_ID" | "MEDICAL_ID" | undefined;
797
- document_name?: string | undefined;
798
- document_number?: string | undefined;
799
- expires_at?: string | undefined;
800
- holder_name?: string | undefined;
801
- document_images?: string[] | undefined;
802
- }[] | undefined;
803
- }>;
804
- type TCustomer = z.infer<typeof CustomerSchema>;
805
-
806
- declare function useXenditService(): {
807
- createCustomer: (value: TCustomer) => Promise<any>;
808
- linkPaymentMethodEWallet: ({ customerId, type, success_return_url, failure_return_url, cancel_return_url, }?: {
809
- customerId?: string | undefined;
810
- type?: string | undefined;
811
- success_return_url?: string | undefined;
812
- failure_return_url?: string | undefined;
813
- cancel_return_url?: string | undefined;
814
- }) => Promise<any>;
815
- initGCashLinkingAndPaymentRequest: ({ amount, currency, countryCode, customerId, success_return_url, failure_return_url, }?: {
816
- amount?: number | undefined;
817
- currency?: string | undefined;
818
- countryCode?: string | undefined;
819
- customerId?: string | undefined;
820
- success_return_url?: string | undefined;
821
- failure_return_url?: string | undefined;
822
- }) => Promise<any>;
823
- initSubscription: ({ customer, currency, amount, paymentMethod, description, interval, seats, }?: {
824
- customer?: string | undefined;
825
- currency?: string | undefined;
826
- amount?: number | undefined;
827
- paymentMethod?: string | undefined;
828
- description?: string | undefined;
829
- interval?: string | undefined;
830
- seats?: number | undefined;
831
- }) => Promise<any>;
832
- linkPaymentMethodCard: ({ success_return_url, failure_return_url, card_number, expiry_month, expiry_year, cvv, cardholder_name, currency, }?: {
833
- success_return_url?: string | undefined;
834
- failure_return_url?: string | undefined;
835
- card_number?: string | undefined;
836
- expiry_month?: string | undefined;
837
- expiry_year?: string | undefined;
838
- cvv?: string | undefined;
839
- cardholder_name?: string | undefined;
840
- currency?: string | undefined;
841
- }) => Promise<any>;
842
- eWalletSubsequentPayment: ({ amount, currency, payment_method_id, customer_id, description, }?: {
843
- amount?: number | undefined;
844
- currency?: string | undefined;
845
- payment_method_id?: string | undefined;
846
- customer_id?: string | undefined;
847
- description?: string | undefined;
848
- }) => Promise<any>;
849
- checkSubscriptionStatus: (subscriptionId: string) => Promise<string>;
850
- cancelSubscription: (subscriptionId: string) => Promise<string>;
851
- getSubscription: (id: string) => Promise<any>;
852
- getSubscriptionCycles: (id: string) => Promise<any>;
853
- pay: (value: {
854
- amount: number;
855
- currency: string;
856
- payment_method_id: string;
857
- customer_id: string;
858
- description?: string;
859
- metadata?: Record<string, any>;
860
- }) => Promise<any>;
861
- getPaymentMethodById: (id: string) => Promise<any>;
862
- getCustomerById: (id: string) => Promise<any>;
863
- eWalletLinkOnly: (value: Record<string, any>) => Promise<any>;
864
- directDebitLinkOnly: (value: Record<string, any>) => Promise<any>;
865
- cardLinkOnly: (value: Record<string, any>) => Promise<any>;
866
- getPaymentMethodsByCustomerId: (customerId: string) => Promise<any>;
867
- updatePaymentMethodStatusById: (id: string, status: string) => Promise<any>;
868
- };
869
-
870
- type TPaymentMethod$1 = {
871
- _id?: ObjectId;
872
- user?: ObjectId | string;
873
- org?: ObjectId | string;
874
- name: string;
875
- description?: string;
876
- type: string;
877
- number: string;
878
- month_expiry?: string;
879
- year_expiry?: string;
880
- cvv?: string;
881
- paymentId: string;
882
- customerId?: string;
883
- status?: string;
884
- createdAt?: string;
885
- deletedAt?: string;
374
+ sort?: Record<string, number> | undefined;
375
+ status?: string | undefined;
376
+ type?: string | string[] | undefined;
377
+ email?: string | undefined;
378
+ app?: string | undefined;
379
+ }) => Promise<{
380
+ items: any[];
381
+ pages: number;
382
+ pageRange: string;
383
+ } | TVerification[]>;
384
+ getById: (_id: ObjectId | string) => Promise<TVerification | null>;
385
+ getByIdByType: (type: string) => Promise<TVerification[] | TVerification[][]>;
386
+ updateStatusById: (_id: ObjectId | string, status: string, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
886
387
  };
887
- declare function MPaymentMethod(value: TPaymentMethod$1): TPaymentMethod$1;
888
388
 
889
- declare function usePaymentMethodRepo(): {
890
- createIndex: () => Promise<void>;
891
- add: (value: TPaymentMethod$1, session?: ClientSession) => Promise<string>;
892
- getByUser: (user: string | ObjectId) => Promise<bson.Document[]>;
893
- getByOrg: (org: string | ObjectId) => Promise<bson.Document[]>;
894
- deleteById: (_id: string | ObjectId) => Promise<string>;
895
- createUniqueIndex: () => Promise<void>;
896
- getByPaymentMethodId: (paymentMethodId: string | ObjectId) => Promise<TPaymentMethod$1 | null>;
389
+ type TKeyValuePair<K extends string | number | symbol = string, V = any> = {
390
+ [key in K]: V;
897
391
  };
898
392
 
899
- declare function usePaymentMethodService(): {
900
- linkEWallet: ({ customer_id, type, success_return_url, failure_return_url, cancel_return_url, }?: {
901
- customer_id?: string | undefined;
393
+ declare function useVerificationService(): {
394
+ createForgetPassword: (email: string) => Promise<string>;
395
+ createUserInvite: ({ email, metadata, }: {
396
+ email: string;
397
+ metadata: TVerificationMetadata;
398
+ }) => Promise<bson.ObjectId>;
399
+ verify: (id: string) => Promise<TVerification | "Member invitation verified successfully.">;
400
+ getById: (id: string) => Promise<TVerification>;
401
+ getVerifications: ({ search, page, status, type, email, limit, app, }?: {
402
+ search?: string | undefined;
403
+ page?: number | undefined;
404
+ status?: string | undefined;
902
405
  type?: string | undefined;
903
- success_return_url?: string | undefined;
904
- failure_return_url?: string | undefined;
905
- cancel_return_url?: string | undefined;
406
+ email?: string | undefined;
407
+ limit?: number | undefined;
408
+ app?: string | undefined;
906
409
  }) => Promise<{
907
- paymentMethod: any;
908
- actions: any;
909
- }>;
910
- linkCard: ({ user, type, success_return_url, failure_return_url, card_number, expiry_month, expiry_year, cvv, cardholder_name, currency, }?: {
911
- user?: string | undefined;
912
- type?: string | undefined;
913
- success_return_url?: string | undefined;
914
- failure_return_url?: string | undefined;
915
- card_number?: string | undefined;
916
- expiry_month?: string | undefined;
917
- expiry_year?: string | undefined;
918
- cvv?: string | undefined;
919
- cardholder_name?: string | undefined;
920
- currency?: string | undefined;
921
- }) => Promise<any>;
410
+ items: any[];
411
+ pages: number;
412
+ pageRange: string;
413
+ } | TVerification[]>;
414
+ cancelUserInvitation: (id: string) => Promise<void>;
415
+ updateStatusById: (_id: string, status: string) => Promise<string>;
416
+ signUp: ({ email, metadata, }: {
417
+ email: string;
418
+ metadata: TKeyValuePair;
419
+ }) => Promise<bson.ObjectId>;
922
420
  };
923
421
 
924
- declare function usePaymentMethodController(): {
925
- linkEWallet: (req: Request, res: Response, next: NextFunction) => Promise<void>;
926
- linkCard: (req: Request, res: Response, next: NextFunction) => Promise<void>;
927
- getByUser: (req: Request, res: Response, next: NextFunction) => Promise<void>;
928
- getByOrg: (req: Request, res: Response, next: NextFunction) => Promise<void>;
929
- linkOnly: (req: Request, res: Response, next: NextFunction) => Promise<void>;
930
- getPaymentMethodById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
931
- getPaymentMethodsByCustomerId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
932
- updatePaymentMethodStatusById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
422
+ declare function useVerificationController(): {
423
+ getVerifications: (req: Request, res: Response, next: NextFunction) => Promise<void>;
424
+ createUserInvite: (req: Request, res: Response, next: NextFunction) => Promise<void>;
425
+ createForgetPassword: (req: Request, res: Response, next: NextFunction) => Promise<void>;
426
+ verify: (req: Request, res: Response, next: NextFunction) => Promise<void>;
427
+ cancelUserInvitation: (req: Request, res: Response, next: NextFunction) => Promise<Response<any, Record<string, any>> | undefined>;
933
428
  };
934
429
 
935
430
  type TAddress = {
@@ -953,7 +448,7 @@ declare function useAddressRepo(): {
953
448
  add: (value: TAddress, session?: ClientSession) => Promise<ObjectId>;
954
449
  getByUserId: (user: string | ObjectId) => Promise<TAddress | null>;
955
450
  getByOrgId: (org: string | ObjectId) => Promise<TAddress | null>;
956
- updateById: (_id: string | ObjectId, value: Pick<TAddress, "org" | "country" | "city" | "province" | "address" | "continuedAddress" | "postalCode" | "taxId">, session?: ClientSession) => Promise<string>;
451
+ updateById: (_id: string | ObjectId, value: Pick<TAddress, "org" | "province" | "country" | "address" | "continuedAddress" | "city" | "postalCode" | "taxId">, session?: ClientSession) => Promise<string>;
957
452
  };
958
453
 
959
454
  declare function useAddressController(): {
@@ -963,106 +458,6 @@ declare function useAddressController(): {
963
458
  updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
964
459
  };
965
460
 
966
- type TSector = {
967
- _id?: ObjectId;
968
- name: string;
969
- code?: string;
970
- type: string;
971
- levels?: string[];
972
- createdAt?: string;
973
- updatedAt?: string;
974
- deletedAt?: string;
975
- };
976
- declare const schemaSector: Joi.ObjectSchema<any>;
977
- declare function modelSector(value: TSector): TSector;
978
-
979
- declare function useSectorRepo(): {
980
- createIndexes: () => Promise<void>;
981
- add: (value: TSector, session?: ClientSession) => Promise<ObjectId>;
982
- getAll: ({ search, page, limit, sort }?: {
983
- search?: string | undefined;
984
- page?: number | undefined;
985
- limit?: number | undefined;
986
- sort?: {} | undefined;
987
- }) => Promise<Record<string, any>>;
988
- getById: (_id: string | ObjectId) => Promise<TSector>;
989
- updateFieldById: ({ _id, field, value }?: {
990
- _id: string | ObjectId;
991
- field: string;
992
- value: string;
993
- }, session?: ClientSession) => Promise<string>;
994
- deleteById: (_id: string | ObjectId) => Promise<string>;
995
- getByName: (name: string) => Promise<TSector>;
996
- };
997
-
998
- declare function useSectorController(): {
999
- add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1000
- getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1001
- getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1002
- getByName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1003
- updateField: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1004
- deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1005
- };
1006
-
1007
- type TOrg = {
1008
- _id?: ObjectId;
1009
- name: string;
1010
- description: string;
1011
- type?: string;
1012
- sector: string;
1013
- sectorName?: string;
1014
- sectorType: string;
1015
- category: string;
1016
- email?: string;
1017
- contact?: string;
1018
- region?: string;
1019
- regionName?: string;
1020
- province?: string;
1021
- provinceName?: string;
1022
- cityMunicipality?: string;
1023
- cityMunicipalityName?: string;
1024
- barangay?: string;
1025
- barangayName?: string;
1026
- status?: string;
1027
- createdAt?: string;
1028
- updatedAt?: string;
1029
- deletedAt?: string;
1030
- };
1031
- declare const schemaOrg: Joi.ObjectSchema<any>;
1032
- declare function MOrg(value: TOrg): TOrg;
1033
-
1034
- declare function useOrgRepo(): {
1035
- createIndexes: () => Promise<void>;
1036
- add: (value: TOrg, session?: ClientSession) => Promise<ObjectId>;
1037
- getAll: ({ search, page, limit, sort, status, }?: {
1038
- search?: string | undefined;
1039
- page?: number | undefined;
1040
- limit?: number | undefined;
1041
- sort?: {} | undefined;
1042
- status?: string | undefined;
1043
- }) => Promise<Record<string, any>>;
1044
- getById: (_id: string | ObjectId) => Promise<TOrg>;
1045
- updateFieldById: ({ _id, field, value }?: {
1046
- _id: string | ObjectId;
1047
- field: string;
1048
- value: string;
1049
- }, session?: ClientSession) => Promise<string>;
1050
- deleteById: (_id: string | ObjectId) => Promise<string>;
1051
- getByName: (name: string) => Promise<TOrg>;
1052
- };
1053
-
1054
- declare function useOrgService(): {
1055
- add: (value: TOrg) => Promise<string>;
1056
- };
1057
-
1058
- declare function useOrgController(): {
1059
- createOrg: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1060
- getOrgsByUserId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1061
- getByName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1062
- getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1063
- getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1064
- };
1065
-
1066
461
  type TMember = {
1067
462
  _id?: ObjectId;
1068
463
  org?: string | ObjectId;
@@ -1110,7 +505,7 @@ declare function useMemberRepo(): {
1110
505
  name: string;
1111
506
  }[]>;
1112
507
  updateStatusByUserId: (user: string | ObjectId, status: string) => Promise<string>;
1113
- updateName: (value: Pick<TMember, "name" | "user">, session?: ClientSession) => Promise<string>;
508
+ updateName: (value: Pick<TMember, "user" | "name">, session?: ClientSession) => Promise<string>;
1114
509
  getByUserId: (user: string | ObjectId) => Promise<TMember | null>;
1115
510
  getOrgsByMembership: ({ search, limit, page, user }?: {
1116
511
  search: string;
@@ -1138,894 +533,170 @@ declare function useMemberController(): {
1138
533
  getByUserType: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1139
534
  };
1140
535
 
1141
- declare const schema: Joi.ObjectSchema<any>;
1142
-
1143
- type TPromoType = "tiered" | "fixed";
1144
- type TPromoTier = {
1145
- min: number;
1146
- max: number;
1147
- price: number;
536
+ type TBuilding = {
537
+ _id?: ObjectId;
538
+ school: ObjectId;
539
+ serial?: string;
540
+ name: string;
541
+ levels: number;
542
+ createdAt?: Date | string;
543
+ updatedAt?: Date | string;
544
+ deletedAt?: Date | string;
545
+ status?: string;
1148
546
  };
1149
- type TPromoCode = {
547
+ declare const schemaBuilding: Joi.ObjectSchema<any>;
548
+ type TBuildingUnit = {
1150
549
  _id?: ObjectId;
1151
- code: string;
550
+ school: ObjectId | string;
551
+ name?: string;
552
+ building: ObjectId | string;
553
+ buildingName?: string;
554
+ level: number;
555
+ category: string;
556
+ type: string;
557
+ seating_capacity: number;
558
+ standing_capacity: number;
1152
559
  description?: string;
1153
- type: TPromoType;
1154
- tiers?: TPromoTier[];
1155
- fixed_rate?: number;
1156
- appliesTo?: string;
1157
- createdAt?: string;
1158
- expiresAt?: string;
1159
- assignedTo?: string | ObjectId;
1160
- status?: "active" | "expired" | "disabled";
560
+ unit_of_measurement: string;
561
+ area: number;
562
+ status: string;
563
+ createdAt?: Date | string;
564
+ updatedAt?: Date | string;
565
+ deletedAt?: Date | string;
566
+ };
567
+ declare const schemaBuildingUnit: Joi.ObjectSchema<any>;
568
+ declare const schemaUpdateOptions: Joi.ObjectSchema<any>;
569
+ declare function MBuilding(value: TBuilding): {
570
+ _id: ObjectId | undefined;
571
+ school: ObjectId;
572
+ serial: string;
573
+ name: string;
574
+ levels: number;
575
+ status: string;
576
+ createdAt: string | Date;
577
+ updatedAt: string | Date;
578
+ deletedAt: string | Date;
579
+ };
580
+ declare function MBuildingUnit(value: TBuildingUnit): {
581
+ _id: ObjectId | undefined;
582
+ school: ObjectId;
583
+ name: string;
584
+ building: ObjectId;
585
+ buildingName: string;
586
+ level: number;
587
+ category: string;
588
+ type: string;
589
+ seating_capacity: number;
590
+ standing_capacity: number;
591
+ description: string;
592
+ unit_of_measurement: string;
593
+ area: number;
594
+ status: string;
595
+ createdAt: string | Date;
596
+ updatedAt: string | Date;
597
+ deletedAt: string | Date;
1161
598
  };
1162
- declare function MPromoCode(data: TPromoCode): TPromoCode;
1163
599
 
1164
- declare function usePromoCodeRepo(): {
1165
- createIndex: () => Promise<void>;
1166
- createUniqueIndex: () => Promise<void>;
1167
- add: (value: TPromoCode) => Promise<void>;
1168
- getByCode: (code: string, type?: string, assigned?: boolean | null) => Promise<TPromoCode | null>;
1169
- getPromoCodes: ({ search, page, limit, sort, status, type, }?: {
600
+ declare function useBuildingRepo(): {
601
+ createIndexes: () => Promise<void>;
602
+ add: (value: TBuilding, session?: ClientSession) => Promise<ObjectId>;
603
+ getAll: ({ search, page, limit, sort, school, status, }?: {
1170
604
  search?: string | undefined;
1171
605
  page?: number | undefined;
1172
606
  limit?: number | undefined;
1173
607
  sort?: {} | undefined;
608
+ school?: string | undefined;
1174
609
  status?: string | undefined;
1175
- type?: string | undefined;
1176
610
  }) => Promise<Record<string, any>>;
1177
- assignByUserId: ({ user, code }?: {
1178
- user: string | ObjectId;
1179
- code: string;
1180
- }, session?: ClientSession) => Promise<void>;
1181
- getById: (_id: string | ObjectId) => Promise<TPromoCode | null>;
611
+ getById: (_id: string | ObjectId) => Promise<TBuilding | null>;
612
+ updateById: (_id: ObjectId | string, value: {
613
+ name: string;
614
+ serial: string;
615
+ levels: number;
616
+ }, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
617
+ deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
1182
618
  };
1183
619
 
1184
- declare function usePromoCodeController(): {
1185
- add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1186
- getByCode: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1187
- getPromoCodes: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1188
- getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
620
+ declare function useBuildingService(): {
621
+ updateById: (id: string, data: {
622
+ name: string;
623
+ levels: number;
624
+ serial: string;
625
+ }) => Promise<mongodb.UpdateResult<bson.Document>>;
626
+ deleteById: (id: string) => Promise<string>;
1189
627
  };
1190
628
 
1191
- type TOrderMetadata = {
1192
- subscriptionId?: ObjectId | string;
1193
- cycle?: number;
1194
- seats?: number;
1195
- promoCode?: string;
629
+ declare function useBuildingController(): {
630
+ createBuilding: (req: Request, res: Response, next: NextFunction) => Promise<void>;
631
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
632
+ getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
633
+ updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
634
+ deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1196
635
  };
1197
- type TOrder = {
1198
- _id?: ObjectId;
1199
- payment?: string;
1200
- user?: ObjectId | string;
1201
- org?: ObjectId | string;
1202
- type: string;
1203
- amount: number;
1204
- currency: string;
1205
- description?: string;
1206
- metadata?: TOrderMetadata;
1207
- status?: string;
1208
- createdAt?: string;
1209
- updatedAt?: string;
1210
- deletedAt?: string;
1211
- };
1212
- declare function MOrder(value: TOrder): TOrder;
1213
-
1214
- declare function useOrderRepo(): {
1215
- createIndex: () => void;
1216
- add: (value: TOrder, session?: ClientSession) => void;
1217
- getOrders: ({ search, page, limit, sort, status, type, id, }?: {
1218
- search?: string | undefined;
1219
- page?: number | undefined;
1220
- limit?: number | undefined;
1221
- sort?: {} | undefined;
1222
- status?: string | undefined;
1223
- type?: string | undefined;
1224
- id?: string | undefined;
1225
- }) => Promise<Record<string, any>>;
1226
- };
1227
-
1228
- declare function useOrderController(): {
1229
- getOrders: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1230
- };
1231
-
1232
- type TBillingRecipient = {
1233
- addedAt?: Date | string;
1234
- email: string;
1235
- };
1236
- type TSubscription = {
1237
- _id?: ObjectId;
1238
- user?: ObjectId | string;
1239
- org?: ObjectId | string;
1240
- customerId?: string;
1241
- paymentMethodId?: string;
1242
- amount: number;
1243
- description?: string;
1244
- currency: string;
1245
- promoCode?: string;
1246
- type: string;
1247
- paidSeats?: number;
1248
- currentSeats?: number;
1249
- maxSeats?: number;
1250
- status?: string;
1251
- billingCycle: "monthly" | "yearly";
1252
- billingContacts?: Array<TBillingRecipient>;
1253
- nextBillingDate?: Date;
1254
- lastPaymentStatus?: string;
1255
- failedAttempts?: number;
1256
- createdAt?: string | Date;
1257
- updatedAt?: string | Date;
1258
- deletedAt?: string | Date;
1259
- };
1260
- declare function MSubscription(value: TSubscription): TSubscription;
1261
636
 
1262
- declare function useSubscriptionRepo(): {
1263
- createIndex: () => Promise<void>;
1264
- createUniqueIndex: () => Promise<void>;
1265
- add: (value: TSubscription, session?: ClientSession) => Promise<ObjectId>;
1266
- getById: (_id: string | ObjectId) => Promise<TSubscription | null>;
1267
- getBySubscriptionId: (subscriptionId: string) => Promise<TSubscription | null>;
1268
- getByUserId: (user: string | ObjectId) => Promise<TSubscription | null>;
1269
- getSubscriptions: ({ search, page, limit, sort, status, }?: {
637
+ declare function useBuildingUnitRepo(): {
638
+ createIndexes: () => Promise<void>;
639
+ add: (value: TBuildingUnit, session?: ClientSession) => Promise<ObjectId>;
640
+ getAll: ({ search, page, limit, sort, school, building, status, }?: {
1270
641
  search?: string | undefined;
1271
642
  page?: number | undefined;
1272
643
  limit?: number | undefined;
1273
644
  sort?: {} | undefined;
645
+ school?: string | undefined;
646
+ building?: string | undefined;
1274
647
  status?: string | undefined;
1275
648
  }) => Promise<Record<string, any>>;
1276
- updateStatus: (_id: string | ObjectId, status: string) => Promise<string>;
1277
- getByOrgId: (org: string | ObjectId) => Promise<TSubscription | null>;
1278
- getByAffiliateUserId: (user: string | ObjectId) => Promise<TSubscription | null>;
1279
- getDueSubscriptions: (BATCH_SIZE?: number) => Promise<TSubscription[]>;
1280
- getFailedSubscriptions: (BATCH_SIZE?: number) => Promise<TSubscription[]>;
1281
- processSuccessfulPayment: (value: Pick<TSubscription, "nextBillingDate"> & {
1282
- _id: string | ObjectId;
1283
- }, session?: ClientSession) => Promise<string>;
1284
- markSubscriptionAsFailed: ({ _id, failed }?: {
1285
- _id: string | ObjectId;
1286
- failed?: boolean | undefined;
1287
- }, session?: ClientSession) => Promise<mongodb.UpdateResult<TSubscription>>;
1288
- markSubscriptionAsCanceled: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<TSubscription>>;
1289
- updateSeatsById: ({ _id, currentSeats, maxSeats, paidSeats, amount, status, nextBillingDate, }?: {
1290
- _id: string | ObjectId;
1291
- currentSeats: number;
1292
- maxSeats: number;
1293
- paidSeats?: number | undefined;
1294
- amount: number;
1295
- status?: string | undefined;
1296
- nextBillingDate?: string | undefined;
1297
- }, session?: ClientSession) => Promise<mongodb.UpdateResult<TSubscription>>;
1298
- updateMaxSeatsById: ({ _id, seats }?: {
1299
- _id: string | ObjectId;
1300
- seats: number;
1301
- }, session?: ClientSession) => Promise<mongodb.UpdateResult<TSubscription>>;
1302
- updateStatusById: (_id: string | ObjectId, status: string, session?: ClientSession) => Promise<mongodb.UpdateResult<TSubscription>>;
1303
- updatePromoCodeById: (_id: string | ObjectId, promoCode: string, session?: ClientSession) => Promise<mongodb.UpdateResult<TSubscription>>;
1304
- updatePaymentMethodById: (_id: string | ObjectId, paymentMethodId: string, session?: ClientSession) => Promise<mongodb.UpdateResult<TSubscription>>;
1305
- addBillingContactById: (_id: string | ObjectId, email: string) => Promise<string>;
1306
- updateBillingContactByAddedAt: (_id: string | ObjectId, addedAt: string | Date, email: string) => Promise<string>;
1307
- deleteBillingContactByAddedAt: (_id: string | ObjectId, addedAt: string | Date) => Promise<string>;
1308
- };
1309
-
1310
- declare const TInvoice: z.ZodObject<{
1311
- _id: z.ZodEffects<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<ObjectId, z.ZodTypeDef, ObjectId>]>>, ObjectId | undefined, string | ObjectId | undefined>;
1312
- invoiceNumber: z.ZodString;
1313
- type: z.ZodDefault<z.ZodEnum<["organization-subscription", "affiliate-subscription", "one-time-payment", "other"]>>;
1314
- amount: z.ZodNumber;
1315
- dueDate: z.ZodDate;
1316
- status: z.ZodDefault<z.ZodEnum<["pending", "paid", "overdue", "cancelled"]>>;
1317
- items: z.ZodArray<z.ZodObject<{
1318
- description: z.ZodString;
1319
- unitPrice: z.ZodNumber;
1320
- quantity: z.ZodNumber;
1321
- seats: z.ZodOptional<z.ZodNumber>;
1322
- total: z.ZodNumber;
1323
- }, "strip", z.ZodTypeAny, {
1324
- description: string;
1325
- unitPrice: number;
1326
- quantity: number;
1327
- total: number;
1328
- seats?: number | undefined;
1329
- }, {
1330
- description: string;
1331
- unitPrice: number;
1332
- quantity: number;
1333
- total: number;
1334
- seats?: number | undefined;
1335
- }>, "many">;
1336
- metadata: z.ZodEffects<z.ZodOptional<z.ZodDefault<z.ZodObject<{
1337
- transactionId: z.ZodOptional<z.ZodString>;
1338
- userId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<ObjectId, z.ZodTypeDef, ObjectId>]>>;
1339
- orgId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<ObjectId, z.ZodTypeDef, ObjectId>]>>;
1340
- billingCycle: z.ZodOptional<z.ZodEnum<["monthly", "yearly", "quarterly"]>>;
1341
- subscriptionId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<ObjectId, z.ZodTypeDef, ObjectId>]>>;
1342
- currency: z.ZodOptional<z.ZodDefault<z.ZodString>>;
1343
- description: z.ZodOptional<z.ZodString>;
1344
- }, "strip", z.ZodTypeAny, {
1345
- description?: string | undefined;
1346
- userId?: string | ObjectId | undefined;
1347
- orgId?: string | ObjectId | undefined;
1348
- transactionId?: string | undefined;
1349
- currency?: string | undefined;
1350
- subscriptionId?: string | ObjectId | undefined;
1351
- billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
1352
- }, {
1353
- description?: string | undefined;
1354
- userId?: string | ObjectId | undefined;
1355
- orgId?: string | ObjectId | undefined;
1356
- transactionId?: string | undefined;
1357
- currency?: string | undefined;
1358
- subscriptionId?: string | ObjectId | undefined;
1359
- billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
1360
- }>>>, {
1361
- description?: string | undefined;
1362
- userId?: string | ObjectId | undefined;
1363
- orgId?: string | ObjectId | undefined;
1364
- transactionId?: string | undefined;
1365
- currency?: string | undefined;
1366
- subscriptionId?: string | ObjectId | undefined;
1367
- billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
1368
- } | undefined, {
1369
- description?: string | undefined;
1370
- userId?: string | ObjectId | undefined;
1371
- orgId?: string | ObjectId | undefined;
1372
- transactionId?: string | undefined;
1373
- currency?: string | undefined;
1374
- subscriptionId?: string | ObjectId | undefined;
1375
- billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
1376
- } | undefined>;
1377
- createdAt: z.ZodOptional<z.ZodDefault<z.ZodDate>>;
1378
- updatedAt: z.ZodOptional<z.ZodDate>;
1379
- }, "strip", z.ZodTypeAny, {
1380
- type: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other";
1381
- status: "pending" | "cancelled" | "paid" | "overdue";
1382
- items: {
1383
- description: string;
1384
- unitPrice: number;
1385
- quantity: number;
1386
- total: number;
1387
- seats?: number | undefined;
1388
- }[];
1389
- amount: number;
1390
- invoiceNumber: string;
1391
- dueDate: Date;
1392
- _id?: ObjectId | undefined;
1393
- updatedAt?: Date | undefined;
1394
- createdAt?: Date | undefined;
1395
- metadata?: {
1396
- description?: string | undefined;
1397
- userId?: string | ObjectId | undefined;
1398
- orgId?: string | ObjectId | undefined;
1399
- transactionId?: string | undefined;
1400
- currency?: string | undefined;
1401
- subscriptionId?: string | ObjectId | undefined;
1402
- billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
1403
- } | undefined;
1404
- }, {
1405
- items: {
1406
- description: string;
1407
- unitPrice: number;
1408
- quantity: number;
1409
- total: number;
1410
- seats?: number | undefined;
1411
- }[];
1412
- amount: number;
1413
- invoiceNumber: string;
1414
- dueDate: Date;
1415
- type?: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other" | undefined;
1416
- status?: "pending" | "cancelled" | "paid" | "overdue" | undefined;
1417
- _id?: string | ObjectId | undefined;
1418
- updatedAt?: Date | undefined;
1419
- createdAt?: Date | undefined;
1420
- metadata?: {
1421
- description?: string | undefined;
1422
- userId?: string | ObjectId | undefined;
1423
- orgId?: string | ObjectId | undefined;
1424
- transactionId?: string | undefined;
1425
- currency?: string | undefined;
1426
- subscriptionId?: string | ObjectId | undefined;
1427
- billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
1428
- } | undefined;
1429
- }>;
1430
- type TInvoice = z.infer<typeof TInvoice>;
1431
- declare function useInvoiceModel(db: Db): {
1432
- createInvoice: (data: TInvoice) => TInvoice;
1433
- collection: Collection<{
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
- }>;
649
+ getById: (_id: string | ObjectId) => Promise<TBuildingUnit>;
650
+ getByBuildingLevel: (building: string | ObjectId, level: number) => Promise<TBuildingUnit | null>;
651
+ updateById: (_id: string | ObjectId, value: {
652
+ name?: string | undefined;
653
+ building?: string | undefined;
654
+ level?: number | undefined;
655
+ category?: string | undefined;
656
+ type?: string | undefined;
657
+ seating_capacity?: number | undefined;
658
+ standing_capacity?: number | undefined;
659
+ area?: number | undefined;
660
+ }, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
661
+ getByBuilding: (building: string | ObjectId) => Promise<TBuildingUnit | null>;
662
+ deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<string>;
663
+ updateByBuildingId: (building: string | ObjectId, value: Partial<Pick<TBuildingUnit, "buildingName">>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
1459
664
  };
1460
665
 
1461
- declare function useInvoiceRepo(): {
1462
- createIndex: () => Promise<void>;
1463
- createUniqueIndex: () => Promise<void>;
1464
- add: (value: TInvoice, session?: ClientSession) => Promise<void>;
1465
- getByDueDate: (id: string | ObjectId, dueDate: Date, status?: TInvoice["status"]) => Promise<{
1466
- type: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other";
1467
- status: "pending" | "cancelled" | "paid" | "overdue";
1468
- items: {
1469
- description: string;
1470
- unitPrice: number;
1471
- quantity: number;
1472
- total: number;
1473
- seats?: number | undefined;
1474
- }[];
1475
- amount: number;
1476
- invoiceNumber: string;
1477
- dueDate: Date;
1478
- _id?: ObjectId | undefined;
1479
- updatedAt?: Date | undefined;
1480
- createdAt?: Date | undefined;
1481
- metadata?: {
1482
- description?: string | undefined;
1483
- userId?: string | ObjectId | undefined;
1484
- orgId?: string | ObjectId | undefined;
1485
- transactionId?: string | undefined;
1486
- currency?: string | undefined;
1487
- subscriptionId?: string | ObjectId | undefined;
1488
- billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
1489
- } | undefined;
1490
- } | null>;
1491
- updateStatusByInvoiceNumber: (invoiceNumber: string, status: TInvoice["status"], session?: ClientSession) => Promise<void>;
1492
- getOverdueInvoices: (BATCH_SIZE?: number) => Promise<{
1493
- type: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other";
1494
- status: "pending" | "cancelled" | "paid" | "overdue";
1495
- items: {
1496
- description: string;
1497
- unitPrice: number;
1498
- quantity: number;
1499
- total: number;
1500
- seats?: number | undefined;
1501
- }[];
1502
- amount: number;
1503
- invoiceNumber: string;
1504
- dueDate: Date;
1505
- _id?: ObjectId | undefined;
1506
- updatedAt?: Date | undefined;
1507
- createdAt?: Date | undefined;
1508
- metadata?: {
1509
- description?: string | undefined;
1510
- userId?: string | ObjectId | undefined;
1511
- orgId?: string | ObjectId | undefined;
1512
- transactionId?: string | undefined;
1513
- currency?: string | undefined;
1514
- subscriptionId?: string | ObjectId | undefined;
1515
- billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
1516
- } | undefined;
1517
- }[]>;
1518
- getBySubscriptionId: ({ page, search, limit, sort, id }?: {
1519
- page?: number | undefined;
1520
- search?: string | undefined;
1521
- limit?: number | undefined;
1522
- sort?: Record<string, any> | undefined;
1523
- id?: string | ObjectId | undefined;
1524
- }) => Promise<{
1525
- items: any[];
1526
- pages: number;
1527
- pageRange: string;
1528
- }>;
1529
- getByNumber: (number: string) => Promise<{
1530
- type: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other";
1531
- status: "pending" | "cancelled" | "paid" | "overdue";
1532
- items: {
1533
- description: string;
1534
- unitPrice: number;
1535
- quantity: number;
1536
- total: number;
1537
- seats?: number | undefined;
1538
- }[];
1539
- amount: number;
1540
- invoiceNumber: string;
1541
- dueDate: Date;
1542
- _id?: ObjectId | undefined;
1543
- updatedAt?: Date | undefined;
1544
- createdAt?: Date | undefined;
1545
- metadata?: {
1546
- description?: string | undefined;
1547
- userId?: string | ObjectId | undefined;
1548
- orgId?: string | ObjectId | undefined;
1549
- transactionId?: string | undefined;
1550
- currency?: string | undefined;
1551
- subscriptionId?: string | ObjectId | undefined;
1552
- billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
1553
- } | undefined;
1554
- } | null>;
1555
- getByTransactionId: (id: string) => Promise<{
1556
- type: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other";
1557
- status: "pending" | "cancelled" | "paid" | "overdue";
1558
- items: {
1559
- description: string;
1560
- unitPrice: number;
1561
- quantity: number;
1562
- total: number;
1563
- seats?: number | undefined;
1564
- }[];
1565
- amount: number;
1566
- invoiceNumber: string;
1567
- dueDate: Date;
1568
- _id?: ObjectId | undefined;
1569
- updatedAt?: Date | undefined;
1570
- createdAt?: Date | undefined;
1571
- metadata?: {
1572
- description?: string | undefined;
1573
- userId?: string | ObjectId | undefined;
1574
- orgId?: string | ObjectId | undefined;
1575
- transactionId?: string | undefined;
1576
- currency?: string | undefined;
1577
- subscriptionId?: string | ObjectId | undefined;
1578
- billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
1579
- } | undefined;
1580
- } | null>;
666
+ declare function useBuildingUnitService(): {
667
+ add: (value: {
668
+ building: TBuildingUnit;
669
+ qty: number;
670
+ }) => Promise<string>;
1581
671
  };
1582
672
 
1583
- declare const TPaymentMethod: z.ZodEnum<["CARD", "DIRECT_DEBIT", "VIRTUAL_ACCOUNT", "EWALLET", "OVER_THE_COUNTER", "QR_CODE", "PAYPAL"]>;
1584
- type TPaymentMethodType = z.infer<typeof TPaymentMethod>;
1585
- declare const TPayment: z.ZodObject<{
1586
- _id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<ObjectId, z.ZodTypeDef, ObjectId>]>>;
1587
- invoiceId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
1588
- amount: z.ZodNumber;
1589
- paymentMethod: z.ZodEnum<["CARD", "DIRECT_DEBIT", "VIRTUAL_ACCOUNT", "EWALLET", "OVER_THE_COUNTER", "QR_CODE", "PAYPAL"]>;
1590
- status: z.ZodEnum<["pending", "completed", "failed", "refunded"]>;
1591
- metadata: z.ZodEffects<z.ZodObject<{
1592
- userId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<ObjectId, z.ZodTypeDef, ObjectId>]>>;
1593
- orgId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<ObjectId, z.ZodTypeDef, ObjectId>]>>;
1594
- transactionId: z.ZodOptional<z.ZodString>;
1595
- currency: z.ZodDefault<z.ZodString>;
1596
- paymentMethod: z.ZodOptional<z.ZodString>;
1597
- paymentMethodType: z.ZodOptional<z.ZodString>;
1598
- paymentMethodId: z.ZodOptional<z.ZodString>;
1599
- payment: z.ZodOptional<z.ZodString>;
1600
- subscriptionId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<ObjectId, z.ZodTypeDef, ObjectId>]>>;
1601
- }, "strip", z.ZodTypeAny, {
1602
- currency: string;
1603
- userId?: string | ObjectId | undefined;
1604
- orgId?: string | ObjectId | undefined;
1605
- transactionId?: string | undefined;
1606
- paymentMethod?: string | undefined;
1607
- paymentMethodType?: string | undefined;
1608
- paymentMethodId?: string | undefined;
1609
- payment?: string | undefined;
1610
- subscriptionId?: string | ObjectId | undefined;
1611
- }, {
1612
- userId?: string | ObjectId | undefined;
1613
- orgId?: string | ObjectId | undefined;
1614
- transactionId?: string | undefined;
1615
- currency?: string | undefined;
1616
- paymentMethod?: string | undefined;
1617
- paymentMethodType?: string | undefined;
1618
- paymentMethodId?: string | undefined;
1619
- payment?: string | undefined;
1620
- subscriptionId?: string | ObjectId | undefined;
1621
- }>, {
1622
- currency: string;
1623
- userId?: string | ObjectId | undefined;
1624
- orgId?: string | ObjectId | undefined;
1625
- transactionId?: string | undefined;
1626
- paymentMethod?: string | undefined;
1627
- paymentMethodType?: string | undefined;
1628
- paymentMethodId?: string | undefined;
1629
- payment?: string | undefined;
1630
- subscriptionId?: string | ObjectId | undefined;
1631
- }, {
1632
- userId?: string | ObjectId | undefined;
1633
- orgId?: string | ObjectId | undefined;
1634
- transactionId?: string | undefined;
1635
- currency?: string | undefined;
1636
- paymentMethod?: string | undefined;
1637
- paymentMethodType?: string | undefined;
1638
- paymentMethodId?: string | undefined;
1639
- payment?: string | undefined;
1640
- subscriptionId?: string | ObjectId | undefined;
1641
- }>;
1642
- createdAt: z.ZodOptional<z.ZodDefault<z.ZodDate>>;
1643
- updatedAt: z.ZodOptional<z.ZodDate>;
1644
- }, "strip", z.ZodTypeAny, {
1645
- status: "pending" | "completed" | "failed" | "refunded";
1646
- metadata: {
1647
- currency: string;
1648
- userId?: string | ObjectId | undefined;
1649
- orgId?: string | ObjectId | undefined;
1650
- transactionId?: string | undefined;
1651
- paymentMethod?: string | undefined;
1652
- paymentMethodType?: string | undefined;
1653
- paymentMethodId?: string | undefined;
1654
- payment?: string | undefined;
1655
- subscriptionId?: string | ObjectId | undefined;
1656
- };
1657
- paymentMethod: "EWALLET" | "QR_CODE" | "CARD" | "DIRECT_DEBIT" | "VIRTUAL_ACCOUNT" | "OVER_THE_COUNTER" | "PAYPAL";
1658
- invoiceId: string;
1659
- amount: number;
1660
- _id?: string | ObjectId | undefined;
1661
- updatedAt?: Date | undefined;
1662
- createdAt?: Date | undefined;
1663
- }, {
1664
- status: "pending" | "completed" | "failed" | "refunded";
1665
- metadata: {
1666
- userId?: string | ObjectId | undefined;
1667
- orgId?: string | ObjectId | undefined;
1668
- transactionId?: string | undefined;
1669
- currency?: string | undefined;
1670
- paymentMethod?: string | undefined;
1671
- paymentMethodType?: string | undefined;
1672
- paymentMethodId?: string | undefined;
1673
- payment?: string | undefined;
1674
- subscriptionId?: string | ObjectId | undefined;
1675
- };
1676
- paymentMethod: "EWALLET" | "QR_CODE" | "CARD" | "DIRECT_DEBIT" | "VIRTUAL_ACCOUNT" | "OVER_THE_COUNTER" | "PAYPAL";
1677
- amount: number;
1678
- _id?: string | ObjectId | undefined;
1679
- updatedAt?: Date | undefined;
1680
- createdAt?: Date | undefined;
1681
- invoiceId?: string | undefined;
1682
- }>;
1683
- type TPayment = z.infer<typeof TPayment>;
1684
- declare const DirectDebitSchema: z.ZodObject<{
1685
- type: z.ZodLiteral<"DIRECT_DEBIT">;
1686
- direct_debit: z.ZodObject<{
1687
- channel_code: z.ZodString;
1688
- channel_properties: z.ZodObject<{
1689
- success_return_url: z.ZodString;
1690
- failure_return_url: z.ZodString;
1691
- }, "strip", z.ZodTypeAny, {
1692
- success_return_url: string;
1693
- failure_return_url: string;
1694
- }, {
1695
- success_return_url: string;
1696
- failure_return_url: string;
1697
- }>;
1698
- }, "strip", z.ZodTypeAny, {
1699
- channel_code: string;
1700
- channel_properties: {
1701
- success_return_url: string;
1702
- failure_return_url: string;
1703
- };
1704
- }, {
1705
- channel_code: string;
1706
- channel_properties: {
1707
- success_return_url: string;
1708
- failure_return_url: string;
1709
- };
1710
- }>;
1711
- reusability: z.ZodEnum<["MULTIPLE_USE", "SINGLE_USE"]>;
1712
- description: z.ZodOptional<z.ZodString>;
1713
- metadata: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
1714
- customer_id: z.ZodString;
1715
- }, "strip", z.ZodTypeAny, {
1716
- type: "DIRECT_DEBIT";
1717
- metadata: Record<string, string>;
1718
- direct_debit: {
1719
- channel_code: string;
1720
- channel_properties: {
1721
- success_return_url: string;
1722
- failure_return_url: string;
1723
- };
1724
- };
1725
- reusability: "MULTIPLE_USE" | "SINGLE_USE";
1726
- customer_id: string;
1727
- description?: string | undefined;
1728
- }, {
1729
- type: "DIRECT_DEBIT";
1730
- direct_debit: {
1731
- channel_code: string;
1732
- channel_properties: {
1733
- success_return_url: string;
1734
- failure_return_url: string;
1735
- };
1736
- };
1737
- reusability: "MULTIPLE_USE" | "SINGLE_USE";
1738
- customer_id: string;
1739
- metadata?: Record<string, string> | undefined;
1740
- description?: string | undefined;
1741
- }>;
1742
- type DirectDebit = z.infer<typeof DirectDebitSchema>;
1743
- declare function validateDirectDebit(data: Record<string, any>): DirectDebit;
1744
- declare const CardPaymentSchema: z.ZodObject<{
1745
- type: z.ZodLiteral<"CARD">;
1746
- card: z.ZodObject<{
1747
- currency: z.ZodLiteral<"PHP">;
1748
- channel_properties: z.ZodObject<{
1749
- skip_three_d_secure: z.ZodBoolean;
1750
- success_return_url: z.ZodString;
1751
- failure_return_url: z.ZodString;
1752
- }, "strip", z.ZodTypeAny, {
1753
- success_return_url: string;
1754
- failure_return_url: string;
1755
- skip_three_d_secure: boolean;
1756
- }, {
1757
- success_return_url: string;
1758
- failure_return_url: string;
1759
- skip_three_d_secure: boolean;
1760
- }>;
1761
- card_information: z.ZodObject<{
1762
- card_number: z.ZodString;
1763
- expiry_month: z.ZodString;
1764
- expiry_year: z.ZodString;
1765
- cvv: z.ZodString;
1766
- cardholder_name: z.ZodString;
1767
- }, "strip", z.ZodTypeAny, {
1768
- card_number: string;
1769
- expiry_month: string;
1770
- expiry_year: string;
1771
- cvv: string;
1772
- cardholder_name: string;
1773
- }, {
1774
- card_number: string;
1775
- expiry_month: string;
1776
- expiry_year: string;
1777
- cvv: string;
1778
- cardholder_name: string;
1779
- }>;
1780
- }, "strip", z.ZodTypeAny, {
1781
- currency: "PHP";
1782
- channel_properties: {
1783
- success_return_url: string;
1784
- failure_return_url: string;
1785
- skip_three_d_secure: boolean;
1786
- };
1787
- card_information: {
1788
- card_number: string;
1789
- expiry_month: string;
1790
- expiry_year: string;
1791
- cvv: string;
1792
- cardholder_name: string;
1793
- };
1794
- }, {
1795
- currency: "PHP";
1796
- channel_properties: {
1797
- success_return_url: string;
1798
- failure_return_url: string;
1799
- skip_three_d_secure: boolean;
1800
- };
1801
- card_information: {
1802
- card_number: string;
1803
- expiry_month: string;
1804
- expiry_year: string;
1805
- cvv: string;
1806
- cardholder_name: string;
1807
- };
1808
- }>;
1809
- reusability: z.ZodEnum<["MULTIPLE_USE", "SINGLE_USE"]>;
1810
- description: z.ZodOptional<z.ZodString>;
1811
- metadata: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
1812
- }, "strip", z.ZodTypeAny, {
1813
- type: "CARD";
1814
- metadata: Record<string, string>;
1815
- reusability: "MULTIPLE_USE" | "SINGLE_USE";
1816
- card: {
1817
- currency: "PHP";
1818
- channel_properties: {
1819
- success_return_url: string;
1820
- failure_return_url: string;
1821
- skip_three_d_secure: boolean;
1822
- };
1823
- card_information: {
1824
- card_number: string;
1825
- expiry_month: string;
1826
- expiry_year: string;
1827
- cvv: string;
1828
- cardholder_name: string;
1829
- };
1830
- };
1831
- description?: string | undefined;
1832
- }, {
1833
- type: "CARD";
1834
- reusability: "MULTIPLE_USE" | "SINGLE_USE";
1835
- card: {
1836
- currency: "PHP";
1837
- channel_properties: {
1838
- success_return_url: string;
1839
- failure_return_url: string;
1840
- skip_three_d_secure: boolean;
1841
- };
1842
- card_information: {
1843
- card_number: string;
1844
- expiry_month: string;
1845
- expiry_year: string;
1846
- cvv: string;
1847
- cardholder_name: string;
1848
- };
1849
- };
1850
- metadata?: Record<string, string> | undefined;
1851
- description?: string | undefined;
1852
- }>;
1853
- type CardPayment = z.infer<typeof CardPaymentSchema>;
1854
- declare function validateCardPayment(data: Record<string, any>): CardPayment;
1855
- declare const EWalletPaymentSchema: z.ZodObject<{
1856
- type: z.ZodLiteral<"EWALLET">;
1857
- reusability: z.ZodEnum<["MULTIPLE_USE", "SINGLE_USE"]>;
1858
- customer_id: z.ZodString;
1859
- country: z.ZodString;
1860
- ewallet: z.ZodObject<{
1861
- channel_code: z.ZodString;
1862
- channel_properties: z.ZodObject<{
1863
- success_return_url: z.ZodString;
1864
- failure_return_url: z.ZodString;
1865
- cancel_return_url: z.ZodString;
1866
- }, "strip", z.ZodTypeAny, {
1867
- success_return_url: string;
1868
- failure_return_url: string;
1869
- cancel_return_url: string;
1870
- }, {
1871
- success_return_url: string;
1872
- failure_return_url: string;
1873
- cancel_return_url: string;
1874
- }>;
1875
- }, "strip", z.ZodTypeAny, {
1876
- channel_code: string;
1877
- channel_properties: {
1878
- success_return_url: string;
1879
- failure_return_url: string;
1880
- cancel_return_url: string;
1881
- };
1882
- }, {
1883
- channel_code: string;
1884
- channel_properties: {
1885
- success_return_url: string;
1886
- failure_return_url: string;
1887
- cancel_return_url: string;
1888
- };
1889
- }>;
1890
- description: z.ZodOptional<z.ZodString>;
1891
- metadata: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
1892
- }, "strip", z.ZodTypeAny, {
1893
- type: "EWALLET";
1894
- metadata: Record<string, string>;
1895
- country: string;
1896
- reusability: "MULTIPLE_USE" | "SINGLE_USE";
1897
- customer_id: string;
1898
- ewallet: {
1899
- channel_code: string;
1900
- channel_properties: {
1901
- success_return_url: string;
1902
- failure_return_url: string;
1903
- cancel_return_url: string;
1904
- };
1905
- };
1906
- description?: string | undefined;
1907
- }, {
1908
- type: "EWALLET";
1909
- country: string;
1910
- reusability: "MULTIPLE_USE" | "SINGLE_USE";
1911
- customer_id: string;
1912
- ewallet: {
1913
- channel_code: string;
1914
- channel_properties: {
1915
- success_return_url: string;
1916
- failure_return_url: string;
1917
- cancel_return_url: string;
1918
- };
1919
- };
1920
- metadata?: Record<string, string> | undefined;
1921
- description?: string | undefined;
1922
- }>;
1923
- type EWalletPayment = z.infer<typeof EWalletPaymentSchema>;
1924
- declare function validateEWalletPayment(data: Record<string, any>): EWalletPayment;
1925
- declare function usePaymentModel(db: Db): {
1926
- collection: Collection<{
1927
- status: "pending" | "completed" | "failed" | "refunded";
1928
- metadata: {
1929
- currency: string;
1930
- userId?: string | ObjectId | undefined;
1931
- orgId?: string | ObjectId | undefined;
1932
- transactionId?: string | undefined;
1933
- paymentMethod?: string | undefined;
1934
- paymentMethodType?: string | undefined;
1935
- paymentMethodId?: string | undefined;
1936
- payment?: string | undefined;
1937
- subscriptionId?: string | ObjectId | undefined;
1938
- };
1939
- paymentMethod: "EWALLET" | "QR_CODE" | "CARD" | "DIRECT_DEBIT" | "VIRTUAL_ACCOUNT" | "OVER_THE_COUNTER" | "PAYPAL";
1940
- invoiceId: string;
1941
- amount: number;
1942
- _id?: string | ObjectId | undefined;
1943
- updatedAt?: Date | undefined;
1944
- createdAt?: Date | undefined;
1945
- }>;
1946
- createPayment: (data: Partial<TPayment>) => {
1947
- status: "pending" | "completed" | "failed" | "refunded";
1948
- metadata: {
1949
- currency: string;
1950
- userId?: string | ObjectId | undefined;
1951
- orgId?: string | ObjectId | undefined;
1952
- transactionId?: string | undefined;
1953
- paymentMethod?: string | undefined;
1954
- paymentMethodType?: string | undefined;
1955
- paymentMethodId?: string | undefined;
1956
- payment?: string | undefined;
1957
- subscriptionId?: string | ObjectId | undefined;
1958
- };
1959
- paymentMethod: "EWALLET" | "QR_CODE" | "CARD" | "DIRECT_DEBIT" | "VIRTUAL_ACCOUNT" | "OVER_THE_COUNTER" | "PAYPAL";
1960
- invoiceId: string;
1961
- amount: number;
1962
- _id?: string | ObjectId | undefined;
1963
- updatedAt?: Date | undefined;
1964
- createdAt?: Date | undefined;
1965
- };
1966
- validatePayment: (data: unknown) => {
1967
- status: "pending" | "completed" | "failed" | "refunded";
1968
- metadata: {
1969
- currency: string;
1970
- userId?: string | ObjectId | undefined;
1971
- orgId?: string | ObjectId | undefined;
1972
- transactionId?: string | undefined;
1973
- paymentMethod?: string | undefined;
1974
- paymentMethodType?: string | undefined;
1975
- paymentMethodId?: string | undefined;
1976
- payment?: string | undefined;
1977
- subscriptionId?: string | ObjectId | undefined;
1978
- };
1979
- paymentMethod: "EWALLET" | "QR_CODE" | "CARD" | "DIRECT_DEBIT" | "VIRTUAL_ACCOUNT" | "OVER_THE_COUNTER" | "PAYPAL";
1980
- invoiceId: string;
1981
- amount: number;
1982
- _id?: string | ObjectId | undefined;
1983
- updatedAt?: Date | undefined;
1984
- createdAt?: Date | undefined;
1985
- };
673
+ declare function useBuildingUnitController(): {
674
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
675
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
676
+ getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
677
+ updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
678
+ deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1986
679
  };
1987
680
 
1988
- declare function usePaymentRepo(): {
1989
- createIndex: () => Promise<void>;
1990
- createUniqueIndex: () => Promise<void>;
1991
- add: (value: TPayment, session?: ClientSession) => Promise<void>;
1992
- getPayments: ({ search, page, limit, sort, status, type, id, }?: {
1993
- search?: string | undefined;
1994
- page?: number | undefined;
1995
- limit?: number | undefined;
1996
- sort?: {} | undefined;
1997
- status?: string | undefined;
1998
- type?: string | undefined;
1999
- id?: string | undefined;
2000
- }) => Promise<{
2001
- items: any[];
2002
- pages: number;
2003
- pageRange: string;
2004
- }>;
2005
- getByInvoiceId: (invoiceId: string) => Promise<mongodb.WithId<{
2006
- status: "pending" | "completed" | "failed" | "refunded";
2007
- metadata: {
2008
- currency: string;
2009
- userId?: string | ObjectId | undefined;
2010
- orgId?: string | ObjectId | undefined;
2011
- transactionId?: string | undefined;
2012
- paymentMethod?: string | undefined;
2013
- paymentMethodType?: string | undefined;
2014
- paymentMethodId?: string | undefined;
2015
- payment?: string | undefined;
2016
- subscriptionId?: string | ObjectId | undefined;
2017
- };
2018
- paymentMethod: "EWALLET" | "QR_CODE" | "CARD" | "DIRECT_DEBIT" | "VIRTUAL_ACCOUNT" | "OVER_THE_COUNTER" | "PAYPAL";
2019
- invoiceId: string;
2020
- amount: number;
2021
- _id?: string | ObjectId | undefined;
2022
- updatedAt?: Date | undefined;
2023
- createdAt?: Date | undefined;
2024
- }> | null>;
681
+ type TToken = {
682
+ token: string;
683
+ user: ObjectId;
684
+ createdAt?: string;
2025
685
  };
686
+ declare class MToken implements TToken {
687
+ token: string;
688
+ user: ObjectId;
689
+ createdAt?: string;
690
+ constructor(value: TToken);
691
+ }
2026
692
 
2027
- declare function usePaymentController(): {
2028
- getPayments: (req: Request, res: Response, next: NextFunction) => Promise<void>;
693
+ declare function useTokenRepo(): {
694
+ createToken: ({ token, user }?: {
695
+ token: string;
696
+ user: string | ObjectId;
697
+ }) => Promise<string>;
698
+ getToken: (token: string) => Promise<any>;
699
+ deleteToken: (token: string) => Promise<mongodb.DeleteResult>;
2029
700
  };
2030
701
 
2031
702
  declare const TCounter: z.ZodObject<{
@@ -2039,14 +710,14 @@ declare const TCounter: z.ZodObject<{
2039
710
  type: string;
2040
711
  createdAt: Date;
2041
712
  count: number;
713
+ deletedAt?: Date | undefined;
2042
714
  _id?: ObjectId | undefined;
2043
715
  updatedAt?: Date | undefined;
2044
- deletedAt?: Date | undefined;
2045
716
  }, {
2046
717
  type: string;
718
+ deletedAt?: Date | undefined;
2047
719
  _id?: string | ObjectId | undefined;
2048
720
  updatedAt?: Date | undefined;
2049
- deletedAt?: Date | undefined;
2050
721
  createdAt?: Date | undefined;
2051
722
  count?: number | undefined;
2052
723
  }>;
@@ -2056,32 +727,32 @@ declare function useCounterModel(db: Db): {
2056
727
  type: string;
2057
728
  createdAt: Date;
2058
729
  count: number;
730
+ deletedAt?: Date | undefined;
2059
731
  _id?: ObjectId | undefined;
2060
732
  updatedAt?: Date | undefined;
2061
- deletedAt?: Date | undefined;
2062
733
  };
2063
734
  validateCounter: (data: unknown) => z.SafeParseReturnType<{
2064
735
  type: string;
736
+ deletedAt?: Date | undefined;
2065
737
  _id?: string | ObjectId | undefined;
2066
738
  updatedAt?: Date | undefined;
2067
- deletedAt?: Date | undefined;
2068
739
  createdAt?: Date | undefined;
2069
740
  count?: number | undefined;
2070
741
  }, {
2071
742
  type: string;
2072
743
  createdAt: Date;
2073
744
  count: number;
745
+ deletedAt?: Date | undefined;
2074
746
  _id?: ObjectId | undefined;
2075
747
  updatedAt?: Date | undefined;
2076
- deletedAt?: Date | undefined;
2077
748
  }>;
2078
749
  collection: Collection<{
2079
750
  type: string;
2080
751
  createdAt: Date;
2081
752
  count: number;
753
+ deletedAt?: Date | undefined;
2082
754
  _id?: ObjectId | undefined;
2083
755
  updatedAt?: Date | undefined;
2084
- deletedAt?: Date | undefined;
2085
756
  }>;
2086
757
  };
2087
758
 
@@ -2093,759 +764,21 @@ declare function useCounterRepo(): {
2093
764
  incrementByType: (type: string, session?: ClientSession) => Promise<void>;
2094
765
  };
2095
766
 
2096
- declare const TPriceType: z.ZodEnum<["monthly-subscription", "yearly-subscription", "one-time-payment", "other"]>;
2097
- type TPriceType = z.infer<typeof TPriceType>;
2098
- declare const TPrice: z.ZodObject<{
2099
- _id: z.ZodEffects<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<ObjectId, z.ZodTypeDef, ObjectId>]>>, ObjectId | undefined, string | ObjectId | undefined>;
2100
- value: z.ZodDefault<z.ZodNumber>;
2101
- saleValue: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
2102
- saleExpiry: z.ZodOptional<z.ZodDate>;
2103
- name: z.ZodString;
2104
- type: z.ZodDefault<z.ZodOptional<z.ZodEnum<["monthly-subscription", "yearly-subscription", "one-time-payment", "other"]>>>;
2105
- createdAt: z.ZodOptional<z.ZodDefault<z.ZodDate>>;
2106
- updatedAt: z.ZodOptional<z.ZodDate>;
2107
- deletedAt: z.ZodOptional<z.ZodDate>;
2108
- }, "strip", z.ZodTypeAny, {
2109
- type: "one-time-payment" | "other" | "monthly-subscription" | "yearly-subscription";
2110
- value: number;
2111
- name: string;
2112
- _id?: ObjectId | undefined;
2113
- updatedAt?: Date | undefined;
2114
- deletedAt?: Date | undefined;
2115
- createdAt?: Date | undefined;
2116
- saleValue?: number | undefined;
2117
- saleExpiry?: Date | undefined;
2118
- }, {
2119
- name: string;
2120
- type?: "one-time-payment" | "other" | "monthly-subscription" | "yearly-subscription" | undefined;
2121
- _id?: string | ObjectId | undefined;
2122
- updatedAt?: Date | undefined;
2123
- deletedAt?: Date | undefined;
2124
- value?: number | undefined;
2125
- createdAt?: Date | undefined;
2126
- saleValue?: number | undefined;
2127
- saleExpiry?: Date | undefined;
2128
- }>;
2129
- type TPrice = z.infer<typeof TPrice>;
2130
- declare function usePriceModel(db: Db): {
2131
- createPrice: (value: Pick<TPrice, "type" | "name" | "value">) => {
2132
- type: "one-time-payment" | "other" | "monthly-subscription" | "yearly-subscription";
2133
- value: number;
2134
- name: string;
2135
- _id?: ObjectId | undefined;
2136
- updatedAt?: Date | undefined;
2137
- deletedAt?: Date | undefined;
2138
- createdAt?: Date | undefined;
2139
- saleValue?: number | undefined;
2140
- saleExpiry?: Date | undefined;
2141
- };
2142
- validatePrice: (data: unknown) => z.SafeParseReturnType<{
2143
- name: string;
2144
- type?: "one-time-payment" | "other" | "monthly-subscription" | "yearly-subscription" | undefined;
2145
- _id?: string | ObjectId | undefined;
2146
- updatedAt?: Date | undefined;
2147
- deletedAt?: Date | undefined;
2148
- value?: number | undefined;
2149
- createdAt?: Date | undefined;
2150
- saleValue?: number | undefined;
2151
- saleExpiry?: Date | undefined;
2152
- }, {
2153
- type: "one-time-payment" | "other" | "monthly-subscription" | "yearly-subscription";
2154
- value: number;
2155
- name: string;
2156
- _id?: ObjectId | undefined;
2157
- updatedAt?: Date | undefined;
2158
- deletedAt?: Date | undefined;
2159
- createdAt?: Date | undefined;
2160
- saleValue?: number | undefined;
2161
- saleExpiry?: Date | undefined;
2162
- }>;
2163
- collection: Collection<{
2164
- type: "one-time-payment" | "other" | "monthly-subscription" | "yearly-subscription";
2165
- value: number;
2166
- name: string;
2167
- _id?: ObjectId | undefined;
2168
- updatedAt?: Date | undefined;
2169
- deletedAt?: Date | undefined;
2170
- createdAt?: Date | undefined;
2171
- saleValue?: number | undefined;
2172
- saleExpiry?: Date | undefined;
2173
- }>;
2174
- };
2175
-
2176
- declare function usePriceRepo(): {
2177
- createIndex: () => Promise<void>;
2178
- createUniqueIndex: () => Promise<void>;
2179
- add: (value: Pick<TPrice, "type" | "name" | "value">) => Promise<void>;
2180
- getByNameType: (name: string, type: TPriceType) => Promise<any>;
2181
- setSaleValueByType: (value: Pick<TPrice, "type" | "saleValue" | "saleExpiry">, session?: ClientSession) => Promise<void>;
2182
- };
2183
-
2184
- declare function usePriceController(): {
2185
- getByNameType: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2186
- };
2187
-
2188
- declare function usePaypalService(): {
2189
- createInvoice: (data: {
2190
- invoiceNumber?: string | undefined;
2191
- invoiceDate?: string | undefined;
2192
- invoiceDueDate?: string | undefined;
2193
- customerEmail: string;
2194
- customerName?: string | undefined;
2195
- quantity: number;
2196
- ratePerSeat: number;
2197
- currency: string;
2198
- items?: Record<string, any>[] | undefined;
2199
- note?: string | undefined;
2200
- }) => Promise<string>;
2201
- getInvoiceById: (invoiceId: string) => Promise<any>;
2202
- };
2203
-
2204
- type TPSGC = {
2205
- _id?: ObjectId;
2206
- name?: string;
2207
- code: string;
2208
- type: string;
2209
- createdAt?: string;
2210
- updatedAt?: string;
2211
- deletedAt?: string;
2212
- };
2213
- declare const schemaPSGC: Joi.ObjectSchema<any>;
2214
- declare function modelPSGC(value: TPSGC): TPSGC;
2215
-
2216
- declare function usePSGCRepo(): {
2217
- createIndexes: () => Promise<void>;
2218
- add: (value: TPSGC, session?: ClientSession) => Promise<ObjectId>;
2219
- getAll: ({ search, page, limit, sort, type, }?: {
2220
- search?: string | undefined;
2221
- page?: number | undefined;
2222
- limit?: number | undefined;
2223
- sort?: {} | undefined;
2224
- type?: string | undefined;
2225
- }) => Promise<Record<string, any>>;
2226
- getById: (_id: string | ObjectId) => Promise<TPSGC>;
2227
- updateFieldById: ({ _id, field, value }?: {
2228
- _id: string | ObjectId;
2229
- field: string;
2230
- value: string;
2231
- }, session?: ClientSession) => Promise<string>;
2232
- deleteById: (_id: string | ObjectId) => Promise<string>;
2233
- getByName: (name: string) => Promise<TPSGC>;
2234
- };
2235
-
2236
- declare function usePSGCController(): {
2237
- add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2238
- getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2239
- getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2240
- getByName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2241
- updateField: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2242
- deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2243
- };
2244
-
2245
- type TPGO = {
2246
- _id?: ObjectId;
2247
- name?: string;
2248
- acronym: string;
2249
- type: string;
2250
- mandate: string;
2251
- levels: string[];
2252
- createdAt?: string;
2253
- updatedAt?: string;
2254
- deletedAt?: string;
2255
- };
2256
- declare const PGOTypes: string[];
2257
- declare const schemaPGO: Joi.ObjectSchema<any>;
2258
- declare function modelPGO(value: TPGO): TPGO;
2259
-
2260
- declare function usePGORepo(): {
2261
- createIndexes: () => Promise<void>;
2262
- add: (value: TPGO, session?: ClientSession) => Promise<ObjectId>;
2263
- getAll: ({ search, page, limit, sort }?: {
2264
- search?: string | undefined;
2265
- page?: number | undefined;
2266
- limit?: number | undefined;
2267
- sort?: {} | undefined;
2268
- }) => Promise<Record<string, any>>;
2269
- getById: (_id: string | ObjectId) => Promise<TPGO>;
2270
- updateFieldById: ({ _id, field, value }?: {
2271
- _id: string | ObjectId;
2272
- field: string;
2273
- value: string;
2274
- }, session?: ClientSession) => Promise<string>;
2275
- deleteById: (_id: string | ObjectId) => Promise<string>;
2276
- getByName: (name: string) => Promise<TPGO>;
2277
- };
2278
-
2279
- declare function usePGOController(): {
2280
- add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2281
- getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2282
- getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2283
- getByName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2284
- updateField: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2285
- deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2286
- };
2287
-
2288
- type TRegion = {
2289
- _id?: ObjectId;
2290
- name?: string;
2291
- code: string;
2292
- createdAt?: string;
2293
- updatedAt?: string;
2294
- deletedAt?: string;
2295
- };
2296
- declare const schemaRegion: Joi.ObjectSchema<any>;
2297
- declare function MRegion(value: TRegion): TRegion;
2298
-
2299
- declare function useRegionRepo(): {
2300
- createIndexes: () => Promise<void>;
2301
- add: (value: TRegion, session?: ClientSession) => Promise<ObjectId>;
2302
- getAll: ({ search, page, limit, sort }?: {
2303
- search?: string | undefined;
2304
- page?: number | undefined;
2305
- limit?: number | undefined;
2306
- sort?: {} | undefined;
2307
- }) => Promise<Record<string, any>>;
2308
- getById: (_id: string | ObjectId) => Promise<TRegion>;
2309
- updateFieldById: ({ _id, field, value }?: {
2310
- _id: string | ObjectId;
2311
- field: string;
2312
- value: string;
2313
- }, session?: ClientSession) => Promise<string>;
2314
- deleteById: (_id: string | ObjectId) => Promise<string>;
2315
- getByName: (name: string) => Promise<TRegion>;
2316
- };
2317
-
2318
- declare function useRegionController(): {
2319
- add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2320
- getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2321
- getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2322
- getByName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2323
- updateField: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2324
- deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2325
- };
2326
-
2327
- type TProvince = {
2328
- _id?: ObjectId;
2329
- name?: string;
2330
- code: string;
2331
- region: string;
2332
- regionName?: string;
2333
- createdAt?: string;
2334
- updatedAt?: string;
2335
- deletedAt?: string;
2336
- };
2337
- declare const schemaProvince: Joi.ObjectSchema<any>;
2338
- declare function MProvince(value: TProvince): TProvince;
2339
-
2340
- declare function useProvinceRepo(): {
2341
- createIndexes: () => Promise<void>;
2342
- add: (value: TProvince, session?: ClientSession) => Promise<ObjectId>;
2343
- getAll: ({ search, page, limit, sort, region, }?: {
2344
- search?: string | undefined;
2345
- page?: number | undefined;
2346
- limit?: number | undefined;
2347
- sort?: {} | undefined;
2348
- region?: string | undefined;
2349
- }) => Promise<Record<string, any>>;
2350
- getById: (_id: string | ObjectId) => Promise<TProvince>;
2351
- updateFieldById: ({ _id, field, value }?: {
2352
- _id: string | ObjectId;
2353
- field: string;
2354
- value: string;
2355
- }, session?: ClientSession) => Promise<string>;
2356
- deleteById: (_id: string | ObjectId) => Promise<string>;
2357
- getByName: (name: string) => Promise<TProvince>;
2358
- };
2359
-
2360
- declare function useProvinceController(): {
2361
- add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2362
- getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2363
- getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2364
- getByName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2365
- updateField: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2366
- deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2367
- };
2368
-
2369
- type TCityMunicipality = {
2370
- _id?: ObjectId;
2371
- name?: string;
2372
- code: string;
2373
- region: string;
2374
- regionName?: string;
2375
- province: string;
2376
- provinceName?: string;
2377
- createdAt?: string;
2378
- updatedAt?: string;
2379
- deletedAt?: string;
2380
- };
2381
- declare const schemaCityMunicipality: Joi.ObjectSchema<any>;
2382
- declare function MCityMunicipality(value: TCityMunicipality): TCityMunicipality;
2383
-
2384
- declare function useCityMunicipalityRepo(): {
2385
- createIndexes: () => Promise<void>;
2386
- add: (value: TCityMunicipality, session?: ClientSession) => Promise<ObjectId>;
2387
- getAll: ({ search, page, limit, sort, region, province, }?: {
2388
- search?: string | undefined;
2389
- page?: number | undefined;
2390
- limit?: number | undefined;
2391
- sort?: {} | undefined;
2392
- region?: string | undefined;
2393
- province?: string | undefined;
2394
- }) => Promise<Record<string, any>>;
2395
- getById: (_id: string | ObjectId) => Promise<TCityMunicipality>;
2396
- updateFieldById: ({ _id, field, value }?: {
2397
- _id: string | ObjectId;
2398
- field: string;
2399
- value: string;
2400
- }, session?: ClientSession) => Promise<string>;
2401
- deleteById: (_id: string | ObjectId) => Promise<string>;
2402
- getByName: (name: string) => Promise<TCityMunicipality>;
2403
- };
2404
-
2405
- declare function useCityMunicipalityController(): {
2406
- add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2407
- getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2408
- getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2409
- getByName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2410
- updateField: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2411
- deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2412
- };
2413
-
2414
- type TBarangay = {
2415
- _id?: ObjectId;
2416
- name?: string;
2417
- code: string;
2418
- region: string;
2419
- regionName?: string;
2420
- province: string;
2421
- provinceName?: string;
2422
- cityMunicipality: string;
2423
- cityMunicipalityName?: string;
2424
- createdAt?: string;
2425
- updatedAt?: string;
2426
- deletedAt?: string;
2427
- };
2428
- declare const schemaBarangay: Joi.ObjectSchema<any>;
2429
- declare function MBarangay(value: TBarangay): TBarangay;
2430
-
2431
- declare function useBarangayRepo(): {
2432
- createIndexes: () => Promise<void>;
2433
- add: (value: TBarangay, session?: ClientSession) => Promise<ObjectId>;
2434
- getAll: ({ search, page, limit, sort, region, province, cityMunicipality, }?: {
2435
- search?: string | undefined;
2436
- page?: number | undefined;
2437
- limit?: number | undefined;
2438
- sort?: {} | undefined;
2439
- region?: string | undefined;
2440
- province?: string | undefined;
2441
- cityMunicipality?: string | undefined;
2442
- }) => Promise<Record<string, any>>;
2443
- getById: (_id: string | ObjectId) => Promise<TBarangay>;
2444
- updateFieldById: ({ _id, field, value }?: {
2445
- _id: string | ObjectId;
2446
- field: string;
2447
- value: string;
2448
- }, session?: ClientSession) => Promise<string>;
2449
- deleteById: (_id: string | ObjectId) => Promise<string>;
2450
- getByName: (name: string) => Promise<TBarangay>;
2451
- };
2452
-
2453
- declare function useBarangayController(): {
2454
- add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2455
- getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2456
- getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2457
- getByName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2458
- updateField: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2459
- deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2460
- };
2461
-
2462
- type TDivision = {
2463
- _id?: ObjectId;
2464
- name?: string;
2465
- region?: string | ObjectId;
2466
- regionName?: string;
2467
- superintendent?: string | ObjectId;
2468
- superintendentName?: string;
2469
- createdAt?: string;
2470
- updatedAt?: string;
2471
- deletedAt?: string;
2472
- };
2473
- declare const schemaDivision: Joi.ObjectSchema<any>;
2474
- declare function MDivision(value: TDivision): TDivision;
2475
-
2476
- declare function useDivisionRepo(): {
2477
- createIndex: () => Promise<void>;
2478
- createTextIndex: () => Promise<void>;
2479
- createUniqueIndex: () => Promise<void>;
2480
- add: (value: TDivision, session?: ClientSession) => Promise<ObjectId>;
2481
- getAll: ({ search, page, limit, sort, region, }?: {
2482
- search?: string | undefined;
2483
- page?: number | undefined;
2484
- limit?: number | undefined;
2485
- sort?: {} | undefined;
2486
- region?: string | undefined;
2487
- }) => Promise<Record<string, any>>;
2488
- getById: (_id: string | ObjectId) => Promise<TDivision>;
2489
- updateFieldById: ({ _id, field, value }?: {
2490
- _id: string | ObjectId;
2491
- field: string;
2492
- value: string;
2493
- }, session?: ClientSession) => Promise<string>;
2494
- deleteById: (_id: string | ObjectId) => Promise<string>;
2495
- getByName: (name: string) => Promise<TDivision>;
2496
- };
2497
-
2498
- declare function useDivisionService(): {
2499
- add: (value: TDivision) => Promise<string>;
2500
- };
2501
-
2502
- declare function useDivisionController(): {
2503
- createDivision: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2504
- getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2505
- getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2506
- getByName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2507
- updateField: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2508
- deleteDivision: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2509
- };
2510
-
2511
- type TSchool = {
2512
- _id?: ObjectId;
2513
- id: string;
2514
- name: string;
2515
- country?: string;
2516
- address?: string;
2517
- continuedAddress?: string;
2518
- city?: string;
2519
- province?: string;
2520
- district?: string;
2521
- postalCode?: string;
2522
- courses?: Array<string>;
2523
- principalName?: string;
2524
- principalEmail?: string;
2525
- principalNumber?: string;
2526
- region: string | ObjectId;
2527
- regionName?: string;
2528
- division: string | ObjectId;
2529
- divisionName?: string;
2530
- status?: string;
2531
- createdAt?: string;
2532
- updatedAt?: string;
2533
- createdBy?: string | ObjectId;
2534
- };
2535
- declare const schemaSchool: Joi.ObjectSchema<any>;
2536
- declare function MSchool(value: TSchool): TSchool;
2537
-
2538
- declare function useSchoolRepo(): {
2539
- createIndex: () => Promise<void>;
2540
- add: (value: TSchool, session?: ClientSession) => Promise<ObjectId>;
2541
- getAll: ({ page, limit, sort, status, org, app, search, }?: {
2542
- page?: number | undefined;
2543
- limit?: number | undefined;
2544
- sort?: Record<string, number> | undefined;
2545
- status?: string | undefined;
2546
- org?: string | undefined;
2547
- app?: string | undefined;
2548
- search?: string | undefined;
2549
- }) => Promise<{}>;
2550
- updateStatusById: (_id: string | ObjectId, status: string, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
2551
- updateFieldById: ({ _id, field, value }?: {
2552
- _id: string | ObjectId;
2553
- field: string;
2554
- value: string | ObjectId;
2555
- }, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
2556
- getPendingByCreatedBy: (createdBy: string | ObjectId) => Promise<{} | null>;
2557
- getPendingById: (_id: string | ObjectId) => Promise<TSchool>;
2558
- };
2559
-
2560
- declare function useSchoolService(): {
2561
- register: (value: TSchool) => Promise<string>;
2562
- approve: (id: string) => Promise<string>;
2563
- add: (value: TSchool) => Promise<string>;
2564
- addBulk: (file: Express.Multer.File, region: string, division: string) => Promise<{
2565
- message: string;
2566
- details: {
2567
- successful: number;
2568
- failed: number;
2569
- total: number;
2570
- totalSizeMB: number;
2571
- errors: string[];
2572
- };
2573
- }>;
2574
- };
2575
-
2576
- declare function useSchoolController(): {
2577
- add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2578
- getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2579
- getByCreatedBy: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2580
- updateStatusById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2581
- registerSchool: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2582
- approveSchool: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2583
- addBulk: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2584
- };
2585
-
2586
- type TBuilding = {
2587
- _id?: ObjectId;
2588
- school: ObjectId;
2589
- serial?: string;
2590
- name: string;
2591
- levels: number;
2592
- createdAt?: Date | string;
2593
- updatedAt?: Date | string;
2594
- deletedAt?: Date | string;
2595
- status?: string;
2596
- };
2597
- declare const schemaBuilding: Joi.ObjectSchema<any>;
2598
- type TBuildingUnit = {
2599
- _id?: ObjectId;
2600
- school: ObjectId | string;
2601
- name?: string;
2602
- building: ObjectId | string;
2603
- buildingName?: string;
2604
- level: number;
2605
- category: string;
2606
- type: string;
2607
- seating_capacity: number;
2608
- standing_capacity: number;
2609
- description?: string;
2610
- unit_of_measurement: string;
2611
- area: number;
2612
- status: string;
2613
- createdAt?: Date | string;
2614
- updatedAt?: Date | string;
2615
- deletedAt?: Date | string;
2616
- };
2617
- declare const schemaBuildingUnit: Joi.ObjectSchema<any>;
2618
- declare const schemaUpdateOptions: Joi.ObjectSchema<any>;
2619
- declare function MBuilding(value: TBuilding): {
2620
- _id: ObjectId | undefined;
2621
- school: ObjectId;
2622
- serial: string;
2623
- name: string;
2624
- levels: number;
2625
- status: string;
2626
- createdAt: string | Date;
2627
- updatedAt: string | Date;
2628
- deletedAt: string | Date;
2629
- };
2630
- declare function MBuildingUnit(value: TBuildingUnit): {
2631
- _id: ObjectId | undefined;
2632
- school: ObjectId;
2633
- name: string;
2634
- building: ObjectId;
2635
- buildingName: string;
2636
- level: number;
2637
- category: string;
2638
- type: string;
2639
- seating_capacity: number;
2640
- standing_capacity: number;
2641
- description: string;
2642
- unit_of_measurement: string;
2643
- area: number;
2644
- status: string;
2645
- createdAt: string | Date;
2646
- updatedAt: string | Date;
2647
- deletedAt: string | Date;
2648
- };
2649
-
2650
- declare function useBuildingRepo(): {
2651
- createIndexes: () => Promise<void>;
2652
- add: (value: TBuilding, session?: ClientSession) => Promise<ObjectId>;
2653
- getAll: ({ search, page, limit, sort, school, status, }?: {
2654
- search?: string | undefined;
2655
- page?: number | undefined;
2656
- limit?: number | undefined;
2657
- sort?: {} | undefined;
2658
- school?: string | undefined;
2659
- status?: string | undefined;
2660
- }) => Promise<Record<string, any>>;
2661
- getById: (_id: string | ObjectId) => Promise<TBuilding | null>;
2662
- updateById: (_id: ObjectId | string, value: {
2663
- name: string;
2664
- serial: string;
2665
- levels: number;
2666
- }, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
2667
- deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
2668
- };
2669
-
2670
- declare function useBuildingUnitRepo(): {
2671
- createIndexes: () => Promise<void>;
2672
- add: (value: TBuildingUnit, session?: ClientSession) => Promise<ObjectId>;
2673
- getAll: ({ search, page, limit, sort, school, building, status, }?: {
2674
- search?: string | undefined;
2675
- page?: number | undefined;
2676
- limit?: number | undefined;
2677
- sort?: {} | undefined;
2678
- school?: string | undefined;
2679
- building?: string | undefined;
2680
- status?: string | undefined;
2681
- }) => Promise<Record<string, any>>;
2682
- getById: (_id: string | ObjectId) => Promise<TBuildingUnit>;
2683
- getByBuildingLevel: (building: string | ObjectId, level: number) => Promise<TBuildingUnit | null>;
2684
- updateById: (_id: string | ObjectId, value: {
2685
- name?: string | undefined;
2686
- building?: string | undefined;
2687
- level?: number | undefined;
2688
- category?: string | undefined;
2689
- type?: string | undefined;
2690
- seating_capacity?: number | undefined;
2691
- standing_capacity?: number | undefined;
2692
- area?: number | undefined;
2693
- }, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
2694
- getByBuilding: (building: string | ObjectId) => Promise<TBuildingUnit | null>;
2695
- deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<string>;
2696
- updateByBuildingId: (building: string | ObjectId, value: Partial<Pick<TBuildingUnit, "buildingName">>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
2697
- };
2698
-
2699
- declare function useBuildingController(): {
2700
- createBuilding: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2701
- getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2702
- getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2703
- updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2704
- deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2705
- };
2706
-
2707
- declare function useBuildingUnitController(): {
2708
- add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2709
- getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2710
- getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2711
- updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2712
- deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2713
- };
2714
-
2715
- type TAsset = {
2716
- _id?: ObjectId;
2717
- school: ObjectId;
2718
- asset_type: "supply" | "furniture-equipment" | "fixed-asset";
2719
- name: string;
2720
- category: string;
2721
- type: string;
2722
- unit: string;
2723
- status?: string;
2724
- qty?: number;
2725
- brand?: string;
2726
- createdAt?: string | Date;
2727
- updatedAt?: string | Date;
2728
- deletedAt?: string | Date;
2729
- condition?: {
2730
- good: number;
2731
- disposal: number;
2732
- lost: number;
2733
- damaged: number;
2734
- };
2735
- metadata?: {
2736
- title?: string;
2737
- isbn?: string;
2738
- author?: string;
2739
- edition?: string;
2740
- subject?: string;
2741
- grade_level?: number;
2742
- publisher?: string;
2743
- language?: string;
2744
- };
2745
- };
2746
- declare const schemaAsset: Joi.ObjectSchema<any>;
2747
- declare const schemaAssetUpdateOption: Joi.ObjectSchema<any>;
2748
- declare function MAsset(value: TAsset): TAsset;
2749
-
2750
- declare function useAssetRepo(): {
2751
- createIndex: () => Promise<void>;
2752
- add: (value: TAsset) => Promise<ObjectId>;
2753
- updateById: (_id: string | ObjectId, value: Partial<Pick<TAsset, "name" | "brand" | "category" | "type" | "unit" | "qty">>, session?: ClientSession) => Promise<string>;
2754
- deleteById: (_id: string | ObjectId) => Promise<string>;
2755
- getById: (_id: string | ObjectId) => Promise<TAsset>;
2756
- getAll: ({ page, search, limit, status, school, sort, asset_type, }?: {
2757
- page?: number | undefined;
2758
- search?: string | undefined;
2759
- limit?: number | undefined;
2760
- status?: string | undefined;
2761
- school?: string | ObjectId | undefined;
2762
- sort?: Record<string, any> | undefined;
2763
- asset_type: string;
2764
- }) => Promise<{}>;
2765
- getCategories: (school: string | ObjectId, asset_type: string) => Promise<{}>;
2766
- getTypes: (school: string | ObjectId, asset_type: string) => Promise<{}>;
2767
- getUnitsBySchool: (school: string | ObjectId) => Promise<{}>;
2768
- };
2769
-
2770
- declare function useAssetController(): {
2771
- add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2772
- getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2773
- deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2774
- updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2775
- getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2776
- getCategories: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2777
- getTypes: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2778
- getUnitsBySchool: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2779
- };
2780
-
2781
- type TStockCard = {
2782
- _id?: ObjectId;
2783
- school: ObjectId;
2784
- item: ObjectId;
2785
- balance: number;
2786
- qty: number;
2787
- unitCost?: number;
2788
- totalCost?: number;
2789
- status: string;
2790
- condition: string;
2791
- supplier?: string;
2792
- location?: ObjectId;
2793
- locationName?: string;
2794
- reason?: string;
2795
- remarks?: string;
2796
- createdAt?: Date | string;
2797
- updatedAt?: Date | string;
2798
- deletedAt?: Date | string;
2799
- };
2800
- declare const schemaStockCard: Joi.ObjectSchema<any>;
2801
- declare function MStockCard(value: TStockCard): TStockCard;
2802
-
2803
- declare function useStockCardRepository(): {
2804
- createIndex: () => Promise<void>;
2805
- add: (value: TStockCard, session?: ClientSession) => Promise<ObjectId>;
2806
- getById: (_id: string | ObjectId) => Promise<{}>;
2807
- getAll: ({ page, limit, school, sort, id }?: {
2808
- page?: number | undefined;
2809
- limit?: number | undefined;
2810
- school?: string | ObjectId | undefined;
2811
- sort?: Record<string, any> | undefined;
2812
- id: string | ObjectId;
2813
- }) => Promise<{}>;
2814
- getSuppliers: (school: string | ObjectId) => Promise<{}>;
2815
- };
2816
-
2817
- declare function useStockCardController(): {
2818
- add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2819
- getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2820
- getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2821
- getSuppliers: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2822
- };
2823
-
2824
- declare function useGitHubService(): {
2825
- setVariables: (params: {
2826
- githubToken: string;
2827
- repoUrl: string;
2828
- environment: string;
2829
- type: "env" | "secret";
2830
- keyValues: string;
2831
- }) => Promise<string>;
2832
- };
2833
-
2834
- interface AudioTranscriptionOptions {
2835
- prompt?: string;
2836
- language?: string;
2837
- enableTimestamps?: boolean;
2838
- maxTokens?: number;
2839
- }
2840
- interface AudioTranscriptionResult {
2841
- transcription: string;
2842
- confidence?: number;
2843
- language?: string;
2844
- duration?: number;
2845
- timestamps?: Array<{
2846
- start: number;
2847
- end: number;
2848
- text: string;
767
+ interface AudioTranscriptionOptions {
768
+ prompt?: string;
769
+ language?: string;
770
+ enableTimestamps?: boolean;
771
+ maxTokens?: number;
772
+ }
773
+ interface AudioTranscriptionResult {
774
+ transcription: string;
775
+ confidence?: number;
776
+ language?: string;
777
+ duration?: number;
778
+ timestamps?: Array<{
779
+ start: number;
780
+ end: number;
781
+ text: string;
2849
782
  }>;
2850
783
  }
2851
784
  interface AudioFileData {
@@ -2884,6 +817,20 @@ declare function useGeminiAiService(): {
2884
817
  checkPhonemeMatchFromBuffer: (audioBuffer: Buffer, mimeType: string, targetPhoneme: string, options?: PhonemeMatchOptions) => Promise<PhonemeMatchResult>;
2885
818
  };
2886
819
 
820
+ declare function useGitHubService(): {
821
+ setVariables: (params: {
822
+ githubToken: string;
823
+ repoUrl: string;
824
+ environment: string;
825
+ type: "env" | "secret";
826
+ keyValues: string;
827
+ }) => Promise<string>;
828
+ };
829
+
830
+ declare function useTranscribeService(): {
831
+ transcribeAudio: (file: Express.Multer.File) => Promise<void>;
832
+ };
833
+
2887
834
  declare function useAudioTranscriptionController(): {
2888
835
  transcribeFromFile: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2889
836
  transcribeFromBase64: (req: Request, res: Response, next: NextFunction) => Promise<void>;
@@ -2900,443 +847,7 @@ declare function useUtilController(): {
2900
847
  setGitHubVariables: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2901
848
  };
2902
849
 
2903
- type TPlantilla = {
2904
- _id?: ObjectId;
2905
- org: string;
2906
- itemNumber: string;
2907
- orgUnitCode?: string;
2908
- positionTitle: string;
2909
- positionCategory: string;
2910
- salaryGrade: number;
2911
- employmentType?: string;
2912
- personnelType: string;
2913
- region?: ObjectId | string;
2914
- regionName?: string;
2915
- division?: ObjectId | string;
2916
- divisionName?: string;
2917
- employee?: string | ObjectId;
2918
- employeeName?: string;
2919
- annualSalary?: number;
2920
- monthlySalary?: number;
2921
- status?: string;
2922
- createdAt?: Date | string;
2923
- updatedAt?: Date | string;
2924
- deletedAt?: Date | string;
2925
- };
2926
- declare const schemaPlantilla: Joi.ObjectSchema<TPlantilla>;
2927
- declare function MPlantilla(data: Partial<TPlantilla>): TPlantilla;
2928
-
2929
- declare function usePlantillaRepo(): {
2930
- createIndexes: () => Promise<void>;
2931
- add: (value: TPlantilla, session?: ClientSession, clearCache?: boolean) => Promise<ObjectId>;
2932
- getAll: ({ search, page, limit, sort, org, status, }?: {
2933
- search?: string | undefined;
2934
- page?: number | undefined;
2935
- limit?: number | undefined;
2936
- sort?: {} | undefined;
2937
- org?: string | undefined;
2938
- status?: string | undefined;
2939
- }) => Promise<Record<string, any>>;
2940
- getById: (_id: string | ObjectId) => Promise<TPlantilla | null>;
2941
- updateById: (_id: ObjectId | string, value: Partial<Pick<TPlantilla, "status" | "positionTitle" | "updatedAt">>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
2942
- deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
2943
- delCachedData: () => void;
2944
- };
2945
-
2946
- declare function usePlantillaController(): {
2947
- createPlantilla: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2948
- getAllPlantillas: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2949
- getPlantillaById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2950
- updatePlantilla: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2951
- deletePlantilla: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2952
- bulkAddPlantillas: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2953
- };
2954
-
2955
- type TOffice = {
2956
- _id?: ObjectId;
2957
- name: string;
2958
- code: string;
2959
- type: string;
2960
- parent?: ObjectId | string;
2961
- path: string;
2962
- status: string;
2963
- createdAt?: Date | string;
2964
- updatedAt?: Date | string;
2965
- deletedAt?: Date | string;
2966
- };
2967
- declare const schemaOffice: Joi.ObjectSchema<TOffice>;
2968
- declare function MOffice(data: Partial<TOffice>): TOffice;
2969
-
2970
- declare function useOfficeRepo(): {
2971
- createIndexes: () => Promise<void>;
2972
- add: (value: TOffice, session?: ClientSession, clearCache?: boolean) => Promise<ObjectId>;
2973
- getAll: ({ search, page, limit, sort, type, parent, status, }?: {
2974
- search?: string | undefined;
2975
- page?: number | undefined;
2976
- limit?: number | undefined;
2977
- sort?: {} | undefined;
2978
- type?: string | undefined;
2979
- parent?: string | undefined;
2980
- status?: string | undefined;
2981
- }) => Promise<Record<string, any>>;
2982
- getById: (_id: string | ObjectId) => Promise<TOffice | null>;
2983
- updateById: (_id: ObjectId | string, value: Partial<Pick<TOffice, "status" | "name" | "code" | "type" | "parent" | "path" | "updatedAt">>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
2984
- deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
2985
- delCachedData: () => void;
2986
- };
2987
-
2988
- declare function useOfficeService(): {
2989
- addBulk: (file: Express.Multer.File) => Promise<{
2990
- total: number;
2991
- successful: number;
2992
- failed: number;
2993
- errors: string[];
2994
- }>;
2995
- };
2996
-
2997
- declare function useOfficeController(): {
2998
- add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2999
- getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3000
- getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3001
- updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3002
- deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3003
- bulkAddOffices: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3004
- };
3005
-
3006
- type TCurriculumSubject = {
3007
- educationLevel: string;
3008
- gradeLevel: string;
3009
- subjectCode: string;
3010
- subjectName: string;
3011
- subjectType: string;
3012
- sessionFrequency: number;
3013
- sessionDuration: number;
3014
- totalMinutesPerWeek: number;
3015
- };
3016
- type TCurriculum = {
3017
- _id?: ObjectId;
3018
- school: ObjectId | string;
3019
- code: string;
3020
- effectiveSchoolYear: string;
3021
- maxTeachingHoursPerDay: number;
3022
- subjects?: TCurriculumSubject[];
3023
- curriculumMemoRef?: string;
3024
- status?: string;
3025
- createdAt?: Date | string;
3026
- updatedAt?: Date | string;
3027
- deletedAt?: Date | string;
3028
- createdBy?: string;
3029
- updatedBy?: string;
3030
- deletedBy?: string;
3031
- };
3032
- declare const schemaCurriculum: Joi.ObjectSchema<any>;
3033
- declare function MCurriculum(value: TCurriculum): {
3034
- _id: ObjectId | undefined;
3035
- school: string | ObjectId;
3036
- code: string;
3037
- effectiveSchoolYear: string;
3038
- maxTeachingHoursPerDay: number;
3039
- subjects: TCurriculumSubject[];
3040
- curriculumMemoRef: string;
3041
- status: string;
3042
- createdAt: string | Date;
3043
- updatedAt: string | Date;
3044
- deletedAt: string | Date;
3045
- createdBy: string;
3046
- updatedBy: string;
3047
- deletedBy: string;
3048
- };
3049
-
3050
- declare function useCurriculumRepo(): {
3051
- createIndexes: () => Promise<void>;
3052
- add: (value: TCurriculum, session?: ClientSession) => Promise<ObjectId>;
3053
- getAll: ({ search, page, limit, sort, status, }?: {
3054
- search?: string | undefined;
3055
- page?: number | undefined;
3056
- limit?: number | undefined;
3057
- sort?: {} | undefined;
3058
- status?: string | undefined;
3059
- }) => Promise<Record<string, any>>;
3060
- getById: (_id: string | ObjectId) => Promise<TCurriculum | null>;
3061
- updateById: (_id: ObjectId | string, value: {
3062
- code?: string;
3063
- maxTeachingHoursPerDay?: number;
3064
- curriculumMemoRef?: string;
3065
- }, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
3066
- deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
3067
- };
3068
-
3069
- declare function useCurriculumController(): {
3070
- add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3071
- getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3072
- getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3073
- updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3074
- deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3075
- };
3076
-
3077
- type TGradeLevel = {
3078
- _id?: ObjectId;
3079
- school?: ObjectId | string;
3080
- educationLevel: string;
3081
- gradeLevel: string;
3082
- tracks?: string[];
3083
- trackStrands?: string[];
3084
- teachingStyle: string;
3085
- maxNumberOfLearners: number;
3086
- defaultStartTime?: string;
3087
- defaultEndTime?: string;
3088
- status?: string;
3089
- createdAt?: Date | string;
3090
- updatedAt?: Date | string;
3091
- deletedAt?: Date | string;
3092
- createdBy?: string;
3093
- updatedBy?: string;
3094
- deletedBy?: string;
3095
- };
3096
- declare const schemaGradeLevel: Joi.ObjectSchema<any>;
3097
- declare function MGradeLevel(value: TGradeLevel): {
3098
- _id: ObjectId | undefined;
3099
- school: string | ObjectId | undefined;
3100
- educationLevel: string;
3101
- gradeLevel: string;
3102
- tracks: string[];
3103
- trackStrands: string[];
3104
- teachingStyle: string;
3105
- maxNumberOfLearners: number;
3106
- defaultStartTime: string;
3107
- defaultEndTime: string;
3108
- status: string;
3109
- createdAt: string | Date;
3110
- updatedAt: string | Date;
3111
- deletedAt: string | Date;
3112
- createdBy: string;
3113
- updatedBy: string;
3114
- deletedBy: string;
3115
- };
3116
-
3117
- declare function useGradeLevelRepo(): {
3118
- createIndexes: () => Promise<void>;
3119
- add: (value: TGradeLevel, session?: ClientSession) => Promise<ObjectId>;
3120
- getAll: ({ search, page, limit, sort, educationLevel, gradeLevel, teachingStyle, school, status, }?: {
3121
- search?: string | undefined;
3122
- page?: number | undefined;
3123
- limit?: number | undefined;
3124
- sort?: {} | undefined;
3125
- educationLevel?: string | undefined;
3126
- gradeLevel?: string | undefined;
3127
- teachingStyle?: string | undefined;
3128
- school?: string | undefined;
3129
- status?: string | undefined;
3130
- }) => Promise<Record<string, any>>;
3131
- getById: (_id: string | ObjectId) => Promise<bson.Document>;
3132
- updateById: (_id: ObjectId | string, value: {
3133
- educationLevel?: string;
3134
- gradeLevel?: string;
3135
- teachingStyle?: string;
3136
- maxTeachingHoursPerDay?: number;
3137
- maxTeachingHoursPerWeek?: number;
3138
- defaultStartTime?: string;
3139
- defaultEndTime?: string;
3140
- school?: ObjectId | string;
3141
- }, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
3142
- deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
3143
- getByEducationLevel: (educationLevel: string, school?: string) => Promise<mongodb.WithId<bson.Document>[] | TGradeLevel[]>;
3144
- };
3145
-
3146
- declare function useGradeLevelController(): {
3147
- add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3148
- getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3149
- getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3150
- updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3151
- deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3152
- getByEducationLevel: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3153
- };
3154
-
3155
- type BasicEducEnrForm = {
3156
- _id?: ObjectId;
3157
- region: ObjectId;
3158
- sdo: ObjectId;
3159
- school: ObjectId;
3160
- schoolYear: string;
3161
- gradeLevelToEnroll: string;
3162
- learnerInfo: EnrLearnerInfo;
3163
- parentGuardianInfo: EnrParentGuardianInfo;
3164
- addressInfo: AddressInformation;
3165
- returningLearnerInfo?: EnrReturningLearnerInfo;
3166
- seniorHighInfo?: EnrSeniorHighInformation;
3167
- preferredLearningModalities?: EnrLearningModality[];
3168
- certification: EnrCert;
3169
- status?: string;
3170
- rejectionReason?: string;
3171
- createdAt?: Date | string;
3172
- updatedAt?: Date | string;
3173
- deletedAt?: Date | string;
3174
- createdBy?: string;
3175
- updatedBy?: string;
3176
- deletedBy?: string;
3177
- };
3178
- type EnrLearnerInfo = {
3179
- lrn?: string;
3180
- lastName: string;
3181
- firstName: string;
3182
- middleName?: string;
3183
- extensionName?: string;
3184
- birthDate: string;
3185
- sex: "Male" | "Female";
3186
- age: number;
3187
- placeOfBirth?: {
3188
- municipalityCity: string;
3189
- province?: string;
3190
- country?: string;
3191
- };
3192
- motherTongue?: string;
3193
- hasDisability: boolean;
3194
- disabilityTypes?: DisabilityType[];
3195
- otherDisabilityDetails?: string;
3196
- isIndigenous?: boolean;
3197
- indigenousCommunity?: string;
3198
- is4PsBeneficiary?: boolean;
3199
- fourPsHouseholdId?: string;
3200
- };
3201
- type DisabilityType = "Visual Impairment (Blind)" | "Visual Impairment (Low Vision)" | "Hearing Impairment" | "Learning Disability" | "Intellectual Disability" | "Autism Spectrum Disorder" | "Emotional-Behavioral Disorder" | "Orthopedic/Physical Handicap" | "Speech/Language Disorder" | "Cerebral Palsy" | "Special Health Problem/Chronic Disease" | "Multiple Disorder" | "Cancer" | "Other";
3202
- type EnrParentGuardianInfo = {
3203
- father?: PersonContact;
3204
- mother?: PersonContact;
3205
- legalGuardian?: PersonContact;
3206
- };
3207
- type PersonContact = {
3208
- lastName: string;
3209
- firstName: string;
3210
- middleName?: string;
3211
- contactNumber?: string;
3212
- };
3213
- type AddressInformation = {
3214
- currentAddress: EnrAddress;
3215
- permanentAddress?: EnrAddress;
3216
- sameAsCurrent?: boolean;
3217
- };
3218
- type EnrAddress = {
3219
- houseNumber?: string;
3220
- streetName?: string;
3221
- sitio?: string;
3222
- barangay: string;
3223
- municipalityCity: string;
3224
- province: string;
3225
- country?: string;
3226
- zipCode?: string;
3227
- };
3228
- type EnrReturningLearnerInfo = {
3229
- lastGradeLevelCompleted: string;
3230
- lastSchoolYearCompleted: string;
3231
- lastSchoolAttended: string;
3232
- lastSchoolId?: string;
3233
- isReturningLearner: boolean;
3234
- isTransferIn: boolean;
3235
- };
3236
- type EnrSeniorHighInformation = {
3237
- semester: "1st" | "2nd";
3238
- track: string;
3239
- strand: string;
3240
- };
3241
- type EnrLearningModality = "Modular (Print)" | "Modular (Digital)" | "Online" | "Radio-Based Instruction" | "Educational Television" | "Blended" | "Homeschooling";
3242
- type EnrCert = {
3243
- certifiedBy: string;
3244
- date: string;
3245
- consentGiven: boolean;
3246
- };
3247
- declare const schemaEnrollment: Joi.ObjectSchema<any>;
3248
- declare function MEnrollment(value: BasicEducEnrForm): {
3249
- _id: ObjectId | undefined;
3250
- region: ObjectId;
3251
- sdo: ObjectId;
3252
- school: ObjectId;
3253
- schoolYear: string;
3254
- gradeLevelToEnroll: string;
3255
- learnerInfo: EnrLearnerInfo;
3256
- parentGuardianInfo: EnrParentGuardianInfo;
3257
- addressInfo: AddressInformation;
3258
- returningLearnerInfo: EnrReturningLearnerInfo | undefined;
3259
- seniorHighInfo: EnrSeniorHighInformation | undefined;
3260
- preferredLearningModalities: EnrLearningModality[];
3261
- certification: EnrCert;
3262
- status: string;
3263
- rejectionReason: string;
3264
- createdAt: string | Date;
3265
- updatedAt: string | Date;
3266
- deletedAt: string | Date;
3267
- createdBy: string;
3268
- updatedBy: string;
3269
- deletedBy: string;
3270
- };
3271
-
3272
- declare function useEnrollmentRepo(): {
3273
- createIndexes: () => Promise<void>;
3274
- add: (value: BasicEducEnrForm, session?: ClientSession) => Promise<ObjectId>;
3275
- updateById: (_id: ObjectId | string, value: Partial<BasicEducEnrForm>, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
3276
- getAll: ({ search, page, limit, sort, status, school, schoolYear, gradeLevelToEnroll, }?: {
3277
- search?: string | undefined;
3278
- page?: number | undefined;
3279
- limit?: number | undefined;
3280
- sort?: {} | undefined;
3281
- status?: string | undefined;
3282
- school?: string | undefined;
3283
- schoolYear?: string | undefined;
3284
- gradeLevelToEnroll?: string | undefined;
3285
- }) => Promise<Record<string, any>>;
3286
- getById: (_id: string | ObjectId) => Promise<BasicEducEnrForm>;
3287
- getByLrn: (lrn: string, schoolYear?: string) => Promise<BasicEducEnrForm | null>;
3288
- deleteById: (_id: string | ObjectId, deletedBy?: string, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
3289
- getBySchoolAndYear: (school: string | ObjectId, schoolYear: string) => Promise<BasicEducEnrForm[]>;
3290
- };
3291
-
3292
- declare function useEnrollmentService(): {
3293
- createEnrollment: (value: BasicEducEnrForm) => Promise<{
3294
- message: string;
3295
- id: ObjectId;
3296
- }>;
3297
- updateEnrollment: (_id: string | ObjectId, value: Partial<BasicEducEnrForm>) => Promise<{
3298
- message: string;
3299
- modifiedCount: number;
3300
- }>;
3301
- getEnrollments: ({ search, page, limit, sort, status, school, schoolYear, gradeLevelToEnroll, }?: {
3302
- search?: string | undefined;
3303
- page?: number | undefined;
3304
- limit?: number | undefined;
3305
- sort?: {} | undefined;
3306
- status?: string | undefined;
3307
- school?: string | undefined;
3308
- schoolYear?: string | undefined;
3309
- gradeLevelToEnroll?: string | undefined;
3310
- }) => Promise<Record<string, any>>;
3311
- getEnrollmentById: (_id: string | ObjectId) => Promise<BasicEducEnrForm>;
3312
- getEnrollmentByLrn: (lrn: string, schoolYear?: string) => Promise<BasicEducEnrForm | null>;
3313
- deleteEnrollment: (_id: string | ObjectId, deletedBy?: string) => Promise<{
3314
- message: string;
3315
- modifiedCount: number;
3316
- }>;
3317
- getEnrollmentsBySchoolAndYear: (school: string | ObjectId, schoolYear: string) => Promise<BasicEducEnrForm[]>;
3318
- approveEnrollment: (_id: string | ObjectId, approvedBy: string) => Promise<{
3319
- message: string;
3320
- modifiedCount: number;
3321
- }>;
3322
- rejectEnrollment: (_id: string | ObjectId, rejectedBy: string, rejectionReason?: string) => Promise<{
3323
- message: string;
3324
- modifiedCount: number;
3325
- }>;
3326
- };
3327
-
3328
- declare function useEnrollmentController(): {
3329
- add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3330
- updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3331
- getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3332
- getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3333
- getByLrn: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3334
- deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3335
- getBySchoolAndYear: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3336
- approve: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3337
- reject: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3338
- getStatsBySchool: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3339
- };
850
+ declare const transactionSchema: Joi.ObjectSchema<any>;
3340
851
 
3341
852
  declare const MONGO_URI: string;
3342
853
  declare const MONGO_DB: string;
@@ -3377,4 +888,4 @@ declare const GEMINI_API_KEY: string;
3377
888
  declare const ASSEMBLY_AI_API_KEY: string;
3378
889
  declare const DOMAIN: string;
3379
890
 
3380
- export { ACCESS_TOKEN_EXPIRY, ACCESS_TOKEN_SECRET, APP_ACCOUNT, APP_MAIN, ASSEMBLY_AI_API_KEY, AddressInformation, AudioFileData, AudioTranscriptionOptions, AudioTranscriptionResult, BasicEducEnrForm, CardPayment, CardPaymentSchema, DEFAULT_USER_EMAIL, DEFAULT_USER_FIRST_NAME, DEFAULT_USER_LAST_NAME, DEFAULT_USER_PASSWORD, DOMAIN, DirectDebit, DirectDebitSchema, DisabilityType, EWalletPayment, EWalletPaymentSchema, EnrAddress, EnrCert, EnrLearnerInfo, EnrLearningModality, EnrParentGuardianInfo, EnrReturningLearnerInfo, EnrSeniorHighInformation, GEMINI_API_KEY, MAILER_EMAIL, MAILER_PASSWORD, MAILER_TRANSPORT_HOST, MAILER_TRANSPORT_PORT, MAILER_TRANSPORT_SECURE, MAddress, MAsset, MBarangay, MBuilding, MBuildingUnit, MCityMunicipality, MCurriculum, MDivision, MEnrollment, MEntity, MFile, MGradeLevel, MMember, MONGO_DB, MONGO_URI, MOffice, MOrder, MOrg, MPaymentMethod, MPlantilla, MPromoCode, MProvince, MRegion, MRole, MSchool, MStockCard, MSubscription, MToken, MUser, MUserRole, MVerification, PAYPAL_API_URL, PAYPAL_CLIENT_ID, PAYPAL_CLIENT_SECRET, PGOTypes, PORT, PersonContact, PhonemeMatchOptions, PhonemeMatchResult, 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, TAsset, TBarangay, TBillingRecipient, TBuilding, TBuildingUnit, TCityMunicipality, TCounter, TCurriculum, TCurriculumSubject, TDivision, TEntity, TFile, TGradeLevel, TInvoice, TMember, TMiniRole, TOffice, TOrder, TOrderMetadata, TOrg, TPGO, TPSGC, TPayment, TPaymentMethod$1 as TPaymentMethod, TPaymentMethodType, TPlantilla, TPrice, TPriceType, TPromoCode, TPromoTier, TProvince, TRegion, TRole, TSchool, TSector, TStockCard, TSubscription, TToken, TUser, TUserRole, TVerification, TVerificationMetadata, VERIFICATION_FORGET_PASSWORD_DURATION, VERIFICATION_USER_INVITE_DURATION, XENDIT_BASE_URL, XENDIT_SECRET_KEY, addressSchema, isDev, modelPGO, modelPSGC, modelSector, schema, schemaAsset, schemaAssetUpdateOption, schemaBarangay, schemaBuilding, schemaBuildingUnit, schemaCityMunicipality, schemaCurriculum, schemaDivision, schemaEnrollment, schemaGradeLevel, schemaOffice, schemaOrg, schemaPGO, schemaPSGC, schemaPlantilla, schemaProvince, schemaRegion, schemaSchool, schemaSector, schemaStockCard, schemaUpdateOptions, useAddressController, useAddressRepo, useAssetController, useAssetRepo, useAudioTranscriptionController, useAuthController, useAuthService, useBarangayController, useBarangayRepo, useBuildingController, useBuildingRepo, useBuildingUnitController, useBuildingUnitRepo, useCityMunicipalityController, useCityMunicipalityRepo, useCounterModel, useCounterRepo, useCurriculumController, useCurriculumRepo, useDivisionController, useDivisionRepo, useDivisionService, useEnrollmentController, useEnrollmentRepo, useEnrollmentService, useEntityController, useEntityRepo, useFileController, useFileRepo, useFileService, useGeminiAiService, useGitHubService, useGradeLevelController, useGradeLevelRepo, useInvoiceModel, useInvoiceRepo, useMemberController, useMemberRepo, useOfficeController, useOfficeRepo, useOfficeService, useOrderController, useOrderRepo, useOrgController, useOrgRepo, useOrgService, usePGOController, usePGORepo, usePSGCController, usePSGCRepo, usePaymentController, usePaymentMethodController, usePaymentMethodRepo, usePaymentMethodService, usePaymentModel, usePaymentRepo, usePaypalService, usePlantillaController, usePlantillaRepo, usePriceController, usePriceModel, usePriceRepo, usePromoCodeController, usePromoCodeRepo, useProvinceController, useProvinceRepo, useRegionController, useRegionRepo, useRoleController, useRoleRepo, useSchoolController, useSchoolRepo, useSchoolService, useSectorController, useSectorRepo, useStockCardController, useStockCardRepository, useSubscriptionRepo, useTokenRepo, useUserController, useUserRepo, useUserService, useUtilController, useVerificationController, useVerificationRepo, useVerificationService, useXenditService, validateCardPayment, validateDirectDebit, validateEWalletPayment };
891
+ export { ACCESS_TOKEN_EXPIRY, ACCESS_TOKEN_SECRET, APP_ACCOUNT, APP_MAIN, ASSEMBLY_AI_API_KEY, AudioFileData, AudioTranscriptionOptions, AudioTranscriptionResult, DEFAULT_USER_EMAIL, DEFAULT_USER_FIRST_NAME, DEFAULT_USER_LAST_NAME, DEFAULT_USER_PASSWORD, DOMAIN, GEMINI_API_KEY, MAILER_EMAIL, MAILER_PASSWORD, MAILER_TRANSPORT_HOST, MAILER_TRANSPORT_PORT, MAILER_TRANSPORT_SECURE, MAddress, MBuilding, MBuildingUnit, MFile, MMember, MONGO_DB, MONGO_URI, MOrg, MRole, MToken, MUser, MUserRole, MVerification, PAYPAL_API_URL, PAYPAL_CLIENT_ID, PAYPAL_CLIENT_SECRET, PORT, PhonemeMatchOptions, PhonemeMatchResult, 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, TBuilding, TBuildingUnit, TCounter, TFile, TMember, TMiniRole, TOrg, TRole, TToken, TUser, TUserRole, TVerification, TVerificationMetadata, VERIFICATION_FORGET_PASSWORD_DURATION, VERIFICATION_USER_INVITE_DURATION, XENDIT_BASE_URL, XENDIT_SECRET_KEY, addressSchema, isDev, schemaBuilding, schemaBuildingUnit, schemaOrg, schemaUpdateOptions, transactionSchema, useAddressController, useAddressRepo, useAudioTranscriptionController, useAuthController, useAuthService, useBuildingController, useBuildingRepo, useBuildingService, useBuildingUnitController, useBuildingUnitRepo, useBuildingUnitService, useCounterModel, useCounterRepo, useFileController, useFileRepo, useFileService, useGeminiAiService, useGitHubService, useMemberController, useMemberRepo, useOrgController, useOrgRepo, useOrgService, useRoleController, useRoleRepo, useTokenRepo, useTranscribeService, useUserController, useUserRepo, useUserService, useUtilController, useVerificationController, useVerificationRepo, useVerificationService };