@eeplatform/core 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -2,8 +2,8 @@ import * as mongodb from 'mongodb';
2
2
  import { ObjectId, ClientSession, Db, Collection } from 'mongodb';
3
3
  import * as bson from 'bson';
4
4
  import { Request, Response, NextFunction } from 'express';
5
- import Joi from 'joi';
6
5
  import { z } from 'zod';
6
+ import Joi from 'joi';
7
7
 
8
8
  type TVerificationMetadata = {
9
9
  name?: string;
@@ -436,214 +436,6 @@ declare function useEntityController(): {
436
436
  deleteEntity: (req: Request, res: Response, next: NextFunction) => Promise<void>;
437
437
  };
438
438
 
439
- type TBillingRecipient = {
440
- addedAt?: Date | string;
441
- email: string;
442
- };
443
- type TSubscription = {
444
- _id?: ObjectId;
445
- user?: ObjectId | string;
446
- org?: ObjectId | string;
447
- customerId?: string;
448
- paymentMethodId?: string;
449
- amount: number;
450
- description?: string;
451
- currency: string;
452
- promoCode?: string;
453
- type: string;
454
- paidSeats?: number;
455
- currentSeats?: number;
456
- maxSeats?: number;
457
- status?: string;
458
- billingCycle: "monthly" | "yearly";
459
- billingContacts?: Array<TBillingRecipient>;
460
- nextBillingDate?: Date;
461
- lastPaymentStatus?: string;
462
- failedAttempts?: number;
463
- createdAt?: string | Date;
464
- updatedAt?: string | Date;
465
- deletedAt?: string | Date;
466
- };
467
- declare function MSubscription(value: TSubscription): TSubscription;
468
-
469
- declare function useSubscriptionRepo(): {
470
- createIndex: () => Promise<void>;
471
- createUniqueIndex: () => Promise<void>;
472
- add: (value: TSubscription, session?: ClientSession) => Promise<ObjectId>;
473
- getById: (_id: string | ObjectId) => Promise<TSubscription | null>;
474
- getBySubscriptionId: (subscriptionId: string) => Promise<TSubscription | null>;
475
- getByUserId: (user: string | ObjectId) => Promise<TSubscription | null>;
476
- getSubscriptions: ({ search, page, limit, sort, status, }?: {
477
- search?: string | undefined;
478
- page?: number | undefined;
479
- limit?: number | undefined;
480
- sort?: {} | undefined;
481
- status?: string | undefined;
482
- }) => Promise<Record<string, any>>;
483
- updateStatus: (_id: string | ObjectId, status: string) => Promise<string>;
484
- getByOrgId: (org: string | ObjectId) => Promise<TSubscription | null>;
485
- getByAffiliateUserId: (user: string | ObjectId) => Promise<TSubscription | null>;
486
- getDueSubscriptions: (BATCH_SIZE?: number) => Promise<TSubscription[]>;
487
- getFailedSubscriptions: (BATCH_SIZE?: number) => Promise<TSubscription[]>;
488
- processSuccessfulPayment: (value: Pick<TSubscription, "nextBillingDate"> & {
489
- _id: string | ObjectId;
490
- }, session?: ClientSession) => Promise<string>;
491
- markSubscriptionAsFailed: ({ _id, failed }?: {
492
- _id: string | ObjectId;
493
- failed?: boolean | undefined;
494
- }, session?: ClientSession) => Promise<mongodb.UpdateResult<TSubscription>>;
495
- markSubscriptionAsCanceled: (_id: string | ObjectId, session?: ClientSession) => Promise<mongodb.UpdateResult<TSubscription>>;
496
- updateSeatsById: ({ _id, currentSeats, maxSeats, paidSeats, amount, status, nextBillingDate, }?: {
497
- _id: string | ObjectId;
498
- currentSeats: number;
499
- maxSeats: number;
500
- paidSeats?: number | undefined;
501
- amount: number;
502
- status?: string | undefined;
503
- nextBillingDate?: string | undefined;
504
- }, session?: ClientSession) => Promise<mongodb.UpdateResult<TSubscription>>;
505
- updateMaxSeatsById: ({ _id, seats }?: {
506
- _id: string | ObjectId;
507
- seats: number;
508
- }, session?: ClientSession) => Promise<mongodb.UpdateResult<TSubscription>>;
509
- updateStatusById: (_id: string | ObjectId, status: string, session?: ClientSession) => Promise<mongodb.UpdateResult<TSubscription>>;
510
- updatePromoCodeById: (_id: string | ObjectId, promoCode: string, session?: ClientSession) => Promise<mongodb.UpdateResult<TSubscription>>;
511
- updatePaymentMethodById: (_id: string | ObjectId, paymentMethodId: string, session?: ClientSession) => Promise<mongodb.UpdateResult<TSubscription>>;
512
- addBillingContactById: (_id: string | ObjectId, email: string) => Promise<string>;
513
- updateBillingContactByAddedAt: (_id: string | ObjectId, addedAt: string | Date, email: string) => Promise<string>;
514
- deleteBillingContactByAddedAt: (_id: string | ObjectId, addedAt: string | Date) => Promise<string>;
515
- };
516
-
517
- type TOrg = {
518
- _id?: ObjectId;
519
- name: string;
520
- description: string;
521
- type?: string;
522
- email?: string;
523
- contact?: string;
524
- busInst?: string;
525
- status?: string;
526
- xenditCustomerId?: string;
527
- createdAt?: string;
528
- updatedAt?: string;
529
- deletedAt?: string;
530
- };
531
- declare function MOrg(value: TOrg): TOrg;
532
-
533
- type TAddress = {
534
- _id?: ObjectId;
535
- type: string;
536
- user: ObjectId | string;
537
- org?: ObjectId | string;
538
- country: string;
539
- address: string;
540
- continuedAddress?: string;
541
- city: string;
542
- province: string;
543
- postalCode: string;
544
- taxId: string;
545
- };
546
- declare const addressSchema: Joi.ObjectSchema<any>;
547
- declare function MAddress(value: any): TAddress;
548
-
549
- declare function useSubscriptionService(): {
550
- subscribe: (value: {
551
- user: string;
552
- currency: string;
553
- perSeatPrice: number;
554
- seats: number;
555
- transactionId?: string | undefined;
556
- promoCode?: string | undefined;
557
- org: {
558
- name: string;
559
- type: string;
560
- email: string;
561
- busInst?: string;
562
- contact: string;
563
- description: string;
564
- };
565
- }) => Promise<{
566
- message: string;
567
- data: {
568
- org: string;
569
- };
570
- }>;
571
- getByUserId: (id: string) => Promise<any>;
572
- getStatusByUser: (user: string) => Promise<string>;
573
- createAffiliateSubscription: (value: {
574
- user: string;
575
- amount: number;
576
- currency: string;
577
- promoCode?: string | undefined;
578
- payment_method_id: string;
579
- payment_method_expiry_month?: string | undefined;
580
- payment_method_expiry_year?: string | undefined;
581
- payment_method_cvv?: string | undefined;
582
- payment_method_cardholder_name?: string | undefined;
583
- payment_method_channel: string;
584
- payment_method_type: string;
585
- customer_id: string;
586
- billingAddress: TAddress;
587
- }) => Promise<string>;
588
- createOrgSubscription: (value: {
589
- user: string;
590
- amount: number;
591
- currency: string;
592
- promoCode?: string | undefined;
593
- payment_method_id: string;
594
- payment_method_expiry_month?: string | undefined;
595
- payment_method_expiry_year?: string | undefined;
596
- payment_method_cvv?: string | undefined;
597
- payment_method_cardholder_name?: string | undefined;
598
- payment_method_channel: string;
599
- payment_method_type: string;
600
- customer_id: string;
601
- organization: TOrg;
602
- billingAddress: TAddress;
603
- seats: number;
604
- }) => Promise<{
605
- message: string;
606
- data: {
607
- org: string;
608
- };
609
- }>;
610
- processSubscriptions: (batchSize?: number, maxRetries?: number) => Promise<void>;
611
- updateSeatsById: (value: {
612
- transactionId?: string | undefined;
613
- subscriptionId: string;
614
- seats: number;
615
- amount: number;
616
- }) => Promise<void>;
617
- updateSubscriptionSeats: (value: {
618
- transactionId?: string | undefined;
619
- subscriptionId: string;
620
- seats: number;
621
- amount: number;
622
- }) => Promise<void>;
623
- processSubscriptionPayment: (invoiceNumber: string, subscriptionId: string) => Promise<void>;
624
- };
625
-
626
- declare function useSubscriptionController(): {
627
- subscribe: (req: Request, res: Response, next: NextFunction) => Promise<void>;
628
- add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
629
- getByUserId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
630
- getByOrgId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
631
- getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
632
- getByAffiliateUserId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
633
- getSubscriptions: (req: Request, res: Response, next: NextFunction) => Promise<void>;
634
- getSubscriptionStatus: (req: Request, res: Response, next: NextFunction) => Promise<void>;
635
- createAffiliateSubscription: (req: Request, res: Response, next: NextFunction) => Promise<void>;
636
- createOrgSubscription: (req: Request, res: Response, next: NextFunction) => Promise<void>;
637
- updateSubscriptionSeats: (req: Request, res: Response, next: NextFunction) => Promise<void>;
638
- updatePromoCodeById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
639
- updateStatusById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
640
- updatePaymentMethodById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
641
- addBillingContactById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
642
- updateBillingContactByAddedAt: (req: Request, res: Response, next: NextFunction) => Promise<void>;
643
- deleteBillingContactByAddedAt: (req: Request, res: Response, next: NextFunction) => Promise<void>;
644
- processSubscriptionPayment: (req: Request, res: Response, next: NextFunction) => Promise<void>;
645
- };
646
-
647
439
  declare const CustomerSchema: z.ZodEffects<z.ZodObject<{
648
440
  reference_id: z.ZodString;
649
441
  type: z.ZodEnum<["INDIVIDUAL", "BUSINESS"]>;
@@ -1140,12 +932,28 @@ declare function usePaymentMethodController(): {
1140
932
  updatePaymentMethodStatusById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1141
933
  };
1142
934
 
935
+ type TAddress = {
936
+ _id?: ObjectId;
937
+ type: string;
938
+ user: ObjectId | string;
939
+ org?: ObjectId | string;
940
+ country: string;
941
+ address: string;
942
+ continuedAddress?: string;
943
+ city: string;
944
+ province: string;
945
+ postalCode: string;
946
+ taxId: string;
947
+ };
948
+ declare const addressSchema: Joi.ObjectSchema<any>;
949
+ declare function MAddress(value: any): TAddress;
950
+
1143
951
  declare function useAddressRepo(): {
1144
952
  createIndex: () => Promise<void>;
1145
953
  add: (value: TAddress, session?: ClientSession) => Promise<ObjectId>;
1146
954
  getByUserId: (user: string | ObjectId) => Promise<TAddress | null>;
1147
955
  getByOrgId: (org: string | ObjectId) => Promise<TAddress | null>;
1148
- updateById: (_id: string | ObjectId, value: Pick<TAddress, "org" | "country" | "city" | "address" | "continuedAddress" | "province" | "postalCode" | "taxId">, session?: ClientSession) => Promise<string>;
956
+ updateById: (_id: string | ObjectId, value: Pick<TAddress, "org" | "country" | "city" | "province" | "address" | "continuedAddress" | "postalCode" | "taxId">, session?: ClientSession) => Promise<string>;
1149
957
  };
1150
958
 
1151
959
  declare function useAddressController(): {
@@ -1155,10 +963,76 @@ declare function useAddressController(): {
1155
963
  updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1156
964
  };
1157
965
 
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
+
1158
1034
  declare function useOrgRepo(): {
1159
- createIndex: () => Promise<void>;
1160
- createTextIndex: () => Promise<void>;
1161
- createUniqueIndex: () => Promise<void>;
1035
+ createIndexes: () => Promise<void>;
1162
1036
  add: (value: TOrg, session?: ClientSession) => Promise<ObjectId>;
1163
1037
  getAll: ({ search, page, limit, sort, status, }?: {
1164
1038
  search?: string | undefined;
@@ -1178,11 +1052,7 @@ declare function useOrgRepo(): {
1178
1052
  };
1179
1053
 
1180
1054
  declare function useOrgService(): {
1181
- createOrg: ({ user, name, description }?: {
1182
- user?: string | undefined;
1183
- name?: string | undefined;
1184
- description?: string | undefined;
1185
- }) => Promise<string>;
1055
+ add: (value: TOrg) => Promise<string>;
1186
1056
  };
1187
1057
 
1188
1058
  declare function useOrgController(): {
@@ -1359,6 +1229,84 @@ declare function useOrderController(): {
1359
1229
  getOrders: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1360
1230
  };
1361
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
+
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, }?: {
1270
+ search?: string | undefined;
1271
+ page?: number | undefined;
1272
+ limit?: number | undefined;
1273
+ sort?: {} | undefined;
1274
+ status?: string | undefined;
1275
+ }) => 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
+
1362
1310
  declare const TInvoice: z.ZodObject<{
1363
1311
  _id: z.ZodEffects<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<ObjectId, z.ZodTypeDef, ObjectId>]>>, ObjectId | undefined, string | ObjectId | undefined>;
1364
1312
  invoiceNumber: z.ZodString;
@@ -1627,21 +1575,9 @@ declare function useInvoiceRepo(): {
1627
1575
  transactionId?: string | undefined;
1628
1576
  currency?: string | undefined;
1629
1577
  subscriptionId?: string | ObjectId | undefined;
1630
- billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
1631
- } | undefined;
1632
- } | null>;
1633
- };
1634
-
1635
- declare function useInvoiceService(): {
1636
- processOverDueInvoices: (BATCH_SIZE?: number, MAX_RETRIES?: number) => Promise<void>;
1637
- paypalPaidInvoiceWebhookHandler: (invoiceId: string) => Promise<"Payment processed successfully." | undefined>;
1638
- };
1639
-
1640
- declare function useInvoiceController(): {
1641
- getBySubscriptionId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1642
- getByNumber: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1643
- getByDueDateStatus: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1644
- paidInvoiceWebhookHandler: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1578
+ billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
1579
+ } | undefined;
1580
+ } | null>;
1645
1581
  };
1646
1582
 
1647
1583
  declare const TPaymentMethod: z.ZodEnum<["CARD", "DIRECT_DEBIT", "VIRTUAL_ACCOUNT", "EWALLET", "OVER_THE_COUNTER", "QR_CODE", "PAYPAL"]>;
@@ -2268,8 +2204,7 @@ declare function usePaypalService(): {
2268
2204
  type TRegion = {
2269
2205
  _id?: ObjectId;
2270
2206
  name?: string;
2271
- director?: string | ObjectId;
2272
- directorName?: string;
2207
+ code: string;
2273
2208
  createdAt?: string;
2274
2209
  updatedAt?: string;
2275
2210
  deletedAt?: string;
@@ -2278,9 +2213,7 @@ declare const schemaRegion: Joi.ObjectSchema<any>;
2278
2213
  declare function MRegion(value: TRegion): TRegion;
2279
2214
 
2280
2215
  declare function useRegionRepo(): {
2281
- createIndex: () => Promise<void>;
2282
- createTextIndex: () => Promise<void>;
2283
- createUniqueIndex: () => Promise<void>;
2216
+ createIndexes: () => Promise<void>;
2284
2217
  add: (value: TRegion, session?: ClientSession) => Promise<ObjectId>;
2285
2218
  getAll: ({ search, page, limit, sort }?: {
2286
2219
  search?: string | undefined;
@@ -2298,17 +2231,148 @@ declare function useRegionRepo(): {
2298
2231
  getByName: (name: string) => Promise<TRegion>;
2299
2232
  };
2300
2233
 
2301
- declare function useRegionService(): {
2302
- add: (value: TRegion) => Promise<string>;
2234
+ declare function useRegionController(): {
2235
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2236
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2237
+ getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2238
+ getByName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2239
+ updateField: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2240
+ deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2303
2241
  };
2304
2242
 
2305
- declare function useRegionController(): {
2306
- createRegion: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2243
+ type TProvince = {
2244
+ _id?: ObjectId;
2245
+ name?: string;
2246
+ code: string;
2247
+ region: string;
2248
+ regionName?: string;
2249
+ createdAt?: string;
2250
+ updatedAt?: string;
2251
+ deletedAt?: string;
2252
+ };
2253
+ declare const schemaProvince: Joi.ObjectSchema<any>;
2254
+ declare function MProvince(value: TProvince): TProvince;
2255
+
2256
+ declare function useProvinceRepo(): {
2257
+ createIndexes: () => Promise<void>;
2258
+ add: (value: TProvince, session?: ClientSession) => Promise<ObjectId>;
2259
+ getAll: ({ search, page, limit, sort, region, }?: {
2260
+ search?: string | undefined;
2261
+ page?: number | undefined;
2262
+ limit?: number | undefined;
2263
+ sort?: {} | undefined;
2264
+ region?: string | undefined;
2265
+ }) => Promise<Record<string, any>>;
2266
+ getById: (_id: string | ObjectId) => Promise<TProvince>;
2267
+ updateFieldById: ({ _id, field, value }?: {
2268
+ _id: string | ObjectId;
2269
+ field: string;
2270
+ value: string;
2271
+ }, session?: ClientSession) => Promise<string>;
2272
+ deleteById: (_id: string | ObjectId) => Promise<string>;
2273
+ getByName: (name: string) => Promise<TProvince>;
2274
+ };
2275
+
2276
+ declare function useProvinceController(): {
2277
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2278
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2279
+ getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2280
+ getByName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2281
+ updateField: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2282
+ deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2283
+ };
2284
+
2285
+ type TCityMunicipality = {
2286
+ _id?: ObjectId;
2287
+ name?: string;
2288
+ code: string;
2289
+ region: string;
2290
+ regionName?: string;
2291
+ province: string;
2292
+ provinceName?: string;
2293
+ createdAt?: string;
2294
+ updatedAt?: string;
2295
+ deletedAt?: string;
2296
+ };
2297
+ declare const schemaCityMunicipality: Joi.ObjectSchema<any>;
2298
+ declare function MCityMunicipality(value: TCityMunicipality): TCityMunicipality;
2299
+
2300
+ declare function useCityMunicipalityRepo(): {
2301
+ createIndexes: () => Promise<void>;
2302
+ add: (value: TCityMunicipality, session?: ClientSession) => Promise<ObjectId>;
2303
+ getAll: ({ search, page, limit, sort, region, province, }?: {
2304
+ search?: string | undefined;
2305
+ page?: number | undefined;
2306
+ limit?: number | undefined;
2307
+ sort?: {} | undefined;
2308
+ region?: string | undefined;
2309
+ province?: string | undefined;
2310
+ }) => Promise<Record<string, any>>;
2311
+ getById: (_id: string | ObjectId) => Promise<TCityMunicipality>;
2312
+ updateFieldById: ({ _id, field, value }?: {
2313
+ _id: string | ObjectId;
2314
+ field: string;
2315
+ value: string;
2316
+ }, session?: ClientSession) => Promise<string>;
2317
+ deleteById: (_id: string | ObjectId) => Promise<string>;
2318
+ getByName: (name: string) => Promise<TCityMunicipality>;
2319
+ };
2320
+
2321
+ declare function useCityMunicipalityController(): {
2322
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2323
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2324
+ getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2325
+ getByName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2326
+ updateField: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2327
+ deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2328
+ };
2329
+
2330
+ type TBarangay = {
2331
+ _id?: ObjectId;
2332
+ name?: string;
2333
+ code: string;
2334
+ region: string;
2335
+ regionName?: string;
2336
+ province: string;
2337
+ provinceName?: string;
2338
+ cityMunicipality: string;
2339
+ cityMunicipalityName?: string;
2340
+ createdAt?: string;
2341
+ updatedAt?: string;
2342
+ deletedAt?: string;
2343
+ };
2344
+ declare const schemaBarangay: Joi.ObjectSchema<any>;
2345
+ declare function MBarangay(value: TBarangay): TBarangay;
2346
+
2347
+ declare function useBarangayRepo(): {
2348
+ createIndexes: () => Promise<void>;
2349
+ add: (value: TBarangay, session?: ClientSession) => Promise<ObjectId>;
2350
+ getAll: ({ search, page, limit, sort, region, province, cityMunicipality, }?: {
2351
+ search?: string | undefined;
2352
+ page?: number | undefined;
2353
+ limit?: number | undefined;
2354
+ sort?: {} | undefined;
2355
+ region?: string | undefined;
2356
+ province?: string | undefined;
2357
+ cityMunicipality?: string | undefined;
2358
+ }) => Promise<Record<string, any>>;
2359
+ getById: (_id: string | ObjectId) => Promise<TBarangay>;
2360
+ updateFieldById: ({ _id, field, value }?: {
2361
+ _id: string | ObjectId;
2362
+ field: string;
2363
+ value: string;
2364
+ }, session?: ClientSession) => Promise<string>;
2365
+ deleteById: (_id: string | ObjectId) => Promise<string>;
2366
+ getByName: (name: string) => Promise<TBarangay>;
2367
+ };
2368
+
2369
+ declare function useBarangayController(): {
2370
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2307
2371
  getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2308
2372
  getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2309
2373
  getByName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2310
2374
  updateField: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2311
- deleteRegion: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2375
+ deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2312
2376
  };
2313
2377
 
2314
2378
  type TDivision = {
@@ -3190,141 +3254,6 @@ declare function useEnrollmentController(): {
3190
3254
  getStatsBySchool: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3191
3255
  };
3192
3256
 
3193
- type TProvince = {
3194
- _id?: ObjectId;
3195
- name?: string;
3196
- status?: string;
3197
- createdAt?: string;
3198
- updatedAt?: string;
3199
- deletedAt?: string;
3200
- };
3201
- declare const schemaProvince: Joi.ObjectSchema<any>;
3202
- declare function MProvince(value: TProvince): TProvince;
3203
-
3204
- declare function useProvinceRepo(): {
3205
- createIndex: () => Promise<void>;
3206
- createTextIndex: () => Promise<void>;
3207
- createUniqueIndex: () => Promise<void>;
3208
- add: (value: TProvince, session?: ClientSession) => Promise<ObjectId>;
3209
- getAll: ({ search, page, limit, sort }?: {
3210
- search?: string | undefined;
3211
- page?: number | undefined;
3212
- limit?: number | undefined;
3213
- sort?: {} | undefined;
3214
- }) => Promise<Record<string, any>>;
3215
- getById: (_id: string | ObjectId) => Promise<TProvince>;
3216
- updateFieldById: ({ _id, field, value }?: {
3217
- _id: string | ObjectId;
3218
- field: string;
3219
- value: string;
3220
- }, session?: ClientSession) => Promise<string>;
3221
- deleteById: (_id: string | ObjectId) => Promise<string>;
3222
- getByName: (name: string) => Promise<TProvince>;
3223
- };
3224
-
3225
- declare function useProvinceService(): {
3226
- add: (value: TProvince) => Promise<string>;
3227
- };
3228
-
3229
- declare function useProvinceController(): {
3230
- createProvince: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3231
- getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3232
- getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3233
- getByName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3234
- updateField: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3235
- deleteProvince: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3236
- };
3237
-
3238
- type TCityMunicipality = {
3239
- _id?: ObjectId;
3240
- name?: string;
3241
- status?: string;
3242
- createdAt?: string;
3243
- updatedAt?: string;
3244
- deletedAt?: string;
3245
- };
3246
- declare const schemaCityMunicipality: Joi.ObjectSchema<any>;
3247
- declare function MCityMunicipality(value: TCityMunicipality): TCityMunicipality;
3248
-
3249
- declare function useCityMunicipalityRepo(): {
3250
- createIndex: () => Promise<void>;
3251
- createTextIndex: () => Promise<void>;
3252
- createUniqueIndex: () => Promise<void>;
3253
- add: (value: TCityMunicipality, session?: ClientSession) => Promise<ObjectId>;
3254
- getAll: ({ search, page, limit, sort }?: {
3255
- search?: string | undefined;
3256
- page?: number | undefined;
3257
- limit?: number | undefined;
3258
- sort?: {} | undefined;
3259
- }) => Promise<Record<string, any>>;
3260
- getById: (_id: string | ObjectId) => Promise<TCityMunicipality>;
3261
- updateFieldById: ({ _id, field, value }?: {
3262
- _id: string | ObjectId;
3263
- field: string;
3264
- value: string;
3265
- }, session?: ClientSession) => Promise<string>;
3266
- deleteById: (_id: string | ObjectId) => Promise<string>;
3267
- getByName: (name: string) => Promise<TCityMunicipality>;
3268
- };
3269
-
3270
- declare function useCityMunicipalityService(): {
3271
- add: (value: TCityMunicipality) => Promise<string>;
3272
- };
3273
-
3274
- declare function useCityMunicipalityController(): {
3275
- createCityMunicipality: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3276
- getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3277
- getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3278
- getByName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3279
- updateField: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3280
- deleteCityMunicipality: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3281
- };
3282
-
3283
- type TBarangay = {
3284
- _id?: ObjectId;
3285
- name?: string;
3286
- status?: string;
3287
- createdAt?: string;
3288
- updatedAt?: string;
3289
- deletedAt?: string;
3290
- };
3291
- declare const schemaBarangay: Joi.ObjectSchema<any>;
3292
- declare function MBarangay(value: TBarangay): TBarangay;
3293
-
3294
- declare function useBarangayRepo(): {
3295
- createIndex: () => Promise<void>;
3296
- createTextIndex: () => Promise<void>;
3297
- createUniqueIndex: () => Promise<void>;
3298
- add: (value: TBarangay, session?: ClientSession) => Promise<ObjectId>;
3299
- getAll: ({ search, page, limit, sort }?: {
3300
- search?: string | undefined;
3301
- page?: number | undefined;
3302
- limit?: number | undefined;
3303
- sort?: {} | undefined;
3304
- }) => Promise<Record<string, any>>;
3305
- getById: (_id: string | ObjectId) => Promise<TBarangay>;
3306
- updateFieldById: ({ _id, field, value }?: {
3307
- _id: string | ObjectId;
3308
- field: string;
3309
- value: string;
3310
- }, session?: ClientSession) => Promise<string>;
3311
- deleteById: (_id: string | ObjectId) => Promise<string>;
3312
- getByName: (name: string) => Promise<TBarangay>;
3313
- };
3314
-
3315
- declare function useBarangayService(): {
3316
- add: (value: TBarangay) => Promise<string>;
3317
- };
3318
-
3319
- declare function useBarangayController(): {
3320
- createBarangay: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3321
- getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3322
- getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3323
- getByName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3324
- updateField: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3325
- deleteBarangay: (req: Request, res: Response, next: NextFunction) => Promise<void>;
3326
- };
3327
-
3328
3257
  declare const MONGO_URI: string;
3329
3258
  declare const MONGO_DB: string;
3330
3259
  declare const PORT: number;
@@ -3362,5 +3291,6 @@ declare const XENDIT_SECRET_KEY: string;
3362
3291
  declare const XENDIT_BASE_URL: string;
3363
3292
  declare const GEMINI_API_KEY: string;
3364
3293
  declare const ASSEMBLY_AI_API_KEY: string;
3294
+ declare const DOMAIN: string;
3365
3295
 
3366
- 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, 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, 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, TPayment, TPaymentMethod$1 as TPaymentMethod, TPaymentMethodType, TPlantilla, TPrice, TPriceType, TPromoCode, TPromoTier, TProvince, TRegion, TRole, TSchool, TStockCard, TSubscription, TToken, TUser, TUserRole, TVerification, TVerificationMetadata, VERIFICATION_FORGET_PASSWORD_DURATION, VERIFICATION_USER_INVITE_DURATION, XENDIT_BASE_URL, XENDIT_SECRET_KEY, addressSchema, isDev, schema, schemaAsset, schemaAssetUpdateOption, schemaBarangay, schemaBuilding, schemaBuildingUnit, schemaCityMunicipality, schemaCurriculum, schemaDivision, schemaEnrollment, schemaGradeLevel, schemaOffice, schemaPlantilla, schemaProvince, schemaRegion, schemaSchool, schemaStockCard, schemaUpdateOptions, useAddressController, useAddressRepo, useAssetController, useAssetRepo, useAudioTranscriptionController, useAuthController, useAuthService, useBarangayController, useBarangayRepo, useBarangayService, useBuildingController, useBuildingRepo, useBuildingUnitController, useBuildingUnitRepo, useCityMunicipalityController, useCityMunicipalityRepo, useCityMunicipalityService, useCounterModel, useCounterRepo, useCurriculumController, useCurriculumRepo, useDivisionController, useDivisionRepo, useDivisionService, useEnrollmentController, useEnrollmentRepo, useEnrollmentService, useEntityController, useEntityRepo, useFileController, useFileRepo, useFileService, useGeminiAiService, useGitHubService, useGradeLevelController, useGradeLevelRepo, useInvoiceController, useInvoiceModel, useInvoiceRepo, useInvoiceService, useMemberController, useMemberRepo, useOfficeController, useOfficeRepo, useOfficeService, useOrderController, useOrderRepo, useOrgController, useOrgRepo, useOrgService, usePaymentController, usePaymentMethodController, usePaymentMethodRepo, usePaymentMethodService, usePaymentModel, usePaymentRepo, usePaypalService, usePlantillaController, usePlantillaRepo, usePriceController, usePriceModel, usePriceRepo, usePromoCodeController, usePromoCodeRepo, useProvinceController, useProvinceRepo, useProvinceService, useRegionController, useRegionRepo, useRegionService, useRoleController, useRoleRepo, useSchoolController, useSchoolRepo, useSchoolService, useStockCardController, useStockCardRepository, useSubscriptionController, useSubscriptionRepo, useSubscriptionService, useTokenRepo, useUserController, useUserRepo, useUserService, useUtilController, useVerificationController, useVerificationRepo, useVerificationService, useXenditService, validateCardPayment, validateDirectDebit, validateEWalletPayment };
3296
+ 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, 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, 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, modelSector, schema, schemaAsset, schemaAssetUpdateOption, schemaBarangay, schemaBuilding, schemaBuildingUnit, schemaCityMunicipality, schemaCurriculum, schemaDivision, schemaEnrollment, schemaGradeLevel, schemaOffice, schemaOrg, 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, 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 };