@lyxa.ai/core 1.0.62 → 1.0.64

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.js CHANGED
@@ -22,6 +22,7 @@ const firebase_1 = require("./libraries/firebase");
22
22
  const event_1 = require("./libraries/event");
23
23
  const SubscriptionRegistry_1 = require("./libraries/event/registry/SubscriptionRegistry");
24
24
  const map_1 = require("./libraries/map");
25
+ const settings_1 = require("./libraries/cache/settings");
25
26
  var EnvironmentConfigurationType_2 = require("./libraries/configuration/types/EnvironmentConfigurationType");
26
27
  Object.defineProperty(exports, "EnvironmentConfigurationType", { enumerable: true, get: function () { return EnvironmentConfigurationType_2.EnvironmentConfigurationType; } });
27
28
  var mongo_2 = require("./libraries/mongo");
@@ -74,6 +75,8 @@ async function registerLibraries(options) {
74
75
  const googleMapService = new map_1.GoogleMapsService(googleMapsKey);
75
76
  const mapServiceInstance = new map_1.MapService(googleMapService);
76
77
  typedi_1.Container.set(map_1.MapService, mapServiceInstance);
78
+ const settingsServiceInstance = new settings_1.CachedSettingsService(redisInstance);
79
+ typedi_1.Container.set(settings_1.CachedSettingsService, settingsServiceInstance);
77
80
  console.log('Initialized everything');
78
81
  await (0, event_1.initEventBus)('amqps://vgyuplrd:wto6vUYnb4zeBI5lntKT4gj7rT8n1vwg@dog.lmq.cloudamqp.com/vgyuplrd');
79
82
  const allSubscriptions = SubscriptionRegistry_1.SubscriptionRegistry.getAllSubscriptions();
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":";;;;;;AAoBA,sCAyBC;AAED,8CA+DC;AAED,oCAEC;AAlHD,2CAA6C;AAC7C,mCAAmC;AACnC,wDAAgC;AAChC,6DAAuF;AACvF,+GAA4G;AAC5G,+CAAgD;AAChD,6CAAiD;AACjD,6CAAyD;AACzD,iDAA2D;AAC3D,uDAAgE;AAChE,+CAAmD;AACnD,mDA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,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;IACJ,CAAC;AACF,CAAC;AAED,SAAgB,YAAY;IAC3B,OAAO,kBAAS,CAAC,GAAG,CAAC,0BAAc,CAAC,CAAC;AACtC,CAAC","sourcesContent":["import { LibraryManager } from './libraries';\nimport { Container } from 'typedi';\nimport mongoose from 'mongoose';\nimport { ConfigurationOptions, ConfigurationService } from './libraries/configuration';\nimport { EnvironmentConfigurationType } from './libraries/configuration/types/EnvironmentConfigurationType';\nimport { LyxaLogger } from './libraries/logger';\nimport { RedisService } from './libraries/redis';\nimport { initGlobalConnection } from './libraries/mongo';\nimport { SecretManagerService } from './libraries/secrets';\nimport { MicroServiceDispatcher } from './libraries/dispatcher';\nimport { TwilioService } from './libraries/twilio';\nimport { FirebaseService } from './libraries/firebase';\nimport { initEventBus, subscribeToEvent } from './libraries/event';\nimport { SubscriptionRegistry } from './libraries/event/registry/SubscriptionRegistry';\nimport { MapService, GoogleMapsService } from './libraries/map';\n\nexport { ConfigurationOptions } from './libraries/configuration';\nexport { EnvironmentConfigurationType } from './libraries/configuration/types/EnvironmentConfigurationType';\nexport { initGlobalConnection, createGlobalModel, createGlobalDiscriminatorModel } from './libraries/mongo';\n\nexport async function bootstrapCore(options?: ConfigurationOptions) {\n\ttry {\n\t\tawait registerLibraries(options);\n\n\t\tgetLibraries().getLogger().logger.info('Successfully bootstrapped lyxa-core.');\n\n\t\tconst gracefulShutdown = async () => {\n\t\t\tgetLibraries().getLogger().logger.info('Received shutdown signal, shutting down gracefully...');\n\t\t\tprocess.exit();\n\t\t};\n\n\t\tprocess.on('SIGTERM', gracefulShutdown);\n\t\tprocess.on('SIGINT', gracefulShutdown);\n\t\tprocess.on('uncaughtException', err => {\n\t\t\tgetLibraries().getLogger().logger.error('Uncaught exception, shutting down...', err);\n\t\t\tgracefulShutdown();\n\t\t});\n\t\tprocess.on('exit', code => {\n\t\t\tgetLibraries().getLogger().logger.info(`Exiting with code: ${code}`);\n\t\t});\n\n\t\tconsole.log('Created hooks.');\n\t} catch (e) {\n\t\tconsole.error(e);\n\t}\n}\n\nexport async function registerLibraries(options?: ConfigurationOptions) {\n\t// Setup configuration.\n\tconst configurationInstance = new ConfigurationService(options);\n\tContainer.set(ConfigurationService, configurationInstance);\n\n\t// Setup redis.\n\tconst redisInstance = new RedisService(configurationInstance.options.redisURL!);\n\tContainer.set(RedisService, redisInstance);\n\n\t// Setup secret\n\tconst secretInstance = new SecretManagerService(configurationInstance, redisInstance);\n\tContainer.set(SecretManagerService, secretInstance);\n\n\tconst mongoUrl = await getLibraries().getSecretsService().getKey('MONGO_URL');\n\n\tawait mongoose.connect(mongoUrl!, { dbName: `lyxa-${options!.environment}-${options!.tenet}` });\n\tmongoose.set(\n\t\t'debug',\n\t\tgetLibraries().getConfigurationService().options.environment == EnvironmentConfigurationType.DEV\n\t);\n\n\tawait initGlobalConnection(mongoUrl!, options!.environment);\n\n\t// Setup logger\n\tconst loggerInstance = new LyxaLogger(options!.instanceType!, mongoUrl!);\n\tContainer.set(LyxaLogger, loggerInstance);\n\n\t// Setup firebase\n\tconst firebaseInstance = new FirebaseService(configurationInstance!);\n\tContainer.set(FirebaseService, firebaseInstance);\n\n\t// Setup microservice dispatcher\n\tconst microserviceDispatcherInstance = new MicroServiceDispatcher(secretInstance);\n\tContainer.set(MicroServiceDispatcher, microserviceDispatcherInstance);\n\n\t// Setup twilio\n\tconst twilioServiceInstance = new TwilioService();\n\tContainer.set(TwilioService, twilioServiceInstance);\n\n\t// Setup map service\n\tconst googleMapsKey = await getLibraries().getSecretsService().getKey('GOOGLE_MAPS_API_KEY');\n\tconst googleMapService = new GoogleMapsService(googleMapsKey as string);\n\tconst mapServiceInstance = new MapService(googleMapService);\n\tContainer.set(MapService, mapServiceInstance);\n\n\tconsole.log('Initialized everything');\n\n\tawait initEventBus('amqps://vgyuplrd:wto6vUYnb4zeBI5lntKT4gj7rT8n1vwg@dog.lmq.cloudamqp.com/vgyuplrd');\n\tconst allSubscriptions = SubscriptionRegistry.getAllSubscriptions();\n\n\tconst instantiatedServices = new Map<Function, any>();\n\n\tfor (const { eventId, targetConstructor, methodName } of allSubscriptions) {\n\t\tlet instance = instantiatedServices.get(targetConstructor);\n\t\tif (!instance) {\n\t\t\tinstance = Container.get(targetConstructor as any);\n\t\t\tinstantiatedServices.set(targetConstructor, instance);\n\t\t}\n\n\t\tawait subscribeToEvent(eventId, async payload => {\n\t\t\treturn instance[methodName](payload);\n\t\t});\n\t}\n}\n\nexport function getLibraries(): LibraryManager {\n\treturn Container.get(LibraryManager);\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":";;;;;;AAqBA,sCAyBC;AAED,8CAkEC;AAED,oCAEC;AAtHD,2CAA6C;AAC7C,mCAAmC;AACnC,wDAAgC;AAChC,6DAAuF;AACvF,+GAA4G;AAC5G,+CAAgD;AAChD,6CAAiD;AACjD,6CAAyD;AACzD,iDAA2D;AAC3D,uDAAgE;AAChE,+CAAmD;AACnD,mDAAuD;AACvD,6CAAmE;AACnE,0FAAuF;AACvF,yCAAgE;AAChE,yDAAmE;AAGnE,6GAA4G;AAAnG,4IAAA,4BAA4B,OAAA;AACrC,2CAA4G;AAAnG,6GAAA,oBAAoB,OAAA;AAAE,0GAAA,iBAAiB,OAAA;AAAE,uHAAA,8BAA8B,OAAA;AAEzE,KAAK,UAAU,aAAa,CAAC,OAA8B;IACjE,IAAI,CAAC;QACJ,MAAM,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAEjC,YAAY,EAAE,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;QAE/E,MAAM,gBAAgB,GAAG,KAAK,IAAI,EAAE;YACnC,YAAY,EAAE,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,uDAAuD,CAAC,CAAC;YAChG,OAAO,CAAC,IAAI,EAAE,CAAC;QAChB,CAAC,CAAC;QAEF,OAAO,CAAC,E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B,CAAC,aAAa,CAAC,CAAC;IACzE,kBAAS,CAAC,GAAG,CAAC,gCAAqB,EAAE,uBAAuB,CAAC,CAAC;IAE9D,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IAEtC,MAAM,IAAA,oBAAY,EAAC,kFAAkF,CAAC,CAAC;IACvG,MAAM,gBAAgB,GAAG,2CAAoB,CAAC,mBAAmB,EAAE,CAAC;IAEpE,MAAM,oBAAoB,GAAG,IAAI,GAAG,EAAiB,CAAC;IAEtD,KAAK,MAAM,EAAE,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,IAAI,gBAAgB,EAAE,CAAC;QAC3E,IAAI,QAAQ,GAAG,oBAAoB,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC3D,IAAI,CAAC,QAAQ,EAAE,CAAC;YACf,QAAQ,GAAG,kBAAS,CAAC,GAAG,CAAC,iBAAwB,CAAC,CAAC;YACnD,oBAAoB,CAAC,GAAG,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC;QACvD,CAAC;QAED,MAAM,IAAA,wBAAgB,EAAC,OAAO,EAAE,KAAK,EAAC,OAAO,EAAC,EAAE;YAC/C,OAAO,QAAQ,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;IACJ,CAAC;AACF,CAAC;AAED,SAAgB,YAAY;IAC3B,OAAO,kBAAS,CAAC,GAAG,CAAC,0BAAc,CAAC,CAAC;AACtC,CAAC","sourcesContent":["import { LibraryManager } from './libraries';\nimport { Container } from 'typedi';\nimport mongoose from 'mongoose';\nimport { ConfigurationOptions, ConfigurationService } from './libraries/configuration';\nimport { EnvironmentConfigurationType } from './libraries/configuration/types/EnvironmentConfigurationType';\nimport { LyxaLogger } from './libraries/logger';\nimport { RedisService } from './libraries/redis';\nimport { initGlobalConnection } from './libraries/mongo';\nimport { SecretManagerService } from './libraries/secrets';\nimport { MicroServiceDispatcher } from './libraries/dispatcher';\nimport { TwilioService } from './libraries/twilio';\nimport { FirebaseService } from './libraries/firebase';\nimport { initEventBus, subscribeToEvent } from './libraries/event';\nimport { SubscriptionRegistry } from './libraries/event/registry/SubscriptionRegistry';\nimport { MapService, GoogleMapsService } from './libraries/map';\nimport { CachedSettingsService } from './libraries/cache/settings';\n\nexport { ConfigurationOptions } from './libraries/configuration';\nexport { EnvironmentConfigurationType } from './libraries/configuration/types/EnvironmentConfigurationType';\nexport { initGlobalConnection, createGlobalModel, createGlobalDiscriminatorModel } from './libraries/mongo';\n\nexport async function bootstrapCore(options?: ConfigurationOptions) {\n\ttry {\n\t\tawait registerLibraries(options);\n\n\t\tgetLibraries().getLogger().logger.info('Successfully bootstrapped lyxa-core.');\n\n\t\tconst gracefulShutdown = async () => {\n\t\t\tgetLibraries().getLogger().logger.info('Received shutdown signal, shutting down gracefully...');\n\t\t\tprocess.exit();\n\t\t};\n\n\t\tprocess.on('SIGTERM', gracefulShutdown);\n\t\tprocess.on('SIGINT', gracefulShutdown);\n\t\tprocess.on('uncaughtException', err => {\n\t\t\tgetLibraries().getLogger().logger.error('Uncaught exception, shutting down...', err);\n\t\t\tgracefulShutdown();\n\t\t});\n\t\tprocess.on('exit', code => {\n\t\t\tgetLibraries().getLogger().logger.info(`Exiting with code: ${code}`);\n\t\t});\n\n\t\tconsole.log('Created hooks.');\n\t} catch (e) {\n\t\tconsole.error(e);\n\t}\n}\n\nexport async function registerLibraries(options?: ConfigurationOptions) {\n\t// Setup configuration.\n\tconst configurationInstance = new ConfigurationService(options);\n\tContainer.set(ConfigurationService, configurationInstance);\n\n\t// Setup redis.\n\tconst redisInstance = new RedisService(configurationInstance.options.redisURL!);\n\tContainer.set(RedisService, redisInstance);\n\n\t// Setup secret\n\tconst secretInstance = new SecretManagerService(configurationInstance, redisInstance);\n\tContainer.set(SecretManagerService, secretInstance);\n\n\tconst mongoUrl = await getLibraries().getSecretsService().getKey('MONGO_URL');\n\n\tawait mongoose.connect(mongoUrl!, { dbName: `lyxa-${options!.environment}-${options!.tenet}` });\n\tmongoose.set(\n\t\t'debug',\n\t\tgetLibraries().getConfigurationService().options.environment == EnvironmentConfigurationType.DEV\n\t);\n\n\tawait initGlobalConnection(mongoUrl!, options!.environment);\n\n\t// Setup logger\n\tconst loggerInstance = new LyxaLogger(options!.instanceType!, mongoUrl!);\n\tContainer.set(LyxaLogger, loggerInstance);\n\n\t// Setup firebase\n\tconst firebaseInstance = new FirebaseService(configurationInstance!);\n\tContainer.set(FirebaseService, firebaseInstance);\n\n\t// Setup microservice dispatcher\n\tconst microserviceDispatcherInstance = new MicroServiceDispatcher(secretInstance);\n\tContainer.set(MicroServiceDispatcher, microserviceDispatcherInstance);\n\n\t// Setup twilio\n\tconst twilioServiceInstance = new TwilioService();\n\tContainer.set(TwilioService, twilioServiceInstance);\n\n\t// Setup map service\n\tconst googleMapsKey = await getLibraries().getSecretsService().getKey('GOOGLE_MAPS_API_KEY');\n\tconst googleMapService = new GoogleMapsService(googleMapsKey as string);\n\tconst mapServiceInstance = new MapService(googleMapService);\n\tContainer.set(MapService, mapServiceInstance);\n\n\tconst settingsServiceInstance = new CachedSettingsService(redisInstance);\n\tContainer.set(CachedSettingsService, settingsServiceInstance);\n\n\tconsole.log('Initialized everything');\n\n\tawait initEventBus('amqps://vgyuplrd:wto6vUYnb4zeBI5lntKT4gj7rT8n1vwg@dog.lmq.cloudamqp.com/vgyuplrd');\n\tconst allSubscriptions = SubscriptionRegistry.getAllSubscriptions();\n\n\tconst instantiatedServices = new Map<Function, any>();\n\n\tfor (const { eventId, targetConstructor, methodName } of allSubscriptions) {\n\t\tlet instance = instantiatedServices.get(targetConstructor);\n\t\tif (!instance) {\n\t\t\tinstance = Container.get(targetConstructor as any);\n\t\t\tinstantiatedServices.set(targetConstructor, instance);\n\t\t}\n\n\t\tawait subscribeToEvent(eventId, async payload => {\n\t\t\treturn instance[methodName](payload);\n\t\t});\n\t}\n}\n\nexport function getLibraries(): LibraryManager {\n\treturn Container.get(LibraryManager);\n}\n"]}
@@ -0,0 +1,8 @@
1
+ import { RedisService } from '../../redis';
2
+ export declare class CachedSettingsService {
3
+ private redisService;
4
+ constructor(redisService: RedisService);
5
+ getSettings(): Promise<any>;
6
+ updateSettings(): Promise<string>;
7
+ }
8
+ export declare const cachedSettingsService: CachedSettingsService;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.cachedSettingsService = exports.CachedSettingsService = void 0;
16
+ const typedi_1 = require("typedi");
17
+ const redis_1 = require("../../redis");
18
+ const models_1 = require("../../mongo/models");
19
+ const getSettingsKey = () => {
20
+ const tenant = process.env.tenant || 'lb';
21
+ const environment = process.env.environment || 'dev';
22
+ return `settings:${tenant}:${environment}`;
23
+ };
24
+ let CachedSettingsService = class CachedSettingsService {
25
+ redisService;
26
+ constructor(redisService) {
27
+ this.redisService = redisService;
28
+ }
29
+ async getSettings() {
30
+ const key = getSettingsKey();
31
+ const cached = await this.redisService.getCachedObject(key);
32
+ if (cached)
33
+ return cached;
34
+ const settings = await models_1.SettingModel.findOne({}).lean().exec();
35
+ if (!settings) {
36
+ throw new Error('Settings not found');
37
+ }
38
+ await this.redisService.cacheObject(key, settings);
39
+ return settings;
40
+ }
41
+ async updateSettings() {
42
+ const key = getSettingsKey();
43
+ await this.redisService.deleteCachedObject(key);
44
+ return 'Settings cache cleared successfully';
45
+ }
46
+ };
47
+ exports.CachedSettingsService = CachedSettingsService;
48
+ exports.CachedSettingsService = CachedSettingsService = __decorate([
49
+ (0, typedi_1.Service)(),
50
+ __param(0, (0, typedi_1.Inject)(() => redis_1.RedisService)),
51
+ __metadata("design:paramtypes", [redis_1.RedisService])
52
+ ], CachedSettingsService);
53
+ exports.cachedSettingsService = typedi_1.Container.get(CachedSettingsService);
54
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/cache/settings/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mCAAoD;AACpD,uCAA2C;AAC3C,+CAAkD;AAElD,MAAM,cAAc,GAAG,GAAW,EAAE;IACnC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,IAAI,IAAI,CAAC;IAC1C,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,KAAK,CAAC;IACrD,OAAO,YAAY,MAAM,IAAI,WAAW,EAAE,CAAC;AAC5C,CAAC,CAAC;AAGK,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IACe;IAAhD,YAAgD,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;IAAG,CAAC;IAK9E,KAAK,CAAC,WAAW;QAChB,MAAM,GAAG,GAAG,cAAc,EAAE,CAAC;QAG7B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,eAAe,CAAM,GAAG,CAAC,CAAC;QACjE,IAAI,MAAM;YAAE,OAAO,MAAM,CAAC;QAG1B,MAAM,QAAQ,GAAG,MAAM,qBAAY,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC;QAE9D,IAAI,CAAC,QAAQ,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;QACvC,CAAC;QAGD,MAAM,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QAEnD,OAAO,QAAQ,CAAC;IACjB,CAAC;IAKD,KAAK,CAAC,cAAc;QACnB,MAAM,GAAG,GAAG,cAAc,EAAE,CAAC;QAC7B,MAAM,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;QAChD,OAAO,qCAAqC,CAAC;IAC9C,CAAC;CACD,CAAA;AAlCY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,gBAAO,GAAE;IAEI,WAAA,IAAA,eAAM,EAAC,GAAG,EAAE,CAAC,oBAAY,CAAC,CAAA;qCAAuB,oBAAY;GAD9D,qBAAqB,CAkCjC;AAGY,QAAA,qBAAqB,GAAG,kBAAS,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC","sourcesContent":["import { Service, Inject, Container } from 'typedi';\nimport { RedisService } from '../../redis'; // Adjust the path to your RedisService\nimport { SettingModel } from '../../mongo/models'; // Adjust this import to your Setting model\n\nconst getSettingsKey = (): string => {\n\tconst tenant = process.env.tenant || 'lb';\n\tconst environment = process.env.environment || 'dev';\n\treturn `settings:${tenant}:${environment}`;\n};\n\n@Service()\nexport class CachedSettingsService {\n\tconstructor(@Inject(() => RedisService) private redisService: RedisService) {}\n\n\t/**\n\t * Get settings from Redis cache or fallback to DB if not found.\n\t */\n\tasync getSettings(): Promise<any> {\n\t\tconst key = getSettingsKey();\n\n\t\t// Try cache first\n\t\tconst cached = await this.redisService.getCachedObject<any>(key);\n\t\tif (cached) return cached;\n\n\t\t// Cache miss — fetch from DB\n\t\tconst settings = await SettingModel.findOne({}).lean().exec();\n\n\t\tif (!settings) {\n\t\t\tthrow new Error('Settings not found');\n\t\t}\n\n\t\t// Cache it\n\t\tawait this.redisService.cacheObject(key, settings);\n\n\t\treturn settings;\n\t}\n\n\t/**\n\t * Clear cached settings from Redis.\n\t */\n\tasync updateSettings(): Promise<string> {\n\t\tconst key = getSettingsKey();\n\t\tawait this.redisService.deleteCachedObject(key);\n\t\treturn 'Settings cache cleared successfully';\n\t}\n}\n\n// Export singleton instance for convenience\nexport const cachedSettingsService = Container.get(CachedSettingsService);\n"]}
@@ -0,0 +1,14 @@
1
+ import { ValueType } from '../../../../utilities/enum';
2
+ declare class DeliveryCharge {
3
+ from: number;
4
+ to: number;
5
+ charge: number;
6
+ riderCut: number;
7
+ }
8
+ export declare class ChargeSetting {
9
+ valueType?: ValueType;
10
+ value?: number;
11
+ deliveryCharges?: DeliveryCharge[];
12
+ deliveryChargesForCourier?: DeliveryCharge[];
13
+ }
14
+ export {};
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ChargeSetting = void 0;
13
+ const typegoose_1 = require("@typegoose/typegoose");
14
+ const enum_1 = require("../../../../utilities/enum");
15
+ class DeliveryCharge {
16
+ from;
17
+ to;
18
+ charge;
19
+ riderCut;
20
+ }
21
+ __decorate([
22
+ (0, typegoose_1.prop)({ required: true, type: Number, min: 0 }),
23
+ __metadata("design:type", Number)
24
+ ], DeliveryCharge.prototype, "from", void 0);
25
+ __decorate([
26
+ (0, typegoose_1.prop)({ required: true, type: Number, min: 0 }),
27
+ __metadata("design:type", Number)
28
+ ], DeliveryCharge.prototype, "to", void 0);
29
+ __decorate([
30
+ (0, typegoose_1.prop)({ required: true, type: Number, min: 0 }),
31
+ __metadata("design:type", Number)
32
+ ], DeliveryCharge.prototype, "charge", void 0);
33
+ __decorate([
34
+ (0, typegoose_1.prop)({ required: true, type: Number, min: 0 }),
35
+ __metadata("design:type", Number)
36
+ ], DeliveryCharge.prototype, "riderCut", void 0);
37
+ class ChargeSetting {
38
+ valueType;
39
+ value;
40
+ deliveryCharges;
41
+ deliveryChargesForCourier;
42
+ }
43
+ exports.ChargeSetting = ChargeSetting;
44
+ __decorate([
45
+ (0, typegoose_1.prop)({ type: String, enum: enum_1.ValueType, default: enum_1.ValueType.PERCENTAGE }),
46
+ __metadata("design:type", String)
47
+ ], ChargeSetting.prototype, "valueType", void 0);
48
+ __decorate([
49
+ (0, typegoose_1.prop)({ type: Number, min: 0 }),
50
+ __metadata("design:type", Number)
51
+ ], ChargeSetting.prototype, "value", void 0);
52
+ __decorate([
53
+ (0, typegoose_1.prop)({ type: () => [DeliveryCharge], default: [] }),
54
+ __metadata("design:type", Array)
55
+ ], ChargeSetting.prototype, "deliveryCharges", void 0);
56
+ __decorate([
57
+ (0, typegoose_1.prop)({ type: () => [DeliveryCharge], default: [] }),
58
+ __metadata("design:type", Array)
59
+ ], ChargeSetting.prototype, "deliveryChargesForCourier", void 0);
60
+ //# sourceMappingURL=charge-setting.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"charge-setting.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/charge-setting.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA4C;AAC5C,qDAAuD;AAEvD,MAAM,cAAc;IAEZ,IAAI,CAAU;IAGd,EAAE,CAAU;IAGZ,MAAM,CAAU;IAGhB,QAAQ,CAAU;CACzB;AAVO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;;4CAC1B;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;;0CAC5B;AAGZ;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;;8CACxB;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;;gDACtB;AAG1B,MAAa,aAAa;IAElB,SAAS,CAAa;IAGtB,KAAK,CAAU;IAGf,eAAe,CAAoB;IAGnC,yBAAyB,CAAoB;CACpD;AAZD,sCAYC;AAVO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAS,EAAE,OAAO,EAAE,gBAAS,CAAC,UAAU,EAAE,CAAC;;gDAC1C;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;;4CACT;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,cAAc,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;sDACV;AAGnC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,cAAc,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;gEACA","sourcesContent":["import { prop } from '@typegoose/typegoose';\nimport { ValueType } from '../../../../utilities/enum';\n\nclass DeliveryCharge {\n\t@prop({ required: true, type: Number, min: 0 })\n\tpublic from!: number;\n\n\t@prop({ required: true, type: Number, min: 0 })\n\tpublic to!: number;\n\n\t@prop({ required: true, type: Number, min: 0 })\n\tpublic charge!: number;\n\n\t@prop({ required: true, type: Number, min: 0 })\n\tpublic riderCut!: number;\n}\n\nexport class ChargeSetting {\n\t@prop({ type: String, enum: ValueType, default: ValueType.PERCENTAGE })\n\tpublic valueType?: ValueType;\n\n\t@prop({ type: Number, min: 0 })\n\tpublic value?: number;\n\n\t@prop({ type: () => [DeliveryCharge], default: [] })\n\tpublic deliveryCharges?: DeliveryCharge[];\n\n\t@prop({ type: () => [DeliveryCharge], default: [] })\n\tpublic deliveryChargesForCourier?: DeliveryCharge[];\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"discount-marketing.model.js","sourceRoot":"/","sources":["libraries/mongo/models/providers/discount-marketing.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,qDAAsE;AACtE,wDAA+C;AAC/C,wEAA8D;AAE9D,MAAa,iBAAkB,SAAQ,2BAAS;IACxC,aAAa,GAAG,oBAAa,CAAC,QAAiB,CAAC;IAGhD,YAAY,CAAW;IAGvB,SAAS,CAAa;IAGtB,KAAK,CAAU;IAOf,QAAQ,CAAwB;IAGhC,mBAAmB,CAAU;IAG7B,UAAU,CAAU;IAGpB,mBAAmB,CAAW;CACrC;AA3BD,8CA2BC;AAvBO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;uDACV;AAGvB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAS,EAAE,CAAC;;oDACX;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;gDACD;AAOf;IALN,IAAA,gBAAI,EAAC;QACL,GAAG,EAAE,GAAG,EAAE,CAAC,0CAAgB;QAC3B,YAAY,EAAE,WAAW;QACzB,UAAU,EAAE,KAAK;KACjB,CAAC;;mDACqC;AAGhC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;8DACC;AAG7B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;qDACR;AAGpB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;8DACH","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { MarketingType, ValueType } from '../../../../utilities/enum';\nimport { Marketing } from '../marketing.model';\nimport { ProductMarketing } from '../product-marketing.model';\n\nexport class DiscountMarketing extends Marketing {\n\tpublic marketingType = MarketingType.DISCOUNT as const;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isEntireMenu?: boolean;\n\n\t@prop({ type: String, enum: ValueType })\n\tpublic valueType?: ValueType;\n\n\t@prop({ type: Number })\n\tpublic value?: number;\n\n\t@prop({\n\t\tref: () => ProductMarketing,\n\t\tforeignField: 'marketing',\n\t\tlocalField: '_id',\n\t})\n\tpublic products: Ref<ProductMarketing>;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic maxDiscountPerOrder?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic spendLimit?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isOnlyForSubscriber?: boolean;\n}\n\n"]}
1
+ {"version":3,"file":"discount-marketing.model.js","sourceRoot":"/","sources":["libraries/mongo/models/providers/discount-marketing.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,qDAAsE;AACtE,wDAA+C;AAC/C,wEAA8D;AAE9D,MAAa,iBAAkB,SAAQ,2BAAS;IACxC,aAAa,GAAG,oBAAa,CAAC,QAAiB,CAAC;IAGhD,YAAY,CAAW;IAGvB,SAAS,CAAa;IAGtB,KAAK,CAAU;IAOf,QAAQ,CAAwB;IAGhC,mBAAmB,CAAU;IAG7B,UAAU,CAAU;IAGpB,mBAAmB,CAAW;CACrC;AA3BD,8CA2BC;AAvBO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;uDACV;AAGvB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAS,EAAE,CAAC;;oDACX;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;gDACD;AAOf;IALN,IAAA,gBAAI,EAAC;QACL,GAAG,EAAE,GAAG,EAAE,CAAC,0CAAgB;QAC3B,YAAY,EAAE,WAAW;QACzB,UAAU,EAAE,KAAK;KACjB,CAAC;;mDACqC;AAGhC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;8DACC;AAG7B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;qDACR;AAGpB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;8DACH","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { MarketingType, ValueType } from '../../../../utilities/enum';\nimport { Marketing } from '../marketing.model';\nimport { ProductMarketing } from '../product-marketing.model';\n\nexport class DiscountMarketing extends Marketing {\n\tpublic marketingType = MarketingType.DISCOUNT as const;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isEntireMenu?: boolean;\n\n\t@prop({ type: String, enum: ValueType })\n\tpublic valueType?: ValueType;\n\n\t@prop({ type: Number })\n\tpublic value?: number;\n\n\t@prop({\n\t\tref: () => ProductMarketing,\n\t\tforeignField: 'marketing',\n\t\tlocalField: '_id',\n\t})\n\tpublic products: Ref<ProductMarketing>;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic maxDiscountPerOrder?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic spendLimit?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isOnlyForSubscriber?: boolean;\n}\n"]}
@@ -0,0 +1,8 @@
1
+ import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
2
+ export declare class TermsAndConditions extends TimeStamps {
3
+ privacyMessage: string;
4
+ userTermsAndConditions: string;
5
+ shopTermsAndConditions: string;
6
+ riderTermsAndConditions: string;
7
+ lyxaPlusTermsAndConditions: string;
8
+ }
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.TermsAndConditions = void 0;
13
+ const typegoose_1 = require("@typegoose/typegoose");
14
+ const defaultClasses_1 = require("@typegoose/typegoose/lib/defaultClasses");
15
+ let TermsAndConditions = class TermsAndConditions extends defaultClasses_1.TimeStamps {
16
+ privacyMessage;
17
+ userTermsAndConditions;
18
+ shopTermsAndConditions;
19
+ riderTermsAndConditions;
20
+ lyxaPlusTermsAndConditions;
21
+ };
22
+ exports.TermsAndConditions = TermsAndConditions;
23
+ __decorate([
24
+ (0, typegoose_1.prop)({ default: '' }),
25
+ __metadata("design:type", String)
26
+ ], TermsAndConditions.prototype, "privacyMessage", void 0);
27
+ __decorate([
28
+ (0, typegoose_1.prop)({ default: '' }),
29
+ __metadata("design:type", String)
30
+ ], TermsAndConditions.prototype, "userTermsAndConditions", void 0);
31
+ __decorate([
32
+ (0, typegoose_1.prop)({ default: '' }),
33
+ __metadata("design:type", String)
34
+ ], TermsAndConditions.prototype, "shopTermsAndConditions", void 0);
35
+ __decorate([
36
+ (0, typegoose_1.prop)({ default: '' }),
37
+ __metadata("design:type", String)
38
+ ], TermsAndConditions.prototype, "riderTermsAndConditions", void 0);
39
+ __decorate([
40
+ (0, typegoose_1.prop)({ default: '' }),
41
+ __metadata("design:type", String)
42
+ ], TermsAndConditions.prototype, "lyxaPlusTermsAndConditions", void 0);
43
+ exports.TermsAndConditions = TermsAndConditions = __decorate([
44
+ (0, typegoose_1.modelOptions)({
45
+ schemaOptions: {
46
+ collection: 'terms-and-conditions',
47
+ timestamps: true,
48
+ },
49
+ })
50
+ ], TermsAndConditions);
51
+ //# sourceMappingURL=terms-condition.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terms-condition.model.js","sourceRoot":"/","sources":["libraries/mongo/models/terms-condition.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA0D;AAC1D,4EAAqE;AAQ9D,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,2BAAU;IAE1C,cAAc,CAAS;IAGvB,sBAAsB,CAAS;IAG/B,sBAAsB,CAAS;IAG/B,uBAAuB,CAAS;IAGhC,0BAA0B,CAAS;CAC1C,CAAA;AAfY,gDAAkB;AAEvB;IADN,IAAA,gBAAI,EAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;0DACQ;AAGvB;IADN,IAAA,gBAAI,EAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;kEACgB;AAG/B;IADN,IAAA,gBAAI,EAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;kEACgB;AAG/B;IADN,IAAA,gBAAI,EAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;mEACiB;AAGhC;IADN,IAAA,gBAAI,EAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;sEACoB;6BAd9B,kBAAkB;IAN9B,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE;YACd,UAAU,EAAE,sBAAsB;YAClC,UAAU,EAAE,IAAI;SAChB;KACD,CAAC;GACW,kBAAkB,CAe9B","sourcesContent":["import { modelOptions, prop } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\n\n@modelOptions({\n\tschemaOptions: {\n\t\tcollection: 'terms-and-conditions',\n\t\ttimestamps: true,\n\t},\n})\nexport class TermsAndConditions extends TimeStamps {\n\t@prop({ default: '' })\n\tpublic privacyMessage: string;\n\n\t@prop({ default: '' })\n\tpublic userTermsAndConditions: string;\n\n\t@prop({ default: '' })\n\tpublic shopTermsAndConditions: string;\n\n\t@prop({ default: '' })\n\tpublic riderTermsAndConditions: string;\n\n\t@prop({ default: '' })\n\tpublic lyxaPlusTermsAndConditions: string;\n}\n"]}
@@ -108,25 +108,25 @@ export declare enum UserAppSectionType {
108
108
  NEARBY_FLOWER = "nearby_flower",
109
109
  NEARBY_COFFEE = "nearby_coffee",
110
110
  OFFERS = "offers",
111
- OFFERS_food = "offers_food",
111
+ OFFERS_FOOD = "offers_food",
112
112
  OFFERS_GROCERY = "offers_grocery",
113
113
  OFFERS_PET = "offers_pet",
114
114
  OFFERS_FLOWER = "offers_flower",
115
115
  OFFERS_COFFEE = "offers_coffee",
116
116
  FREE_DELIVERY = "free_delivery",
117
- FREE_DELIVERY_food = "free_delivery_food",
117
+ FREE_DELIVERY_FOOD = "free_delivery_food",
118
118
  FREE_DELIVERY_GROCERY = "free_delivery_grocery",
119
119
  FREE_DELIVERY_PET = "free_delivery_pet",
120
120
  FREE_DELIVERY_FLOWER = "free_delivery_flower",
121
121
  FREE_DELIVERY_COFFEE = "free_delivery_coffee",
122
122
  ORDER_AGAIN = "order_again",
123
- ORDER_AGAIN_food = "order_again_food",
123
+ ORDER_AGAIN_FOOD = "order_again_food",
124
124
  ORDER_AGAIN_GROCERY = "order_again_grocery",
125
125
  ORDER_AGAIN_PET = "order_againy_pet",
126
126
  ORDER_AGAIN_FLOWER = "order_again_flower",
127
127
  ORDER_AGAIN_COFFEE = "order_again_coffee",
128
128
  TOP_PICKS = "top_picks",
129
- TOP_PICKS_food = "top_picks_food",
129
+ TOP_PICKS_FOOD = "top_picks_food",
130
130
  TOP_PICKS_GROCERY = "top_picks_grocery",
131
131
  TOP_PICKS_PET = "top_picks_pet",
132
132
  TOP_PICKS_FLOWER = "top_picks_flower",
@@ -128,25 +128,25 @@ var UserAppSectionType;
128
128
  UserAppSectionType["NEARBY_FLOWER"] = "nearby_flower";
129
129
  UserAppSectionType["NEARBY_COFFEE"] = "nearby_coffee";
130
130
  UserAppSectionType["OFFERS"] = "offers";
131
- UserAppSectionType["OFFERS_food"] = "offers_food";
131
+ UserAppSectionType["OFFERS_FOOD"] = "offers_food";
132
132
  UserAppSectionType["OFFERS_GROCERY"] = "offers_grocery";
133
133
  UserAppSectionType["OFFERS_PET"] = "offers_pet";
134
134
  UserAppSectionType["OFFERS_FLOWER"] = "offers_flower";
135
135
  UserAppSectionType["OFFERS_COFFEE"] = "offers_coffee";
136
136
  UserAppSectionType["FREE_DELIVERY"] = "free_delivery";
137
- UserAppSectionType["FREE_DELIVERY_food"] = "free_delivery_food";
137
+ UserAppSectionType["FREE_DELIVERY_FOOD"] = "free_delivery_food";
138
138
  UserAppSectionType["FREE_DELIVERY_GROCERY"] = "free_delivery_grocery";
139
139
  UserAppSectionType["FREE_DELIVERY_PET"] = "free_delivery_pet";
140
140
  UserAppSectionType["FREE_DELIVERY_FLOWER"] = "free_delivery_flower";
141
141
  UserAppSectionType["FREE_DELIVERY_COFFEE"] = "free_delivery_coffee";
142
142
  UserAppSectionType["ORDER_AGAIN"] = "order_again";
143
- UserAppSectionType["ORDER_AGAIN_food"] = "order_again_food";
143
+ UserAppSectionType["ORDER_AGAIN_FOOD"] = "order_again_food";
144
144
  UserAppSectionType["ORDER_AGAIN_GROCERY"] = "order_again_grocery";
145
145
  UserAppSectionType["ORDER_AGAIN_PET"] = "order_againy_pet";
146
146
  UserAppSectionType["ORDER_AGAIN_FLOWER"] = "order_again_flower";
147
147
  UserAppSectionType["ORDER_AGAIN_COFFEE"] = "order_again_coffee";
148
148
  UserAppSectionType["TOP_PICKS"] = "top_picks";
149
- UserAppSectionType["TOP_PICKS_food"] = "top_picks_food";
149
+ UserAppSectionType["TOP_PICKS_FOOD"] = "top_picks_food";
150
150
  UserAppSectionType["TOP_PICKS_GROCERY"] = "top_picks_grocery";
151
151
  UserAppSectionType["TOP_PICKS_PET"] = "top_picks_pet";
152
152
  UserAppSectionType["TOP_PICKS_FLOWER"] = "top_picks_flower";
@@ -1 +1 @@
1
- {"version":3,"file":"enum.js","sourceRoot":"/","sources":["utilities/enum.ts"],"names":[],"mappings":";;;;AAAA,IAAY,WAKX;AALD,WAAY,WAAW;IACtB,4BAAa,CAAA;IACb,4BAAa,CAAA;IACb,8BAAe,CAAA;IACf,kCAAmB,CAAA;AACpB,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB;AAED,IAAY,MAGX;AAHD,WAAY,MAAM;IACjB,2BAAiB,CAAA;IACjB,+BAAqB,CAAA;AACtB,CAAC,EAHW,MAAM,sBAAN,MAAM,QAGjB;AAED,IAAY,QAQX;AARD,WAAY,QAAQ;IACnB,yBAAa,CAAA;IACb,+BAAmB,CAAA;IACnB,iCAAqB,CAAA;IACrB,6BAAiB,CAAA;IACjB,6BAAiB,CAAA;IACjB,uBAAW,CAAA;IACX,6CAAiC,CAAA;AAClC,CAAC,EARW,QAAQ,wBAAR,QAAQ,QAQnB;AAED,IAAY,OAQX;AARD,WAAY,OAAO;IAClB,yCAAU,CAAA;IACV,yCAAU,CAAA;IACV,2CAAW,CAAA;IACX,+CAAa,CAAA;IACb,6CAAY,CAAA;IACZ,yCAAU,CAAA;IACV,6CAAY,CAAA;A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AAC,EAJW,uBAAuB,uCAAvB,uBAAuB,QAIlC;AAED,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAChC,wCAAe,CAAA;IACf,4CAAmB,CAAA;IACnB,sCAAa,CAAA;IACb,oCAAW,CAAA;AACZ,CAAC,EALW,qBAAqB,qCAArB,qBAAqB,QAKhC;AAED,IAAY,0BAMX;AAND,WAAY,0BAA0B;IACrC,2CAAa,CAAA;IACb,iDAAmB,CAAA;IACnB,2CAAa,CAAA;IACb,2DAA6B,CAAA;IAC7B,+EAAiD,CAAA;AAClD,CAAC,EANW,0BAA0B,0CAA1B,0BAA0B,QAMrC;AAED,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC/B,yCAAiB,CAAA;IACjB,6CAAqB,CAAA;IACrB,yCAAiB,CAAA;AAClB,CAAC,EAJW,oBAAoB,oCAApB,oBAAoB,QAI/B;AAED,IAAY,0BAIX;AAJD,WAAY,0BAA0B;IACrC,2CAAa,CAAA;IACb,2CAAa,CAAA;IACb,6CAAe,CAAA;AAChB,CAAC,EAJW,0BAA0B,0CAA1B,0BAA0B,QAIrC","sourcesContent":["export enum AccountType {\n\tUSER = 'user',\n\tSHOP = 'shop',\n\tRIDER = 'rider',\n\tCOMPANY = 'company',\n}\n\nexport enum Status {\n\tACTIVE = 'active',\n\tINACTIVE = 'inactive',\n}\n\nexport enum ItemType {\n\tFOOD = 'food',\n\tGROCERY = 'grocery',\n\tPHARMACY = 'pharmacy',\n\tCOFFEE = 'coffee',\n\tFLOWER = 'flower',\n\tPET = 'pet',\n\tHEALTHY_CORNER = 'healthy_corner',\n}\n\nexport enum WeekDay {\n\tSunday = 0,\n\tMonday = 1,\n\tTuesday = 2,\n\tWednesday = 3,\n\tThursday = 4,\n\tFriday = 5,\n\tSaturday = 6,\n}\n\nexport enum WorkStatus {\n\tOPEN = 'open',\n\tCLOSED = 'closed',\n\tFULL_DAY = 'full_day',\n}\n\nexport enum HolidayWorkStatus {\n\tCLOSED = WorkStatus.CLOSED,\n\tFULL_DAY = WorkStatus.FULL_DAY,\n}\n\nexport enum ValueType {\n\tPERCENTAGE = 'percentage',\n\tFIXED = 'fixed',\n}\n\nexport enum PaymentMethod {\n\tCASH = 'cash',\n\tONLINE = 'online',\n}\n\nexport enum PaymentStatus {\n\tPAID = 'paid',\n\tPENDING = 'pending',\n\tFAILED = 'failed',\n\tREFUNDED = 'refunded',\n\tPARTIALLY_REFUNDED = 'partially_refunded',\n}\n\nexport enum PaidCurrency {\n\tBASE = 'base',\n\tSECONDARY = 'secondary',\n\tMIXED = 'mixed',\n}\n\nexport enum SubscriptionPackage {\n\tMONTHLY = 'monthly',\n\tYEARLY = 'yearly',\n}\n\nexport enum SubscriptionStatus {\n\tONGOING = 'ongoing',\n\tEXPIRED = 'expired',\n}\n\nexport enum RatingAccountType {\n\tSHOP = 'shop',\n\tRIDER = 'rider',\n}\n\nexport enum GeoLocationType {\n\tPOINT = 'Point',\n}\n\nexport enum UpdatedField {\n\tMAX_TOTAL_EST_ITEMS_PRICE = 'max_total_est_items_price',\n\tMAX_DISTANCE = 'max_distance',\n\tDAILY_WORKING_HOURS = 'daily_working_hours',\n\tBOB_CASH_SETTLEMENT_LIMIT = 'bob_cash_settlement_limit',\n\tTIPS = 'tips',\n\tEQUIPMENTS = 'equipments',\n\tMONTHLY_SHOP_TARGET = 'monthly_shop_target',\n\tMONTHLY_REWARD_PRIZE = 'monthly_reward_prize',\n\tBASE_CURRENCY = 'base_currency',\n\tSECONDARY_CURRENCY = 'secondary_currency',\n\tIS_DUAL_CURRENCY_ENABLED = 'is_dual_currency_enabled',\n\tEXCHANGE_RATE = 'exchange_rate',\n\tISSUANCE_DAY = 'issuance_day',\n\tOVER_DUE_PERIODS = 'over_due_periods',\n\tPAY_LIMIT_FOR_USER = 'pay_limit_for_user',\n\tVAT_PERCENTAGE = 'vat_percentage',\n\tRIDER_SEARCH_RANGES = 'rider_search_ranges',\n\tNEAR_BY_SHOP_DISTANCE = 'near_by_shop_distance',\n\tNEAR_BY_SHOP_DISTANCE_IN_HOME_SCREEN = 'near_by_shop_distance_in_home_screen',\n\tUNITS = 'units',\n\tCURRENCY_SETTING = 'currency_setting',\n\tPAYMENT_METHODS = 'payment_methods',\n\tIS_GROUND_ORDER_ENABLED = 'is_ground_order_enabled',\n\tCUSTOMER_SUPPORT_PHONE_NUMBER = 'customer_support_phone_number',\n}\n\nexport enum UserAppSectionType {\n\tSHOW_ALL = 'show_all',\n\tSTORE_PUNCHES = 'store_punches',\n\tAUTHENTIC_BEIRUT = 'authentic_beirut',\n\tCRAZY_OFFER_SHOPS = 'crazy_offer_shops',\n\t\n\tNEAR_ME = 'near_me',\n\tNEARBY_FOOD = 'nearby_food',\n\tNEARBY_GROCERY = 'nearby_grocery',\n\tNEARBY_PET = 'nearby_pet',\n\tNEARBY_FLOWER = 'nearby_flower',\n\tNEARBY_COFFEE = 'nearby_coffee',\n\n\tOFFERS = 'offers',\n\tOFFERS_food = 'offers_food',\n\tOFFERS_GROCERY = 'offers_grocery',\n\tOFFERS_PET = 'offers_pet',\n\tOFFERS_FLOWER = 'offers_flower',\n\tOFFERS_COFFEE = 'offers_coffee',\n\n\tFREE_DELIVERY = 'free_delivery',\n\tFREE_DELIVERY_food = 'free_delivery_food',\n\tFREE_DELIVERY_GROCERY = 'free_delivery_grocery',\n\tFREE_DELIVERY_PET = 'free_delivery_pet',\n\tFREE_DELIVERY_FLOWER = 'free_delivery_flower',\n\tFREE_DELIVERY_COFFEE = 'free_delivery_coffee',\n\t\n\tORDER_AGAIN = 'order_again',\n\tORDER_AGAIN_food = 'order_again_food',\n\tORDER_AGAIN_GROCERY = 'order_again_grocery',\n\tORDER_AGAIN_PET = 'order_againy_pet',\n\tORDER_AGAIN_FLOWER = 'order_again_flower',\n\tORDER_AGAIN_COFFEE = 'order_again_coffee',\n\n\tTOP_PICKS = 'top_picks',\n\tTOP_PICKS_food = 'top_picks_food',\n\tTOP_PICKS_GROCERY = 'top_picks_grocery',\n\tTOP_PICKS_PET = 'top_picks_pet',\n\tTOP_PICKS_FLOWER = 'top_picks_flower',\n\tTOP_PICKS_COFFEE = 'top_picks_coffee',\n}\n\nexport enum UserAppSectionItemType {\n\tHOME = 'home',\n\tFOOD = 'food',\n\tGROCERY = 'grocery',\n\tCOFFEE = 'coffee',\n\tPET = 'pet',\n\tFLOWER = 'flower'\t\n}\n\nexport enum CoreAuthIdentityType {\n\tEMAIL = 'email',\n\tPHONE = 'phone',\n\tGOOGLE = 'google',\n\tAPPLE = 'apple',\n}\n\nexport enum ProductType {\n\tMEAT = 'meat',\n\tCHICKEN = 'chicken',\n\tFISH = 'fish',\n\tVEGETARIAN = 'vegetarian',\n\tOTHER = 'other',\n}\n\nexport enum PriceOption {\n\tSINGLE_PRICE = 'single_price',\n\tPRICE_PER_UNIT = 'price_per_unit',\n\tPRICE_PER_PORTION = 'price_per_portion',\n}\n\nexport enum AttributeItemSelectionType {\n\tSINGLE = 'single',\n\tMULTIPLE = 'multiple',\n}\n\nexport enum ProductDietaryType {\n\tGLUTEN_FREE = 'gluten_free',\n\tLOW_CAL = 'low_cal',\n\tVEGETARIAN = 'vegetarian',\n\tVEGAN = 'vegan',\n\tKETO = 'keto',\n\tLACTOSE_FREE = 'lactose_free',\n\tHIGH_PROTEIN = 'high_protein',\n}\n\nexport enum DishCategory {\n\tBREAKFAST = 'breakfast',\n\tLUNCH = 'lunch',\n\tDINNER = 'dinner',\n\tSNACKS = 'snacks',\n}\n\nexport enum NotificationAccountType {\n\tUSER = 'user',\n\tPARENT = 'parent',\n\tSHOP = 'shop',\n\tRIDER = 'rider',\n\tADMIN = 'admin',\n\tCUSTOMER_SERVICE = 'customer_service',\n}\n\nexport enum ClickType {\n\tCLICKABLE_URL = 'clickable_url',\n\tCLICKABLE_ORDER = 'clickable_order',\n\tCLICKABLE_SHOP = 'clickable_shop',\n\tCLICKABLE_PRODUCT = 'clickable_product',\n\tCLICKABLE_LIST_CONTAINER = 'clickable_list_container',\n\tCLICKABLE_PAYOUT = 'clickable_payout',\n\tCLICKABLE_BOB_FINANCE = 'clickable_bob_finance',\n\tCLICKABLE_REQUEST_AREA = 'clickable_request_area',\n}\n\nexport enum ChargeType {\n\tCUSTOM = 'custom',\n}\n\nexport enum ShopOnlineStatus {\n\tONLINE = 'online',\n\tOFFLINE = 'offline',\n\tBUSY = 'busy',\n}\n\nexport enum ShopRole {\n\tPARENT = 'parent',\n\tPARENT_MANAGER = 'parent_manager',\n\tPARENT_ORDER_MANAGER = 'parent_order_manager',\n\tSHOP = 'shop',\n\tSHOP_MANAGER = 'shop_manager',\n\tSHOP_ORDER_MANAGER = 'shop_order_manager',\n}\n\nexport enum BannerClickType {\n\tLINK = 'link',\n\tSHOP = 'shop',\n\tPRODUCT = 'product',\n\tLIST_CONTAINER = 'list_container',\n\tPLUS = 'plus',\n}\n\nexport enum BannerLinkType {\n\tURL = 'url',\n\tAPP_ROUTE = 'app-route',\n}\n\nexport enum BannerUserType {\n\tALL = 'all',\n\tPLUS = 'plus',\n\tNORMAL = 'normal',\n}\n\nexport enum CounterType {\n\tORDER = 'order',\n\tCRM_NUMBER = 'crm_number',\n\tshop = 'shop',\n}\n\nexport enum FaqAccountType {\n\tUSER = 'user',\n\tSHOP = 'shop',\n\tRIDER = 'rider',\n}\n\nexport enum ZoneStatus {\n\tACTIVE = 'active',\n\tINACTIVE = 'inactive',\n\tBUSY = 'busy',\n}\n\nexport enum BobAccountType {\n\tRIDER = 'rider',\n\tSHOP = 'shop',\n}\n\nexport enum BobSettlementType {\n\tSETTLE_CASH = 'settle_cash',\n\tSETTLE_PAYOUT = 'settle_Payout',\n}\n\nexport enum BobSettlementStatus {\n\tNOT_PAID = 'not_paid',\n\tPAID = 'paid',\n\tREVOKED = 'revoked',\n}\n\nexport enum BobModel {\n\tC2B = 'C2B',\n\tB2C = 'B2C',\n}\n\nexport enum BobType {\n\tINWARD = 'inward',\n\tOUTWARD = 'outward',\n}\n\nexport enum CouponType {\n\tGLOBAL = 'global',\n\tINDIVIDUAL_STORE = 'individual_store',\n\tINDIVIDUAL_USER = 'individual_user',\n\tCUSTOM_COUPON = 'custom_coupon',\n\tREFERRAL_CODE = 'referral_code',\n\tREFERRAL_REWARD = 'referral_reward',\n}\n\nexport enum CouponExpirationReason {\n\tDURATION = 'duration',\n\tSPEND_LIMIT = 'spendLimit',\n\tTOTAL_ORDER_LIMIT = 'totalOrderLimit',\n}\n\nexport enum FavouriteType {\n\tPRODUCT = 'product',\n\tSHOP = 'shop',\n}\n\nexport enum MarketingType {\n\tDISCOUNT = 'discount',\n\tBUY1GET1 = 'buy1get1',\n\tFREE_DELIVERY = 'free_delivery',\n\tFEATURED = 'featured',\n\tLOYALTY_POINT = 'loyalty_point',\n\tPUNCH_MARKETING = 'punch_marketing',\n}\n\nexport enum MarketingStatus {\n\tACTIVE = 'active',\n\tPAUSED = 'paused',\n\tEXPIRED = 'expired',\n\tDELETED = 'deleted',\n}\n\nexport enum AdminRole {\n\tSUPER_ADMIN = 'super_admin',\n\tGENERAL_MANAGER = 'general_manager',\n\tORDER_MANAGEMENT_MANAGER = 'order_management_lead',\n\tORDER_MANAGEMENT_AGENT = 'order_management_agent',\n\tACCOUNT_MANAGER = 'account_manager',\n\tBUSINESS_DEVELOPMENT_EXECUTIVE = 'business_development_executive',\n\tACCOUNTING = 'accounting',\n\tMARKETING_MANAGER = 'marketing_manager',\n}\n\nexport enum CartStatus {\n\tACTIVE = 'active',\n\tLOCKED = 'locked',\n\tSUBMITTED = 'submitted',\n}\n\nexport enum PaymentPreference {\n\tPAY_FOR_EVERYONE = 'pay_for_everyone',\n\tPAY_FOR_THEMSELVES = 'pay_for_themselves',\n}\n\nexport enum CardType {\n\tSTRIPE = 'stripe',\n\tAREEBA = 'areeba',\n}\n\nexport enum CardUserType {\n\tPARENT = 'parent',\n\tADMIN = 'admin',\n\tUSER = 'user',\n}\n\nexport enum AreebaCardStatus {\n\tPENDING = 'pending',\n\tACTIVE = 'active',\n}\n\nexport enum LiveStatus {\n\tONLINE = 'online',\n\tOFFLINE = 'offline',\n}\n\nexport enum CreatedBy {\n\tADMIN = 'admin',\n\tRIDER = 'rider',\n\tSHOP = 'shop',\n}\n\nexport enum ShiftType {\n\tDAY = 'day',\n\tNIGHT = 'night',\n}\n\nexport enum RiderType {\n\tSHOP_RIDER = 'shop_rider',\n\tLYXA_RIDER = 'lyxa_rider',\n}\n\nexport enum RiderBagSize {\n\tREGULAR = 'regular',\n\tLARGE = 'large',\n}\n\nexport enum Language {\n\tEN = 'en',\n\tAR = 'ar',\n}\n\nexport enum OrderType {\n\tREGULAR = 'regular',\n\tCOURIER = 'courier',\n}\n\nexport enum RegularOrderStatus {\n\tSCHEDULED = 'schedule',\n\tPLACED = 'placed',\n\tACCEPTED_BY_RIDER = 'accepted_by_rider',\n\tPREPARING = 'preparing',\n\tREADY_FOR_PICKUP = 'ready_to_pickup',\n\tON_THE_WAY = 'on_the_way',\n\tDELIVERED = 'delivered',\n\tCANCELLED = 'cancelled',\n}\n\nexport enum CourierOrderStatus {\n\tSCHEDULED = 'schedule',\n\tPLACED = 'placed',\n\tACCEPTED_BY_RIDER = 'accepted_by_rider',\n\tON_THE_WAY = 'on_the_way',\n\tDELIVERED = 'delivered',\n\tCANCELLED = 'cancelled',\n}\n\nexport enum DeliveryStatus {\n\tPENDING = 'pending',\n\tACCEPTED_BY_RIDER = 'accepted_by_rider',\n\tREADY_FOR_PICKUP = 'ready_to_pickup',\n\tON_THE_WAY = 'on_the_way',\n\tDELIVERED = 'delivered',\n\tCANCELLED = 'cancelled',\n}\n\nexport enum OrderFinanceStatus {\n\tPENDING = 'pending',\n\tDELIVERED = 'delivered',\n\tCANCELLED = 'cancelled',\n}\n\nexport enum OrderCancelBy {\n\tUSER = 'user',\n\tADMIN = 'admin',\n\tSHOP = 'shop',\n}\n\nexport enum CourierServiceType {\n\tDELIVERY_ONLY = 'delivery_only',\n\tPURCHASE_AND_DELIVER = 'purchase_and_deliver',\n}\n\nexport enum RiderAssignmentStatus {\n\tREQUESTED = 'requested',\n\tASSIGNED = 'assigned',\n\tREJECTED = 'rejected',\n\tCANCELED = 'canceled',\n\tUNASSIGNED = 'unassigned', // for unassigning rider from order by admin\n}\n\nexport enum ZoneGeometryType {\n\tPOLYGON = 'Polygon',\n}\n\nexport enum WorkingHourSettingsType {\n\tGLOBAL = 'Global',\n\tSHOP = 'Shop',\n}\n\nexport enum MediaType {\n\tIMAGE = 'image',\n}\n\nexport enum SettlementType {\n\tADD_CREDIT = 'add_credit',\n\tREMOVE_CREDIT = 'remove_credit',\n\tEXPIRED_LOYALTY_POINTS = 'expired_loyalty_points',\n\tRIDER_SETTLE_CASH = 'rider_settle_cash',\n\tSETTLE_VAT = 'settle_vat',\n\tSETTLE_FEATURED_AMOUNT = 'settle_featured_amount',\n\tSETTLE_SUBSCRIPTION_AMOUNT = 'settle_subscription_amount',\n\tSETTLE_PAYOUT = 'settle_payout',\n\tORDER_REFUND_BY_SHOP = 'order_refund_by_shop',\n\tORDER_REFUND_BY_COMPANY = 'order_refund_by_company',\n\tORDER_REFUND_TO_USER = 'order_refund_to_user',\n\tTOP_UP = 'top_up',\n}\n\nexport enum AddRemoveCreditSettlementType {\n\tADD_CREDIT = 'add_credit',\n\tREMOVE_CREDIT = 'remove_credit',\n}\n\nexport enum PlusSettingsPackageType {\n\tMONTHLY = 'monthly',\n\tYEARLY = 'yearly',\n\tWEEKLY = 'weekly',\n}\n\nexport enum SupportReasonTypeEnum {\n\tORDER = 'order',\n\tACCOUNT = 'account',\n\tSHOP = 'shop',\n\tFAQ = 'faq',\n}\n\nexport enum CancellationReasonTypeEnum {\n\tUSER = 'user',\n\tCOURIER = 'courier',\n\tSHOP = 'shop',\n\tRESOLVE_CHAT = 'resolve_chat',\n\tLYXA_PLUS_SUBSCRIPTION = 'lyxa_plus_subscription',\n}\n\nexport enum SettingsReasonStatus {\n\tACTIVE = 'active',\n\tINACTIVE = 'inactive',\n\tDELETE = 'delete',\n}\n\nexport enum AddRemoveCreditAccountType {\n\tUSER = 'user',\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,CAAA;IACrB,yCAAiB,CAAA;AAClB,CAAC,EAJW,oBAAoB,oCAApB,oBAAoB,QAI/B;AAED,IAAY,0BAIX;AAJD,WAAY,0BAA0B;IACrC,2CAAa,CAAA;IACb,2CAAa,CAAA;IACb,6CAAe,CAAA;AAChB,CAAC,EAJW,0BAA0B,0CAA1B,0BAA0B,QAIrC","sourcesContent":["export enum AccountType {\n\tUSER = 'user',\n\tSHOP = 'shop',\n\tRIDER = 'rider',\n\tCOMPANY = 'company',\n}\n\nexport enum Status {\n\tACTIVE = 'active',\n\tINACTIVE = 'inactive',\n}\n\nexport enum ItemType {\n\tFOOD = 'food',\n\tGROCERY = 'grocery',\n\tPHARMACY = 'pharmacy',\n\tCOFFEE = 'coffee',\n\tFLOWER = 'flower',\n\tPET = 'pet',\n\tHEALTHY_CORNER = 'healthy_corner',\n}\n\nexport enum WeekDay {\n\tSunday = 0,\n\tMonday = 1,\n\tTuesday = 2,\n\tWednesday = 3,\n\tThursday = 4,\n\tFriday = 5,\n\tSaturday = 6,\n}\n\nexport enum WorkStatus {\n\tOPEN = 'open',\n\tCLOSED = 'closed',\n\tFULL_DAY = 'full_day',\n}\n\nexport enum HolidayWorkStatus {\n\tCLOSED = WorkStatus.CLOSED,\n\tFULL_DAY = WorkStatus.FULL_DAY,\n}\n\nexport enum ValueType {\n\tPERCENTAGE = 'percentage',\n\tFIXED = 'fixed',\n}\n\nexport enum PaymentMethod {\n\tCASH = 'cash',\n\tONLINE = 'online',\n}\n\nexport enum PaymentStatus {\n\tPAID = 'paid',\n\tPENDING = 'pending',\n\tFAILED = 'failed',\n\tREFUNDED = 'refunded',\n\tPARTIALLY_REFUNDED = 'partially_refunded',\n}\n\nexport enum PaidCurrency {\n\tBASE = 'base',\n\tSECONDARY = 'secondary',\n\tMIXED = 'mixed',\n}\n\nexport enum SubscriptionPackage {\n\tMONTHLY = 'monthly',\n\tYEARLY = 'yearly',\n}\n\nexport enum SubscriptionStatus {\n\tONGOING = 'ongoing',\n\tEXPIRED = 'expired',\n}\n\nexport enum RatingAccountType {\n\tSHOP = 'shop',\n\tRIDER = 'rider',\n}\n\nexport enum GeoLocationType {\n\tPOINT = 'Point',\n}\n\nexport enum UpdatedField {\n\tMAX_TOTAL_EST_ITEMS_PRICE = 'max_total_est_items_price',\n\tMAX_DISTANCE = 'max_distance',\n\tDAILY_WORKING_HOURS = 'daily_working_hours',\n\tBOB_CASH_SETTLEMENT_LIMIT = 'bob_cash_settlement_limit',\n\tTIPS = 'tips',\n\tEQUIPMENTS = 'equipments',\n\tMONTHLY_SHOP_TARGET = 'monthly_shop_target',\n\tMONTHLY_REWARD_PRIZE = 'monthly_reward_prize',\n\tBASE_CURRENCY = 'base_currency',\n\tSECONDARY_CURRENCY = 'secondary_currency',\n\tIS_DUAL_CURRENCY_ENABLED = 'is_dual_currency_enabled',\n\tEXCHANGE_RATE = 'exchange_rate',\n\tISSUANCE_DAY = 'issuance_day',\n\tOVER_DUE_PERIODS = 'over_due_periods',\n\tPAY_LIMIT_FOR_USER = 'pay_limit_for_user',\n\tVAT_PERCENTAGE = 'vat_percentage',\n\tRIDER_SEARCH_RANGES = 'rider_search_ranges',\n\tNEAR_BY_SHOP_DISTANCE = 'near_by_shop_distance',\n\tNEAR_BY_SHOP_DISTANCE_IN_HOME_SCREEN = 'near_by_shop_distance_in_home_screen',\n\tUNITS = 'units',\n\tCURRENCY_SETTING = 'currency_setting',\n\tPAYMENT_METHODS = 'payment_methods',\n\tIS_GROUND_ORDER_ENABLED = 'is_ground_order_enabled',\n\tCUSTOMER_SUPPORT_PHONE_NUMBER = 'customer_support_phone_number',\n}\n\nexport enum UserAppSectionType {\n\tSHOW_ALL = 'show_all',\n\tSTORE_PUNCHES = 'store_punches',\n\tAUTHENTIC_BEIRUT = 'authentic_beirut',\n\tCRAZY_OFFER_SHOPS = 'crazy_offer_shops',\n\t\n\tNEAR_ME = 'near_me',\n\tNEARBY_FOOD = 'nearby_food',\n\tNEARBY_GROCERY = 'nearby_grocery',\n\tNEARBY_PET = 'nearby_pet',\n\tNEARBY_FLOWER = 'nearby_flower',\n\tNEARBY_COFFEE = 'nearby_coffee',\n\n\tOFFERS = 'offers',\n\tOFFERS_FOOD = 'offers_food',\n\tOFFERS_GROCERY = 'offers_grocery',\n\tOFFERS_PET = 'offers_pet',\n\tOFFERS_FLOWER = 'offers_flower',\n\tOFFERS_COFFEE = 'offers_coffee',\n\n\tFREE_DELIVERY = 'free_delivery',\n\tFREE_DELIVERY_FOOD = 'free_delivery_food',\n\tFREE_DELIVERY_GROCERY = 'free_delivery_grocery',\n\tFREE_DELIVERY_PET = 'free_delivery_pet',\n\tFREE_DELIVERY_FLOWER = 'free_delivery_flower',\n\tFREE_DELIVERY_COFFEE = 'free_delivery_coffee',\n\t\n\tORDER_AGAIN = 'order_again',\n\tORDER_AGAIN_FOOD = 'order_again_food',\n\tORDER_AGAIN_GROCERY = 'order_again_grocery',\n\tORDER_AGAIN_PET = 'order_againy_pet',\n\tORDER_AGAIN_FLOWER = 'order_again_flower',\n\tORDER_AGAIN_COFFEE = 'order_again_coffee',\n\n\tTOP_PICKS = 'top_picks',\n\tTOP_PICKS_FOOD = 'top_picks_food',\n\tTOP_PICKS_GROCERY = 'top_picks_grocery',\n\tTOP_PICKS_PET = 'top_picks_pet',\n\tTOP_PICKS_FLOWER = 'top_picks_flower',\n\tTOP_PICKS_COFFEE = 'top_picks_coffee',\n}\n\nexport enum UserAppSectionItemType {\n\tHOME = 'home',\n\tFOOD = 'food',\n\tGROCERY = 'grocery',\n\tCOFFEE = 'coffee',\n\tPET = 'pet',\n\tFLOWER = 'flower'\t\n}\n\nexport enum CoreAuthIdentityType {\n\tEMAIL = 'email',\n\tPHONE = 'phone',\n\tGOOGLE = 'google',\n\tAPPLE = 'apple',\n}\n\nexport enum ProductType {\n\tMEAT = 'meat',\n\tCHICKEN = 'chicken',\n\tFISH = 'fish',\n\tVEGETARIAN = 'vegetarian',\n\tOTHER = 'other',\n}\n\nexport enum PriceOption {\n\tSINGLE_PRICE = 'single_price',\n\tPRICE_PER_UNIT = 'price_per_unit',\n\tPRICE_PER_PORTION = 'price_per_portion',\n}\n\nexport enum AttributeItemSelectionType {\n\tSINGLE = 'single',\n\tMULTIPLE = 'multiple',\n}\n\nexport enum ProductDietaryType {\n\tGLUTEN_FREE = 'gluten_free',\n\tLOW_CAL = 'low_cal',\n\tVEGETARIAN = 'vegetarian',\n\tVEGAN = 'vegan',\n\tKETO = 'keto',\n\tLACTOSE_FREE = 'lactose_free',\n\tHIGH_PROTEIN = 'high_protein',\n}\n\nexport enum DishCategory {\n\tBREAKFAST = 'breakfast',\n\tLUNCH = 'lunch',\n\tDINNER = 'dinner',\n\tSNACKS = 'snacks',\n}\n\nexport enum NotificationAccountType {\n\tUSER = 'user',\n\tPARENT = 'parent',\n\tSHOP = 'shop',\n\tRIDER = 'rider',\n\tADMIN = 'admin',\n\tCUSTOMER_SERVICE = 'customer_service',\n}\n\nexport enum ClickType {\n\tCLICKABLE_URL = 'clickable_url',\n\tCLICKABLE_ORDER = 'clickable_order',\n\tCLICKABLE_SHOP = 'clickable_shop',\n\tCLICKABLE_PRODUCT = 'clickable_product',\n\tCLICKABLE_LIST_CONTAINER = 'clickable_list_container',\n\tCLICKABLE_PAYOUT = 'clickable_payout',\n\tCLICKABLE_BOB_FINANCE = 'clickable_bob_finance',\n\tCLICKABLE_REQUEST_AREA = 'clickable_request_area',\n}\n\nexport enum ChargeType {\n\tCUSTOM = 'custom',\n}\n\nexport enum ShopOnlineStatus {\n\tONLINE = 'online',\n\tOFFLINE = 'offline',\n\tBUSY = 'busy',\n}\n\nexport enum ShopRole {\n\tPARENT = 'parent',\n\tPARENT_MANAGER = 'parent_manager',\n\tPARENT_ORDER_MANAGER = 'parent_order_manager',\n\tSHOP = 'shop',\n\tSHOP_MANAGER = 'shop_manager',\n\tSHOP_ORDER_MANAGER = 'shop_order_manager',\n}\n\nexport enum BannerClickType {\n\tLINK = 'link',\n\tSHOP = 'shop',\n\tPRODUCT = 'product',\n\tLIST_CONTAINER = 'list_container',\n\tPLUS = 'plus',\n}\n\nexport enum BannerLinkType {\n\tURL = 'url',\n\tAPP_ROUTE = 'app-route',\n}\n\nexport enum BannerUserType {\n\tALL = 'all',\n\tPLUS = 'plus',\n\tNORMAL = 'normal',\n}\n\nexport enum CounterType {\n\tORDER = 'order',\n\tCRM_NUMBER = 'crm_number',\n\tshop = 'shop',\n}\n\nexport enum FaqAccountType {\n\tUSER = 'user',\n\tSHOP = 'shop',\n\tRIDER = 'rider',\n}\n\nexport enum ZoneStatus {\n\tACTIVE = 'active',\n\tINACTIVE = 'inactive',\n\tBUSY = 'busy',\n}\n\nexport enum BobAccountType {\n\tRIDER = 'rider',\n\tSHOP = 'shop',\n}\n\nexport enum BobSettlementType {\n\tSETTLE_CASH = 'settle_cash',\n\tSETTLE_PAYOUT = 'settle_Payout',\n}\n\nexport enum BobSettlementStatus {\n\tNOT_PAID = 'not_paid',\n\tPAID = 'paid',\n\tREVOKED = 'revoked',\n}\n\nexport enum BobModel {\n\tC2B = 'C2B',\n\tB2C = 'B2C',\n}\n\nexport enum BobType {\n\tINWARD = 'inward',\n\tOUTWARD = 'outward',\n}\n\nexport enum CouponType {\n\tGLOBAL = 'global',\n\tINDIVIDUAL_STORE = 'individual_store',\n\tINDIVIDUAL_USER = 'individual_user',\n\tCUSTOM_COUPON = 'custom_coupon',\n\tREFERRAL_CODE = 'referral_code',\n\tREFERRAL_REWARD = 'referral_reward',\n}\n\nexport enum CouponExpirationReason {\n\tDURATION = 'duration',\n\tSPEND_LIMIT = 'spendLimit',\n\tTOTAL_ORDER_LIMIT = 'totalOrderLimit',\n}\n\nexport enum FavouriteType {\n\tPRODUCT = 'product',\n\tSHOP = 'shop',\n}\n\nexport enum MarketingType {\n\tDISCOUNT = 'discount',\n\tBUY1GET1 = 'buy1get1',\n\tFREE_DELIVERY = 'free_delivery',\n\tFEATURED = 'featured',\n\tLOYALTY_POINT = 'loyalty_point',\n\tPUNCH_MARKETING = 'punch_marketing',\n}\n\nexport enum MarketingStatus {\n\tACTIVE = 'active',\n\tPAUSED = 'paused',\n\tEXPIRED = 'expired',\n\tDELETED = 'deleted',\n}\n\nexport enum AdminRole {\n\tSUPER_ADMIN = 'super_admin',\n\tGENERAL_MANAGER = 'general_manager',\n\tORDER_MANAGEMENT_MANAGER = 'order_management_lead',\n\tORDER_MANAGEMENT_AGENT = 'order_management_agent',\n\tACCOUNT_MANAGER = 'account_manager',\n\tBUSINESS_DEVELOPMENT_EXECUTIVE = 'business_development_executive',\n\tACCOUNTING = 'accounting',\n\tMARKETING_MANAGER = 'marketing_manager',\n}\n\nexport enum CartStatus {\n\tACTIVE = 'active',\n\tLOCKED = 'locked',\n\tSUBMITTED = 'submitted',\n}\n\nexport enum PaymentPreference {\n\tPAY_FOR_EVERYONE = 'pay_for_everyone',\n\tPAY_FOR_THEMSELVES = 'pay_for_themselves',\n}\n\nexport enum CardType {\n\tSTRIPE = 'stripe',\n\tAREEBA = 'areeba',\n}\n\nexport enum CardUserType {\n\tPARENT = 'parent',\n\tADMIN = 'admin',\n\tUSER = 'user',\n}\n\nexport enum AreebaCardStatus {\n\tPENDING = 'pending',\n\tACTIVE = 'active',\n}\n\nexport enum LiveStatus {\n\tONLINE = 'online',\n\tOFFLINE = 'offline',\n}\n\nexport enum CreatedBy {\n\tADMIN = 'admin',\n\tRIDER = 'rider',\n\tSHOP = 'shop',\n}\n\nexport enum ShiftType {\n\tDAY = 'day',\n\tNIGHT = 'night',\n}\n\nexport enum RiderType {\n\tSHOP_RIDER = 'shop_rider',\n\tLYXA_RIDER = 'lyxa_rider',\n}\n\nexport enum RiderBagSize {\n\tREGULAR = 'regular',\n\tLARGE = 'large',\n}\n\nexport enum Language {\n\tEN = 'en',\n\tAR = 'ar',\n}\n\nexport enum OrderType {\n\tREGULAR = 'regular',\n\tCOURIER = 'courier',\n}\n\nexport enum RegularOrderStatus {\n\tSCHEDULED = 'schedule',\n\tPLACED = 'placed',\n\tACCEPTED_BY_RIDER = 'accepted_by_rider',\n\tPREPARING = 'preparing',\n\tREADY_FOR_PICKUP = 'ready_to_pickup',\n\tON_THE_WAY = 'on_the_way',\n\tDELIVERED = 'delivered',\n\tCANCELLED = 'cancelled',\n}\n\nexport enum CourierOrderStatus {\n\tSCHEDULED = 'schedule',\n\tPLACED = 'placed',\n\tACCEPTED_BY_RIDER = 'accepted_by_rider',\n\tON_THE_WAY = 'on_the_way',\n\tDELIVERED = 'delivered',\n\tCANCELLED = 'cancelled',\n}\n\nexport enum DeliveryStatus {\n\tPENDING = 'pending',\n\tACCEPTED_BY_RIDER = 'accepted_by_rider',\n\tREADY_FOR_PICKUP = 'ready_to_pickup',\n\tON_THE_WAY = 'on_the_way',\n\tDELIVERED = 'delivered',\n\tCANCELLED = 'cancelled',\n}\n\nexport enum OrderFinanceStatus {\n\tPENDING = 'pending',\n\tDELIVERED = 'delivered',\n\tCANCELLED = 'cancelled',\n}\n\nexport enum OrderCancelBy {\n\tUSER = 'user',\n\tADMIN = 'admin',\n\tSHOP = 'shop',\n}\n\nexport enum CourierServiceType {\n\tDELIVERY_ONLY = 'delivery_only',\n\tPURCHASE_AND_DELIVER = 'purchase_and_deliver',\n}\n\nexport enum RiderAssignmentStatus {\n\tREQUESTED = 'requested',\n\tASSIGNED = 'assigned',\n\tREJECTED = 'rejected',\n\tCANCELED = 'canceled',\n\tUNASSIGNED = 'unassigned', // for unassigning rider from order by admin\n}\n\nexport enum ZoneGeometryType {\n\tPOLYGON = 'Polygon',\n}\n\nexport enum WorkingHourSettingsType {\n\tGLOBAL = 'Global',\n\tSHOP = 'Shop',\n}\n\nexport enum MediaType {\n\tIMAGE = 'image',\n}\n\nexport enum SettlementType {\n\tADD_CREDIT = 'add_credit',\n\tREMOVE_CREDIT = 'remove_credit',\n\tEXPIRED_LOYALTY_POINTS = 'expired_loyalty_points',\n\tRIDER_SETTLE_CASH = 'rider_settle_cash',\n\tSETTLE_VAT = 'settle_vat',\n\tSETTLE_FEATURED_AMOUNT = 'settle_featured_amount',\n\tSETTLE_SUBSCRIPTION_AMOUNT = 'settle_subscription_amount',\n\tSETTLE_PAYOUT = 'settle_payout',\n\tORDER_REFUND_BY_SHOP = 'order_refund_by_shop',\n\tORDER_REFUND_BY_COMPANY = 'order_refund_by_company',\n\tORDER_REFUND_TO_USER = 'order_refund_to_user',\n\tTOP_UP = 'top_up',\n}\n\nexport enum AddRemoveCreditSettlementType {\n\tADD_CREDIT = 'add_credit',\n\tREMOVE_CREDIT = 'remove_credit',\n}\n\nexport enum PlusSettingsPackageType {\n\tMONTHLY = 'monthly',\n\tYEARLY = 'yearly',\n\tWEEKLY = 'weekly',\n}\n\nexport enum SupportReasonTypeEnum {\n\tORDER = 'order',\n\tACCOUNT = 'account',\n\tSHOP = 'shop',\n\tFAQ = 'faq',\n}\n\nexport enum CancellationReasonTypeEnum {\n\tUSER = 'user',\n\tCOURIER = 'courier',\n\tSHOP = 'shop',\n\tRESOLVE_CHAT = 'resolve_chat',\n\tLYXA_PLUS_SUBSCRIPTION = 'lyxa_plus_subscription',\n}\n\nexport enum SettingsReasonStatus {\n\tACTIVE = 'active',\n\tINACTIVE = 'inactive',\n\tDELETE = 'delete',\n}\n\nexport enum AddRemoveCreditAccountType {\n\tUSER = 'user',\n\tSHOP = 'shop',\n\tRIDER = 'rider',\n}\n"]}
@@ -195,7 +195,7 @@ export declare const AddressSchema: z.ZodObject<{
195
195
  city?: string | null | undefined;
196
196
  zone?: string | import("mongoose").Types.ObjectId | undefined;
197
197
  }>;
198
- export declare const UserAddressSchema: z.ZodObject<{
198
+ export declare const UserAddressSchema: z.ZodObject<z.objectUtil.extendShape<{
199
199
  address: z.ZodString | z.ZodOptional<z.ZodString> | z.ZodNullable<z.ZodString> | z.ZodOptional<z.ZodNullable<z.ZodString>>;
200
200
  description: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodNullable<z.ZodString>> | z.ZodOptional<z.ZodOptional<z.ZodString>> | z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
201
201
  city: z.ZodString | z.ZodOptional<z.ZodString> | z.ZodNullable<z.ZodString> | z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -214,13 +214,13 @@ export declare const UserAddressSchema: z.ZodObject<{
214
214
  latitude: z.ZodNumber;
215
215
  longitude: z.ZodNumber;
216
216
  zone: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
217
- } & {
217
+ }, {
218
218
  addressLabel: z.ZodString | z.ZodOptional<z.ZodString> | z.ZodNullable<z.ZodString> | z.ZodOptional<z.ZodNullable<z.ZodString>>;
219
219
  apartment: z.ZodString | z.ZodOptional<z.ZodString> | z.ZodNullable<z.ZodString> | z.ZodOptional<z.ZodNullable<z.ZodString>>;
220
220
  buildingName: z.ZodString | z.ZodOptional<z.ZodString> | z.ZodNullable<z.ZodString> | z.ZodOptional<z.ZodNullable<z.ZodString>>;
221
221
  deliveryOption: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodNullable<z.ZodString>> | z.ZodOptional<z.ZodOptional<z.ZodString>> | z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
222
222
  instructions: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodNullable<z.ZodString>> | z.ZodOptional<z.ZodOptional<z.ZodString>> | z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
223
- }, "strip", z.ZodTypeAny, {
223
+ }>, "strip", z.ZodTypeAny, {
224
224
  location: {
225
225
  type: GeoLocationType;
226
226
  coordinates: [number, number];
@@ -257,7 +257,7 @@ export declare const UserAddressSchema: z.ZodObject<{
257
257
  deliveryOption?: string | null | undefined;
258
258
  instructions?: string | null | undefined;
259
259
  }>;
260
- export declare const CourierAddressSchema: z.ZodObject<{
260
+ export declare const CourierAddressSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
261
261
  address: z.ZodString | z.ZodOptional<z.ZodString> | z.ZodNullable<z.ZodString> | z.ZodOptional<z.ZodNullable<z.ZodString>>;
262
262
  description: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodNullable<z.ZodString>> | z.ZodOptional<z.ZodOptional<z.ZodString>> | z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
263
263
  city: z.ZodString | z.ZodOptional<z.ZodString> | z.ZodNullable<z.ZodString> | z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -276,16 +276,16 @@ export declare const CourierAddressSchema: z.ZodObject<{
276
276
  latitude: z.ZodNumber;
277
277
  longitude: z.ZodNumber;
278
278
  zone: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
279
- } & {
279
+ }, {
280
280
  addressLabel: z.ZodString | z.ZodOptional<z.ZodString> | z.ZodNullable<z.ZodString> | z.ZodOptional<z.ZodNullable<z.ZodString>>;
281
281
  apartment: z.ZodString | z.ZodOptional<z.ZodString> | z.ZodNullable<z.ZodString> | z.ZodOptional<z.ZodNullable<z.ZodString>>;
282
282
  buildingName: z.ZodString | z.ZodOptional<z.ZodString> | z.ZodNullable<z.ZodString> | z.ZodOptional<z.ZodNullable<z.ZodString>>;
283
283
  deliveryOption: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodNullable<z.ZodString>> | z.ZodOptional<z.ZodOptional<z.ZodString>> | z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
284
284
  instructions: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodNullable<z.ZodString>> | z.ZodOptional<z.ZodOptional<z.ZodString>> | z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
285
- } & {
285
+ }>, {
286
286
  name: z.ZodString | z.ZodOptional<z.ZodString> | z.ZodNullable<z.ZodString> | z.ZodOptional<z.ZodNullable<z.ZodString>>;
287
287
  phoneNumber: z.ZodString | z.ZodOptional<z.ZodString> | z.ZodNullable<z.ZodString> | z.ZodOptional<z.ZodNullable<z.ZodString>>;
288
- }, "strip", z.ZodTypeAny, {
288
+ }>, "strip", z.ZodTypeAny, {
289
289
  location: {
290
290
  type: GeoLocationType;
291
291
  coordinates: [number, number];
@@ -32,7 +32,7 @@ export declare class ZodValidation {
32
32
  nullable?: boolean;
33
33
  }): z.ZodString | z.ZodOptional<z.ZodString> | z.ZodNullable<z.ZodString> | z.ZodOptional<z.ZodNullable<z.ZodString>>;
34
34
  static url(field?: string): z.ZodString;
35
- static phoneNumber(field?: string): z.ZodString;
35
+ static phoneNumber(field?: string): z.ZodEffects<z.ZodString, string, string>;
36
36
  static date(field?: string, minDate?: Date, maxDate?: Date): z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodDate]>, Date, string | Date>, Date, string | Date>;
37
37
  static boolean(field?: string): z.ZodBoolean;
38
38
  static array<T extends z.ZodTypeAny>(schema: T, field?: string, minItems?: number, maxItems?: number): z.ZodArray<T, "many">;
@@ -4,6 +4,7 @@ exports.SchemaBuilder = exports.ZodValidation = void 0;
4
4
  exports.createSchemaBuilder = createSchemaBuilder;
5
5
  const zod_1 = require("zod");
6
6
  const typegoose_1 = require("@typegoose/typegoose");
7
+ const libphonenumber_js_1 = require("libphonenumber-js");
7
8
  class ZodValidation {
8
9
  static objectId(field = 'Field') {
9
10
  return zod_1.z.union([
@@ -100,9 +101,17 @@ class ZodValidation {
100
101
  return zod_1.z.string({ required_error: `${field} is required` }).url(`${field} must be a valid URL`);
101
102
  }
102
103
  static phoneNumber(field = 'Field') {
103
- return zod_1.z
104
- .string({ required_error: `${field} is required` })
105
- .regex(/^[+]{1}(?:[0-9\-\\(\\)\\/.]\s?){6,15}[0-9]{1}$/, `${field} must be a valid phone number`);
104
+ return zod_1.z.string({ required_error: `${field} is required` }).refine(value => {
105
+ try {
106
+ const phone = (0, libphonenumber_js_1.parsePhoneNumberFromString)(value);
107
+ return phone?.isValid();
108
+ }
109
+ catch {
110
+ return false;
111
+ }
112
+ }, {
113
+ message: `please input a valid phone number`,
114
+ });
106
115
  }
107
116
  static date(field = 'Field', minDate, maxDate) {
108
117
  return zod_1.z
@@ -1 +1 @@
1
- {"version":3,"file":"global-validation.js","sourceRoot":"/","sources":["utilities/validation/global-validation.ts"],"names":[],"mappings":";;;AAisBA,kDAMC;AAvsBD,6BAAwB;AACxB,oDAAgD;AAehD,MAAa,aAAa;IAczB,MAAM,CAAC,QAAQ,CAAC,QAAgB,OAAO;QACtC,OAAO,OAAC,CAAC,KAAK,CACb;YACC,OAAC;iBACC,MAAM,CAAC,EAAE,cAAc,EAAE,GAAG,KAAK,cAAc,EAAE,CAAC;iBAClD,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,oBAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;gBACpD,OAAO,EAAE,GAAG,KAAK,2BAA2B;aAC5C,CAAC;iBACD,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,oBAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;YACpD,OAAC,CAAC,UAAU,CAAC,oBAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE;gBACrC,OAAO,EAAE,GAAG,KAAK,2BAA2B;aAC5C,CAAC;SACF,EACD,EAAE,OAAO,EAAE,GAAG,KAAK,cAAc,EAAE,CACnC,CAAC;IACH,CAAC;IAiBD,MAAM,CAAC,QAAQ,CAAuB,OAAU,EAAE,QAAgB,OAAO;QACxE,OAAO,OAAC,CAAC,UAAU,CAAC,OAAO,EAAE;YAC5B,OAAO,EAAE,GAAG,KAAK,oBAAoB,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI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AAC,eAAe,CAAC,iBAAiB,CAAC;YACrD,YAAY,EAAE,IAAI,CAAC,eAAe,EAAE;SACpC,CAAC;IACH,CAAC;CACD;AAlND,sCAkNC;AA8CD,SAAgB,mBAAmB,CAClC,UAAa,EACb,oBAA6B,IAAI,EACjC,kBAA2B,KAAK;IAEhC,OAAO,IAAI,aAAa,CAAC,UAAU,EAAE,iBAAiB,EAAE,eAAe,CAAC,CAAC;AAC1E,CAAC","sourcesContent":["import { z } from 'zod';\nimport { mongoose } from '@typegoose/typegoose';\n\n/**\n * Enhanced validation utilities for creating robust Zod schemas.\n * This class provides a collection of static methods to create common validation patterns.\n *\n * @example\n * ```typescript\n * const userSchema = z.object({\n * username: ZodValidation.requiredString(\"Username is required\"),\n * email: ZodValidation.email(),\n * role: ZodValidation.enumType(UserRole)\n * });\n * ```\n */\nexport class ZodValidation {\n\t/**\n\t * Creates a union type that accepts both string ObjectId and mongoose ObjectId instance.\n\t * This is useful when dealing with both raw string IDs and Mongoose ObjectId instances.\n\t *\n\t * @param field - The name of the field to be included in the error message\n\t * @returns A Zod union schema that accepts both string and ObjectId\n\t *\n\t * @example\n\t * ```typescript\n\t * const idSchema = ZodValidation.objectIdUnion();\n\t * // Accepts \"507f1f77bcf86cd799439011\" or new mongoose.Types.ObjectId(\"507f1f77bcf86cd799439011\")\n\t * ```\n\t */\n\tstatic objectId(field: string = 'Field') {\n\t\treturn z.union(\n\t\t\t[\n\t\t\t\tz\n\t\t\t\t\t.string({ required_error: `${field} is required` })\n\t\t\t\t\t.refine(val => mongoose.Types.ObjectId.isValid(val), {\n\t\t\t\t\t\tmessage: `${field} must be a valid ObjectID`,\n\t\t\t\t\t})\n\t\t\t\t\t.transform(val => new mongoose.Types.ObjectId(val)),\n\t\t\t\tz.instanceof(mongoose.Types.ObjectId, {\n\t\t\t\t\tmessage: `${field} must be a valid ObjectID`,\n\t\t\t\t}),\n\t\t\t],\n\t\t\t{ message: `${field} is required` }\n\t\t);\n\t}\n\n\t/**\n\t * Creates an enum validation with custom error message.\n\t * This validates that a value is one of the values defined in the enum.\n\t *\n\t * @template T - Type of the enum\n\t * @param enumObj - The enum object to validate against\n\t * @param field - The name of the field to be included in the error message\n\t * @returns A Zod schema that validates against the provided enum\n\t *\n\t * @example\n\t * ```typescript\n\t * enum UserRole { ADMIN = \"admin\", USER = \"user\" }\n\t * const roleSchema = ZodValidation.enumType(UserRole, \"Invalid user role\");\n\t * ```\n\t */\n\tstatic enumType<T extends z.EnumLike>(enumObj: T, field: string = 'Field') {\n\t\treturn z.nativeEnum(enumObj, {\n\t\t\tmessage: `${field} must be one of: ${Object.values(enumObj).join(', ')}`,\n\t\t});\n\t}\n\n\t/**\n\t * Creates a required number validation with a minimum length.\n\t * The number is also trimmed to remove leading/trailing whitespace.\n\t *\n\t * @param field - The name of the field to be included in the error message\n\t * @param min - Minimum number (optional)\n\t * @param max - MAximum number (optional)\n\t * @param options - options (optional)\n\t * @returns A Zod schema that validates numbers with minimum length\n\t *\n\t * @example\n\t * ```typescript\n\t * const nameSchema = ZodValidation.Number(\"Price\");\n\t * ```\n\t */\n\tstatic number(\n\t\tfield: string = 'Field',\n\t\toptions?: {\n\t\t\tmin?: number;\n\t\t\tmax?: number;\n\t\t\tisInt?: boolean;\n\t\t\tisPositive?: boolean;\n\t\t\tisNonpositive?: boolean;\n\t\t\tisNegative?: boolean;\n\t\t\tisNonnegative?: boolean;\n\t\t}\n\t) {\n\t\tlet schema = z.number({\n\t\t\trequired_error: `${field} is required`,\n\t\t\tinvalid_type_error: `${field} must be a number`,\n\t\t});\n\n\t\t// Range validation\n\t\tif (options?.min !== undefined) {\n\t\t\tschema = schema.gte(options?.min, {\n\t\t\t\tmessage: `${field} must be at least ${options?.min}`,\n\t\t\t});\n\t\t}\n\t\tif (options?.max !== undefined) {\n\t\t\tschema = schema.lte(options?.max, {\n\t\t\t\tmessage: `${field} must be at most ${options?.max}`,\n\t\t\t});\n\t\t}\n\n\t\t// Option validation\n\t\tif (options?.isInt) {\n\t\t\tschema = schema.int({ message: `${field} must be an integer` });\n\t\t}\n\t\tif (options?.isPositive) {\n\t\t\tschema = schema.positive({ message: `${field} must be positive` });\n\t\t}\n\t\tif (options?.isNonpositive) {\n\t\t\tschema = schema.nonpositive({ message: `${field} must be non-positive` });\n\t\t}\n\t\tif (options?.isNegative) {\n\t\t\tschema = schema.negative({ message: `${field} must be negative` });\n\t\t}\n\t\tif (options?.isNonnegative) {\n\t\t\tschema = schema.nonnegative({ message: `${field} must be non-negative` });\n\t\t}\n\n\t\treturn schema;\n\t}\n\n\t/**\n\t * Creates a required string validation with a minimum length.\n\t * The string is also trimmed to remove leading/trailing whitespace.\n\t *\n\t * @param field - The name of the field to be included in the error message\n\t * @param minLength - Minimum required length (optional)\n\t * @param maxLength - Maximum required length (optional)\n\t * @param regex - Regular expression (optional)\n\t * @returns A Zod schema that validates strings with minimum length\n\t *\n\t * @example\n\t * ```typescript\n\t * const nameSchema = ZodValidation.String(\"Name\");\n\t * ```\n\t */\n\tstatic string(\n\t\tfield: string = 'Field',\n\t\toptions?: {\n\t\t\tminLength?: number;\n\t\t\tmaxLength?: number;\n\t\t\toptional?: boolean;\n\t\t\tnullable?: boolean;\n\t\t\tminMessage?: string;\n\t\t\tmaxMessage?: string;\n\t\t\trequiredMessage?: string;\n\t\t\tregex?: { pattern: RegExp; message: string }; // Add regex option\n\t\t}\n\t) {\n\t\tlet schema = z.string({\n\t\t\trequired_error: options?.requiredMessage || `${field} is required`,\n\t\t});\n\n\t\tif (options?.minLength) {\n\t\t\tschema = schema.min(\n\t\t\t\toptions.minLength,\n\t\t\t\toptions.minMessage || `${field} must be at least ${options.minLength} characters`\n\t\t\t);\n\t\t}\n\n\t\tif (options?.maxLength) {\n\t\t\tschema = schema.max(\n\t\t\t\toptions.maxLength,\n\t\t\t\toptions.maxMessage || `${field} shouldn’t exceed ${options.maxLength} characters`\n\t\t\t);\n\t\t}\n\n\t\t// Check for regex pattern and add regex validation\n\t\tif (options?.regex) {\n\t\t\tschema = schema.regex(options.regex.pattern, options.regex.message);\n\t\t}\n\n\t\tif (options?.nullable && options?.optional) {\n\t\t\treturn schema.nullish();\n\t\t}\n\t\tif (options?.nullable) {\n\t\t\treturn schema.nullable();\n\t\t}\n\t\tif (options?.optional) {\n\t\t\treturn schema.optional();\n\t\t}\n\n\t\treturn schema;\n\t}\n\n\t/**\n\t * Creates an email validation.\n\t * Validates that the string is a valid email address format.\n\t *\n\t * @param field - The name of the field to be included in the error message\n\t * @returns A Zod schema that validates email addresses\n\t *\n\t * @example\n\t * ```typescript\n\t * const emailSchema = ZodValidation.email(\"Please enter a valid email\");\n\t * ```\n\t */\n\tstatic email(\n\t\tfield: string = 'Email',\n\t\toptions?: {\n\t\t\trequiredMessage?: string;\n\t\t\tinvalidMessage?: string;\n\t\t\toptional?: boolean;\n\t\t\tnullable?: boolean;\n\t\t}\n\t) {\n\t\tconst schema = z\n\t\t\t.string({\n\t\t\t\trequired_error: options?.requiredMessage || `${field} is required`,\n\t\t\t})\n\t\t\t.email(options?.invalidMessage || `${field} must be a valid email address`);\n\n\t\tif (options?.nullable && options?.optional) {\n\t\t\treturn schema.nullish();\n\t\t}\n\t\tif (options?.nullable) {\n\t\t\treturn schema.nullable();\n\t\t}\n\t\tif (options?.optional) {\n\t\t\treturn schema.optional();\n\t\t}\n\t\treturn schema;\n\t}\n\n\t/**\n\t * Creates a URL validation.\n\t * Validates that the string is a valid URL format.\n\t *\n\t * @param field - The name of the field to be included in the error message\n\t * @returns A Zod schema that validates URLs\n\t *\n\t * @example\n\t * ```typescript\n\t * const websiteSchema = ZodValidation.url(\"Please enter a valid URL\");\n\t * ```\n\t */\n\tstatic url(field: string = 'Field') {\n\t\treturn z.string({ required_error: `${field} is required` }).url(`${field} must be a valid URL`);\n\t}\n\n\t/**\n\t * Creates a phone number validation schema using a regex pattern for global phone numbers.\n\t *\n\t * @param field - The name of the field to be included in the error message\n\t * @returns A Zod schema that validates phone numbers\n\t *\n\t * @example\n\t * ```typescript\n\t * const phoneSchema = ZodValidation.phoneNumber(\"Phone number\");\n\t * ```\n\t */\n\tstatic phoneNumber(field: string = 'Field') {\n\t\treturn z\n\t\t\t.string({ required_error: `${field} is required` })\n\t\t\t.regex(/^[+]{1}(?:[0-9\\-\\\\(\\\\)\\\\/.]\\s?){6,15}[0-9]{1}$/, `${field} must be a valid phone number`);\n\t}\n\n\t/**\n\t * Creates a date validation.\n\t * Validates that the input is a JavaScript Date object.\n\t *@param field - The name of the field to be included in the error message\n\t *@param minDate - Minimum required date (optional)\n\t *@param maxDate - Maximum required date (optional)\n\t * @returns A Zod schema that validates Date objects\n\t *\n\t * @example\n\t * ```typescript\n\t * const createdAtSchema = ZodValidation.date();\n\t * ```\n\t */\n\tstatic date(field: string = 'Field', minDate?: Date, maxDate?: Date) {\n\t\treturn z\n\t\t\t.union(\n\t\t\t\t[\n\t\t\t\t\tz\n\t\t\t\t\t\t.string({ required_error: `${field} is required` })\n\t\t\t\t\t\t.refine(val => {\n\t\t\t\t\t\t\tconst date = new Date(val);\n\t\t\t\t\t\t\treturn !isNaN(date.getTime());\n\t\t\t\t\t\t}, `${field} must be a valid date`)\n\t\t\t\t\t\t.transform(val => new Date(val)),\n\t\t\t\t\tz.date({\n\t\t\t\t\t\trequired_error: `${field} is required`,\n\t\t\t\t\t\tinvalid_type_error: `${field} must be a valid date`,\n\t\t\t\t\t}),\n\t\t\t\t],\n\t\t\t\t{ message: `${field} is required` }\n\t\t\t)\n\t\t\t.refine(\n\t\t\t\tval => minDate === undefined || val >= minDate,\n\t\t\t\t`${field} must be on or after ${minDate?.toISOString()}`\n\t\t\t)\n\t\t\t.refine(\n\t\t\t\tval => maxDate === undefined || val <= maxDate,\n\t\t\t\t`${field} must be on or before ${maxDate?.toISOString()}`\n\t\t\t);\n\t}\n\n\t/**\n\t * Creates a boolean validation with an optional default value.\n\t *\n\t * @param field - The name of the field to be included in the error message\n\t * @returns A Zod schema that validates booleans\n\t *\n\t * @example\n\t * ```typescript\n\t * const isActiveSchema = ZodValidation.boolean(true); // Defaults to true\n\t * ```\n\t */\n\tstatic boolean(field: string = 'Field') {\n\t\treturn z.boolean({\n\t\t\trequired_error: `${field} is required`,\n\t\t\tinvalid_type_error: `${field} must be a boolean`,\n\t\t});\n\t}\n\n\t/**\n\t * Creates an array validation with optional minimum items constraint.\n\t *\n\t * @template T - Type of the schema for array items\n\t * @param schema - The schema for validating array items\n\t * @param field - The name of the field to be included in the error message\n\t * @param minItems - Minimum number of items required (optional)\n\t * @param maxItems - Maximum number of items required (optional)\n\t * @returns A Zod schema that validates arrays\n\t *\n\t * @example\n\t * ```typescript\n\t * const tagsSchema = ZodValidation.array(z.string(), \"At least one tag required\", 1);\n\t * ```\n\t */\n\tstatic array<T extends z.ZodTypeAny>(\n\t\tschema: T,\n\t\tfield: string = 'Array',\n\t\tminItems?: number,\n\t\tmaxItems?: number\n\t) {\n\t\tlet arraySchema = z.array(schema, {\n\t\t\trequired_error: `${field} is required`,\n\t\t});\n\n\t\tif (minItems === 1) {\n\t\t\tarraySchema = arraySchema.min(1, `${field} cannot be empty`);\n\t\t}\n\t\tif (minItems !== undefined && minItems !== 1) {\n\t\t\tarraySchema = arraySchema.min(minItems, `${field} must have at least ${minItems} items`);\n\t\t}\n\t\tif (maxItems !== undefined) {\n\t\t\tarraySchema = arraySchema.max(maxItems, `${field} must have at most ${maxItems} items`);\n\t\t}\n\n\t\treturn arraySchema;\n\t}\n\n\t/**\n\t * Standard timestamp fields for entities.\n\t * Includes createdAt, updatedAt, and deletedAt fields.\n\t *\n\t * @returns An object containing timestamp field schemas\n\t *\n\t * @example\n\t * ```typescript\n\t * const userSchema = z.object({\n\t * name: z.string(),\n\t * ...ZodValidation.timestamps()\n\t * });\n\t * ```\n\t */\n\tstatic timestamps() {\n\t\treturn {\n\t\t\tcreatedAt: z.date().nullable().optional(),\n\t\t\tupdatedAt: z.date().nullable().optional(),\n\t\t\tdeletedAt: z.date().nullable().optional(),\n\t\t};\n\t}\n\n\t/**\n\t * Common fields for tracking model metadata.\n\t * Includes timestamps and user tracking fields (createdBy, updatedBy, deletedBy).\n\t *\n\t * @returns An object containing tracking field schemas\n\t *\n\t * @example\n\t * ```typescript\n\t * const postSchema = z.object({\n\t * title: z.string(),\n\t * content: z.string(),\n\t * ...ZodValidation.trackingFields()\n\t * });\n\t * ```\n\t */\n\tstatic trackingFields() {\n\t\treturn {\n\t\t\tcreatedBy: ZodValidation.objectId().optional(),\n\t\t\tupdatedBy: ZodValidation.objectId().optional(),\n\t\t\tdeletedBy: ZodValidation.objectId().optional(),\n\t\t\t...ZodValidation.timestamps(),\n\t\t};\n\t}\n}\n\n/**\n * Represents the common fields to exclude from update operations.\n * This is used to specify which fields should not be updateable.\n *\n * @example\n * ```typescript\n * const excludeFields: ExcludeFromUpdate = {\n * createdAt: true,\n * createdBy: true,\n * status: true // Prevent status from being updated\n * };\n * ```\n */\nexport type ExcludeFromUpdate = {\n\tcreatedAt?: true;\n\tupdatedAt?: true;\n\tdeletedAt?: true;\n\tcreatedBy?: true;\n\t_id?: true;\n} & Record<string, true>;\n\n/**\n * Schema builder for creating consistent CRUD schemas.\n * Provides utility methods to generate schemas for create, read, update, and delete operations.\n *\n * @template T - Type of the base schema shape\n *\n * @example\n * ```typescript\n * const userBuilder = new SchemaBuilder({\n * name: z.string(),\n * email: z.string().email()\n * });\n *\n * const schemas = userBuilder.getAllSchemas();\n * ```\n */\nexport class SchemaBuilder<T extends z.ZodRawShape> {\n\tprivate baseSchema: z.ZodObject<T>;\n\n\t/**\n\t * Create a new schema builder\n\t *\n\t * @param baseFields - The base fields for the schema\n\t * @param includeTimestamps - Whether to include timestamp fields (default: true)\n\t * @param includeTracking - Whether to include tracking fields (createdBy, etc.) (default: false)\n\t *\n\t * @example\n\t * ```typescript\n\t * const userFields = {\n\t * name: ZodValidation.requiredString(),\n\t * email: ZodValidation.email()\n\t * };\n\t *\n\t * // With timestamps\n\t * const builder1 = new SchemaBuilder(userFields);\n\t *\n\t * // Without timestamps\n\t * const builder2 = new SchemaBuilder(userFields, false);\n\t *\n\t * // With tracking fields\n\t * const builder3 = new SchemaBuilder(userFields, true, true);\n\t * ```\n\t */\n\tconstructor(\n\t\tbaseFields: T,\n\t\tprivate includeTimestamps: boolean = true,\n\t\tprivate includeTracking: boolean = false\n\t) {\n\t\tthis.baseSchema = this.createBaseSchema(baseFields);\n\t}\n\n\t/**\n\t * Creates the base schema with optional timestamps and tracking fields.\n\t */\n\tprivate createBaseSchema(baseFields: T) {\n\t\tconst additionalFields = this.includeTracking\n\t\t\t? ZodValidation.trackingFields()\n\t\t\t: this.includeTimestamps\n\t\t\t\t? ZodValidation.timestamps()\n\t\t\t\t: {};\n\n\t\treturn z.object({\n\t\t\t...baseFields,\n\t\t\t...additionalFields,\n\t\t});\n\t}\n\n\t/**\n\t * Gets the base validation schema without ID.\n\t * Used for creating new entities.\n\t *\n\t * @returns The base schema for creating new entities\n\t *\n\t * @example\n\t * ```typescript\n\t * const createUserSchema = userBuilder.getBaseSchema();\n\t * ```\n\t */\n\tgetBaseSchema() {\n\t\treturn this.baseSchema.strict();\n\t}\n\n\t/**\n\t * Gets the schema for entities with ID.\n\t * Used for representing complete entities with their ID.\n\t *\n\t * @returns The entity schema including ID\n\t *\n\t * @example\n\t * ```typescript\n\t * const userSchema = userBuilder.getEntitySchema();\n\t * ```\n\t */\n\tgetEntitySchema() {\n\t\treturn this.baseSchema\n\t\t\t.extend({\n\t\t\t\t_id: ZodValidation.objectId(),\n\t\t\t})\n\t\t\t.partial()\n\t\t\t.passthrough();\n\t}\n\n\t/**\n\t * Gets the schema for validating an entity ID.\n\t * Used for validating ID parameters in requests.\n\t *\n\t * @returns The ID validation schema\n\t *\n\t * @example\n\t * ```typescript\n\t * const userIdSchema = userBuilder.getIdSchema();\n\t * ```\n\t */\n\tgetIdSchema() {\n\t\treturn ZodValidation.objectId();\n\t}\n\n\t/**\n\t * Gets the schema for updating an entity, excluding specified fields.\n\t * Creates a partial schema where all fields are optional, and removes\n\t * fields that should not be updatable.\n\t *\n\t * @param excludeFields - Fields to exclude from update operations\n\t * @returns The update schema with excluded fields removed\n\t *\n\t * @example\n\t * ```typescript\n\t * // Prevent updating createdAt and status\n\t * const updateUserSchema = userBuilder.getUpdateSchema({\n\t * createdAt: true,\n\t * status: true\n\t * });\n\t * ```\n\t */\n\tgetUpdateSchema(excludeFields: ExcludeFromUpdate = { createdAt: true, updatedAt: true }) {\n\t\tconst entitySchema = this.getEntitySchema();\n\n\t\t// Simple approach - just make everything optional\n\t\tif (Object.keys(excludeFields).length === 0) {\n\t\t\treturn entitySchema;\n\t\t}\n\n\t\t// For the type-safe approach, we need to create a new schema\n\t\t// without the excluded fields and then make it partial\n\n\t\t// Get all fields from the entity schema\n\t\tconst shape = entitySchema._def.shape();\n\n\t\t// Filter out the fields we want to exclude\n\t\tconst filteredShape: z.ZodRawShape = {};\n\t\tfor (const key in shape) {\n\t\t\tif (!excludeFields[key as keyof typeof excludeFields]) {\n\t\t\t\tfilteredShape[key] = shape[key];\n\t\t\t}\n\t\t}\n\n\t\t// Create a new schema with the filtered fields\n\t\treturn z.object(filteredShape).partial().strict();\n\t}\n\n\t/**\n\t * Gets the schema for validating a delete request.\n\t * Used for validating parameters in delete requests, including the entity ID and soft delete flag.\n\t *\n\t * @returns The delete validation schema\n\t *\n\t * @example\n\t * ```typescript\n\t * const deleteSchema = userBuilder.getDeleteSchema();\n\t * ```\n\t */\n\tgetDeleteSchema() {\n\t\treturn z.object({\n\t\t\t_id: ZodValidation.objectId('_id'),\n\t\t\tsoftDelete: ZodValidation.boolean('Soft Delete').default(true),\n\t\t});\n\t}\n\n\t/**\n\t * Creates an update schema by optionally extending the base schema with additional fields\n\t * and optionally omitting specified fields.\n\t *\n\t * @param extendFields - Optional fields to add to the schema (e.g., `_id`, `softDelete`).\n\t * @param omitFields - Optional fields to omit from the base schema (e.g., `name`).\n\t * @returns A new Zod schema for updates.\n\t */\n\tupdateBaseSchema(extendFields?: z.ZodRawShape, omitFields?: string[]) {\n\t\tlet schema: z.ZodObject<any> = this.baseSchema;\n\n\t\tif (omitFields && omitFields.length > 0) {\n\t\t\tschema = schema.omit(omitFields.reduce((acc, key) => ({ ...acc, [key]: true }), {}));\n\t\t}\n\n\t\tif (extendFields) {\n\t\t\tschema = schema.extend({ _id: ZodValidation.objectId().optional(), ...extendFields });\n\t\t}\n\n\t\treturn schema;\n\t}\n\n\t/**\n\t * Gets all common schemas for an entity.\n\t * Returns base, entity, ID, and update schemas in a single object.\n\t *\n\t * @param excludeFromUpdate - Fields to exclude from update operations\n\t * @returns Object containing all schemas\n\t *\n\t * @example\n\t * ```typescript\n\t * const {\n\t * BaseSchema, // For creating\n\t * EntitySchema, // For reading\n\t * IdSchema, // For validating IDs\n\t * UpdateSchema // For updating\n\t * } = userBuilder.getAllSchemas();\n\t * ```\n\t */\n\tgetAllSchemas(excludeFromUpdate?: ExcludeFromUpdate) {\n\t\treturn {\n\t\t\tBaseSchema: this.getBaseSchema(),\n\t\t\tEntitySchema: this.getEntitySchema(),\n\t\t\tIdSchema: this.getIdSchema(),\n\t\t\tUpdateSchema: this.getUpdateSchema(excludeFromUpdate),\n\t\t\tDeleteSchema: this.getDeleteSchema(),\n\t\t};\n\t}\n}\n\n/**\n * Type helper for creating DTO types from creation schemas.\n * Used to derive the type for creating new entities.\n *\n * @template T - The schema type\n *\n * @example\n * ```typescript\n * type CreateUserDTO = DTO<typeof UserValidationSchema>;\n * ```\n */\nexport type DTO<T extends z.ZodType> = z.infer<T>;\n\n/**\n * Creates a schema builder for an entity.\n * Helper function to create a new SchemaBuilder instance.\n *\n * @template T - Type of the base schema shape\n * @param baseFields - Base fields for the entity\n * @param includeTimestamps - Whether to include timestamp fields (default: true)\n * @param includeTracking - Whether to include tracking fields (default: false)\n * @returns A new SchemaBuilder instance\n *\n * @example\n * ```typescript\n * const userFields = {\n * name: ZodValidation.requiredString(),\n * email: ZodValidation.email()\n * };\n *\n * const userSchemaBuilder = createSchemaBuilder(userFields);\n * const userSchemaBuilder = createSchemaBuilder(userFields, true, true); // With tracking\n * ```\n */\nexport type PaginatedResponse<T> = {\n\tmetadata: {\n\t\tpage: number;\n\t\tsize: number;\n\t\ttotalElements: number;\n\t\ttotalPages: number;\n\t};\n\tdocuments: T[];\n};\n\nexport function createSchemaBuilder<T extends z.ZodRawShape>(\n\tbaseFields: T,\n\tincludeTimestamps: boolean = true,\n\tincludeTracking: boolean = false\n) {\n\treturn new SchemaBuilder(baseFields, includeTimestamps, includeTracking);\n}\n"]}
1
+ {"version":3,"file":"global-validation.js","sourceRoot":"/","sources":["utilities/validation/global-validation.ts"],"names":[],"mappings":";;;AA6sBA,kDAMC;AAntBD,6BAAwB;AACxB,oDAAgD;AAChD,yDAA+D;AAe/D,MAAa,aAAa;IAczB,MAAM,CAAC,QAAQ,CAAC,QAAgB,OAAO;QACtC,OAAO,OAAC,CAAC,KAAK,CACb;YACC,OAAC;iBACC,MAAM,CAAC,EAAE,cAAc,EAAE,GAAG,KAAK,cAAc,EAAE,CAAC;iBAClD,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,oBAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;gBACpD,OAAO,EAAE,GAAG,KAAK,2BAA2B;aAC5C,CAAC;iBACD,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,oBAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;YACpD,OAAC,CAAC,UAAU,CAAC,oBAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE;gBACrC,OAAO,EAAE,GAAG,KAAK,2BAA2B;aAC5C,CAAC;SACF,EACD,EAAE,OAAO,EAAE,GAAG,KAAK,cAAc,EAAE,CACnC,CAAC;IACH,CAAC;IAiBD,MAAM,CAAC,QAAQ,CAAuB,OAAU,EAAE,QAAgB,OAAO;QACxE,OAAO,OAAC,CAAC,UAAU,CAAC,OAAO,EAAE;YAC5B,OAAO,EAAE,GAAG,KAA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,EAAE,GAAG,YAAY,EAAE,CAAC,CAAC;QACvF,CAAC;QAED,OAAO,MAAM,CAAC;IACf,CAAC;IAmBD,aAAa,CAAC,iBAAqC;QAClD,OAAO;YACN,UAAU,EAAE,IAAI,CAAC,aAAa,EAAE;YAChC,YAAY,EAAE,IAAI,CAAC,eAAe,EAAE;YACpC,QAAQ,EAAE,IAAI,CAAC,WAAW,EAAE;YAC5B,YAAY,EAAE,IAAI,CAAC,eAAe,CAAC,iBAAiB,CAAC;YACrD,YAAY,EAAE,IAAI,CAAC,eAAe,EAAE;SACpC,CAAC;IACH,CAAC;CACD;AAlND,sCAkNC;AA8CD,SAAgB,mBAAmB,CAClC,UAAa,EACb,oBAA6B,IAAI,EACjC,kBAA2B,KAAK;IAEhC,OAAO,IAAI,aAAa,CAAC,UAAU,EAAE,iBAAiB,EAAE,eAAe,CAAC,CAAC;AAC1E,CAAC","sourcesContent":["import { z } from 'zod';\nimport { mongoose } from '@typegoose/typegoose';\nimport { parsePhoneNumberFromString } from 'libphonenumber-js';\n\n/**\n * Enhanced validation utilities for creating robust Zod schemas.\n * This class provides a collection of static methods to create common validation patterns.\n *\n * @example\n * ```typescript\n * const userSchema = z.object({\n * username: ZodValidation.requiredString(\"Username is required\"),\n * email: ZodValidation.email(),\n * role: ZodValidation.enumType(UserRole)\n * });\n * ```\n */\nexport class ZodValidation {\n\t/**\n\t * Creates a union type that accepts both string ObjectId and mongoose ObjectId instance.\n\t * This is useful when dealing with both raw string IDs and Mongoose ObjectId instances.\n\t *\n\t * @param field - The name of the field to be included in the error message\n\t * @returns A Zod union schema that accepts both string and ObjectId\n\t *\n\t * @example\n\t * ```typescript\n\t * const idSchema = ZodValidation.objectIdUnion();\n\t * // Accepts \"507f1f77bcf86cd799439011\" or new mongoose.Types.ObjectId(\"507f1f77bcf86cd799439011\")\n\t * ```\n\t */\n\tstatic objectId(field: string = 'Field') {\n\t\treturn z.union(\n\t\t\t[\n\t\t\t\tz\n\t\t\t\t\t.string({ required_error: `${field} is required` })\n\t\t\t\t\t.refine(val => mongoose.Types.ObjectId.isValid(val), {\n\t\t\t\t\t\tmessage: `${field} must be a valid ObjectID`,\n\t\t\t\t\t})\n\t\t\t\t\t.transform(val => new mongoose.Types.ObjectId(val)),\n\t\t\t\tz.instanceof(mongoose.Types.ObjectId, {\n\t\t\t\t\tmessage: `${field} must be a valid ObjectID`,\n\t\t\t\t}),\n\t\t\t],\n\t\t\t{ message: `${field} is required` }\n\t\t);\n\t}\n\n\t/**\n\t * Creates an enum validation with custom error message.\n\t * This validates that a value is one of the values defined in the enum.\n\t *\n\t * @template T - Type of the enum\n\t * @param enumObj - The enum object to validate against\n\t * @param field - The name of the field to be included in the error message\n\t * @returns A Zod schema that validates against the provided enum\n\t *\n\t * @example\n\t * ```typescript\n\t * enum UserRole { ADMIN = \"admin\", USER = \"user\" }\n\t * const roleSchema = ZodValidation.enumType(UserRole, \"Invalid user role\");\n\t * ```\n\t */\n\tstatic enumType<T extends z.EnumLike>(enumObj: T, field: string = 'Field') {\n\t\treturn z.nativeEnum(enumObj, {\n\t\t\tmessage: `${field} must be one of: ${Object.values(enumObj).join(', ')}`,\n\t\t});\n\t}\n\n\t/**\n\t * Creates a required number validation with a minimum length.\n\t * The number is also trimmed to remove leading/trailing whitespace.\n\t *\n\t * @param field - The name of the field to be included in the error message\n\t * @param min - Minimum number (optional)\n\t * @param max - MAximum number (optional)\n\t * @param options - options (optional)\n\t * @returns A Zod schema that validates numbers with minimum length\n\t *\n\t * @example\n\t * ```typescript\n\t * const nameSchema = ZodValidation.Number(\"Price\");\n\t * ```\n\t */\n\tstatic number(\n\t\tfield: string = 'Field',\n\t\toptions?: {\n\t\t\tmin?: number;\n\t\t\tmax?: number;\n\t\t\tisInt?: boolean;\n\t\t\tisPositive?: boolean;\n\t\t\tisNonpositive?: boolean;\n\t\t\tisNegative?: boolean;\n\t\t\tisNonnegative?: boolean;\n\t\t}\n\t) {\n\t\tlet schema = z.number({\n\t\t\trequired_error: `${field} is required`,\n\t\t\tinvalid_type_error: `${field} must be a number`,\n\t\t});\n\n\t\t// Range validation\n\t\tif (options?.min !== undefined) {\n\t\t\tschema = schema.gte(options?.min, {\n\t\t\t\tmessage: `${field} must be at least ${options?.min}`,\n\t\t\t});\n\t\t}\n\t\tif (options?.max !== undefined) {\n\t\t\tschema = schema.lte(options?.max, {\n\t\t\t\tmessage: `${field} must be at most ${options?.max}`,\n\t\t\t});\n\t\t}\n\n\t\t// Option validation\n\t\tif (options?.isInt) {\n\t\t\tschema = schema.int({ message: `${field} must be an integer` });\n\t\t}\n\t\tif (options?.isPositive) {\n\t\t\tschema = schema.positive({ message: `${field} must be positive` });\n\t\t}\n\t\tif (options?.isNonpositive) {\n\t\t\tschema = schema.nonpositive({ message: `${field} must be non-positive` });\n\t\t}\n\t\tif (options?.isNegative) {\n\t\t\tschema = schema.negative({ message: `${field} must be negative` });\n\t\t}\n\t\tif (options?.isNonnegative) {\n\t\t\tschema = schema.nonnegative({ message: `${field} must be non-negative` });\n\t\t}\n\n\t\treturn schema;\n\t}\n\n\t/**\n\t * Creates a required string validation with a minimum length.\n\t * The string is also trimmed to remove leading/trailing whitespace.\n\t *\n\t * @param field - The name of the field to be included in the error message\n\t * @param minLength - Minimum required length (optional)\n\t * @param maxLength - Maximum required length (optional)\n\t * @param regex - Regular expression (optional)\n\t * @returns A Zod schema that validates strings with minimum length\n\t *\n\t * @example\n\t * ```typescript\n\t * const nameSchema = ZodValidation.String(\"Name\");\n\t * ```\n\t */\n\tstatic string(\n\t\tfield: string = 'Field',\n\t\toptions?: {\n\t\t\tminLength?: number;\n\t\t\tmaxLength?: number;\n\t\t\toptional?: boolean;\n\t\t\tnullable?: boolean;\n\t\t\tminMessage?: string;\n\t\t\tmaxMessage?: string;\n\t\t\trequiredMessage?: string;\n\t\t\tregex?: { pattern: RegExp; message: string }; // Add regex option\n\t\t}\n\t) {\n\t\tlet schema = z.string({\n\t\t\trequired_error: options?.requiredMessage || `${field} is required`,\n\t\t});\n\n\t\tif (options?.minLength) {\n\t\t\tschema = schema.min(\n\t\t\t\toptions.minLength,\n\t\t\t\toptions.minMessage || `${field} must be at least ${options.minLength} characters`\n\t\t\t);\n\t\t}\n\n\t\tif (options?.maxLength) {\n\t\t\tschema = schema.max(\n\t\t\t\toptions.maxLength,\n\t\t\t\toptions.maxMessage || `${field} shouldn’t exceed ${options.maxLength} characters`\n\t\t\t);\n\t\t}\n\n\t\t// Check for regex pattern and add regex validation\n\t\tif (options?.regex) {\n\t\t\tschema = schema.regex(options.regex.pattern, options.regex.message);\n\t\t}\n\n\t\tif (options?.nullable && options?.optional) {\n\t\t\treturn schema.nullish();\n\t\t}\n\t\tif (options?.nullable) {\n\t\t\treturn schema.nullable();\n\t\t}\n\t\tif (options?.optional) {\n\t\t\treturn schema.optional();\n\t\t}\n\n\t\treturn schema;\n\t}\n\n\t/**\n\t * Creates an email validation.\n\t * Validates that the string is a valid email address format.\n\t *\n\t * @param field - The name of the field to be included in the error message\n\t * @returns A Zod schema that validates email addresses\n\t *\n\t * @example\n\t * ```typescript\n\t * const emailSchema = ZodValidation.email(\"Please enter a valid email\");\n\t * ```\n\t */\n\tstatic email(\n\t\tfield: string = 'Email',\n\t\toptions?: {\n\t\t\trequiredMessage?: string;\n\t\t\tinvalidMessage?: string;\n\t\t\toptional?: boolean;\n\t\t\tnullable?: boolean;\n\t\t}\n\t) {\n\t\tconst schema = z\n\t\t\t.string({\n\t\t\t\trequired_error: options?.requiredMessage || `${field} is required`,\n\t\t\t})\n\t\t\t.email(options?.invalidMessage || `${field} must be a valid email address`);\n\n\t\tif (options?.nullable && options?.optional) {\n\t\t\treturn schema.nullish();\n\t\t}\n\t\tif (options?.nullable) {\n\t\t\treturn schema.nullable();\n\t\t}\n\t\tif (options?.optional) {\n\t\t\treturn schema.optional();\n\t\t}\n\t\treturn schema;\n\t}\n\n\t/**\n\t * Creates a URL validation.\n\t * Validates that the string is a valid URL format.\n\t *\n\t * @param field - The name of the field to be included in the error message\n\t * @returns A Zod schema that validates URLs\n\t *\n\t * @example\n\t * ```typescript\n\t * const websiteSchema = ZodValidation.url(\"Please enter a valid URL\");\n\t * ```\n\t */\n\tstatic url(field: string = 'Field') {\n\t\treturn z.string({ required_error: `${field} is required` }).url(`${field} must be a valid URL`);\n\t}\n\n\t/**\n\t * Creates a phone number validation schema using a regex pattern for global phone numbers.\n\t *\n\t * @param field - The name of the field to be included in the error message\n\t * @returns A Zod schema that validates phone numbers\n\t *\n\t * @example\n\t * ```typescript\n\t * const phoneSchema = ZodValidation.phoneNumber(\"Phone number\");\n\t * ```\n\t */\n\n\tstatic phoneNumber(field: string = 'Field') {\n\t\treturn z.string({ required_error: `${field} is required` }).refine(\n\t\t\tvalue => {\n\t\t\t\ttry {\n\t\t\t\t\tconst phone = parsePhoneNumberFromString(value);\n\t\t\t\t\treturn phone?.isValid();\n\t\t\t\t} catch {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\tmessage: `please input a valid phone number`,\n\t\t\t}\n\t\t);\n\t}\n\n\t/**\n\t * Creates a date validation.\n\t * Validates that the input is a JavaScript Date object.\n\t *@param field - The name of the field to be included in the error message\n\t *@param minDate - Minimum required date (optional)\n\t *@param maxDate - Maximum required date (optional)\n\t * @returns A Zod schema that validates Date objects\n\t *\n\t * @example\n\t * ```typescript\n\t * const createdAtSchema = ZodValidation.date();\n\t * ```\n\t */\n\tstatic date(field: string = 'Field', minDate?: Date, maxDate?: Date) {\n\t\treturn z\n\t\t\t.union(\n\t\t\t\t[\n\t\t\t\t\tz\n\t\t\t\t\t\t.string({ required_error: `${field} is required` })\n\t\t\t\t\t\t.refine(val => {\n\t\t\t\t\t\t\tconst date = new Date(val);\n\t\t\t\t\t\t\treturn !isNaN(date.getTime());\n\t\t\t\t\t\t}, `${field} must be a valid date`)\n\t\t\t\t\t\t.transform(val => new Date(val)),\n\t\t\t\t\tz.date({\n\t\t\t\t\t\trequired_error: `${field} is required`,\n\t\t\t\t\t\tinvalid_type_error: `${field} must be a valid date`,\n\t\t\t\t\t}),\n\t\t\t\t],\n\t\t\t\t{ message: `${field} is required` }\n\t\t\t)\n\t\t\t.refine(\n\t\t\t\tval => minDate === undefined || val >= minDate,\n\t\t\t\t`${field} must be on or after ${minDate?.toISOString()}`\n\t\t\t)\n\t\t\t.refine(\n\t\t\t\tval => maxDate === undefined || val <= maxDate,\n\t\t\t\t`${field} must be on or before ${maxDate?.toISOString()}`\n\t\t\t);\n\t}\n\n\t/**\n\t * Creates a boolean validation with an optional default value.\n\t *\n\t * @param field - The name of the field to be included in the error message\n\t * @returns A Zod schema that validates booleans\n\t *\n\t * @example\n\t * ```typescript\n\t * const isActiveSchema = ZodValidation.boolean(true); // Defaults to true\n\t * ```\n\t */\n\tstatic boolean(field: string = 'Field') {\n\t\treturn z.boolean({\n\t\t\trequired_error: `${field} is required`,\n\t\t\tinvalid_type_error: `${field} must be a boolean`,\n\t\t});\n\t}\n\n\t/**\n\t * Creates an array validation with optional minimum items constraint.\n\t *\n\t * @template T - Type of the schema for array items\n\t * @param schema - The schema for validating array items\n\t * @param field - The name of the field to be included in the error message\n\t * @param minItems - Minimum number of items required (optional)\n\t * @param maxItems - Maximum number of items required (optional)\n\t * @returns A Zod schema that validates arrays\n\t *\n\t * @example\n\t * ```typescript\n\t * const tagsSchema = ZodValidation.array(z.string(), \"At least one tag required\", 1);\n\t * ```\n\t */\n\tstatic array<T extends z.ZodTypeAny>(\n\t\tschema: T,\n\t\tfield: string = 'Array',\n\t\tminItems?: number,\n\t\tmaxItems?: number\n\t) {\n\t\tlet arraySchema = z.array(schema, {\n\t\t\trequired_error: `${field} is required`,\n\t\t});\n\n\t\tif (minItems === 1) {\n\t\t\tarraySchema = arraySchema.min(1, `${field} cannot be empty`);\n\t\t}\n\t\tif (minItems !== undefined && minItems !== 1) {\n\t\t\tarraySchema = arraySchema.min(minItems, `${field} must have at least ${minItems} items`);\n\t\t}\n\t\tif (maxItems !== undefined) {\n\t\t\tarraySchema = arraySchema.max(maxItems, `${field} must have at most ${maxItems} items`);\n\t\t}\n\n\t\treturn arraySchema;\n\t}\n\n\t/**\n\t * Standard timestamp fields for entities.\n\t * Includes createdAt, updatedAt, and deletedAt fields.\n\t *\n\t * @returns An object containing timestamp field schemas\n\t *\n\t * @example\n\t * ```typescript\n\t * const userSchema = z.object({\n\t * name: z.string(),\n\t * ...ZodValidation.timestamps()\n\t * });\n\t * ```\n\t */\n\tstatic timestamps() {\n\t\treturn {\n\t\t\tcreatedAt: z.date().nullable().optional(),\n\t\t\tupdatedAt: z.date().nullable().optional(),\n\t\t\tdeletedAt: z.date().nullable().optional(),\n\t\t};\n\t}\n\n\t/**\n\t * Common fields for tracking model metadata.\n\t * Includes timestamps and user tracking fields (createdBy, updatedBy, deletedBy).\n\t *\n\t * @returns An object containing tracking field schemas\n\t *\n\t * @example\n\t * ```typescript\n\t * const postSchema = z.object({\n\t * title: z.string(),\n\t * content: z.string(),\n\t * ...ZodValidation.trackingFields()\n\t * });\n\t * ```\n\t */\n\tstatic trackingFields() {\n\t\treturn {\n\t\t\tcreatedBy: ZodValidation.objectId().optional(),\n\t\t\tupdatedBy: ZodValidation.objectId().optional(),\n\t\t\tdeletedBy: ZodValidation.objectId().optional(),\n\t\t\t...ZodValidation.timestamps(),\n\t\t};\n\t}\n}\n\n/**\n * Represents the common fields to exclude from update operations.\n * This is used to specify which fields should not be updateable.\n *\n * @example\n * ```typescript\n * const excludeFields: ExcludeFromUpdate = {\n * createdAt: true,\n * createdBy: true,\n * status: true // Prevent status from being updated\n * };\n * ```\n */\nexport type ExcludeFromUpdate = {\n\tcreatedAt?: true;\n\tupdatedAt?: true;\n\tdeletedAt?: true;\n\tcreatedBy?: true;\n\t_id?: true;\n} & Record<string, true>;\n\n/**\n * Schema builder for creating consistent CRUD schemas.\n * Provides utility methods to generate schemas for create, read, update, and delete operations.\n *\n * @template T - Type of the base schema shape\n *\n * @example\n * ```typescript\n * const userBuilder = new SchemaBuilder({\n * name: z.string(),\n * email: z.string().email()\n * });\n *\n * const schemas = userBuilder.getAllSchemas();\n * ```\n */\nexport class SchemaBuilder<T extends z.ZodRawShape> {\n\tprivate baseSchema: z.ZodObject<T>;\n\n\t/**\n\t * Create a new schema builder\n\t *\n\t * @param baseFields - The base fields for the schema\n\t * @param includeTimestamps - Whether to include timestamp fields (default: true)\n\t * @param includeTracking - Whether to include tracking fields (createdBy, etc.) (default: false)\n\t *\n\t * @example\n\t * ```typescript\n\t * const userFields = {\n\t * name: ZodValidation.requiredString(),\n\t * email: ZodValidation.email()\n\t * };\n\t *\n\t * // With timestamps\n\t * const builder1 = new SchemaBuilder(userFields);\n\t *\n\t * // Without timestamps\n\t * const builder2 = new SchemaBuilder(userFields, false);\n\t *\n\t * // With tracking fields\n\t * const builder3 = new SchemaBuilder(userFields, true, true);\n\t * ```\n\t */\n\tconstructor(\n\t\tbaseFields: T,\n\t\tprivate includeTimestamps: boolean = true,\n\t\tprivate includeTracking: boolean = false\n\t) {\n\t\tthis.baseSchema = this.createBaseSchema(baseFields);\n\t}\n\n\t/**\n\t * Creates the base schema with optional timestamps and tracking fields.\n\t */\n\tprivate createBaseSchema(baseFields: T) {\n\t\tconst additionalFields = this.includeTracking\n\t\t\t? ZodValidation.trackingFields()\n\t\t\t: this.includeTimestamps\n\t\t\t\t? ZodValidation.timestamps()\n\t\t\t\t: {};\n\n\t\treturn z.object({\n\t\t\t...baseFields,\n\t\t\t...additionalFields,\n\t\t});\n\t}\n\n\t/**\n\t * Gets the base validation schema without ID.\n\t * Used for creating new entities.\n\t *\n\t * @returns The base schema for creating new entities\n\t *\n\t * @example\n\t * ```typescript\n\t * const createUserSchema = userBuilder.getBaseSchema();\n\t * ```\n\t */\n\tgetBaseSchema() {\n\t\treturn this.baseSchema.strict();\n\t}\n\n\t/**\n\t * Gets the schema for entities with ID.\n\t * Used for representing complete entities with their ID.\n\t *\n\t * @returns The entity schema including ID\n\t *\n\t * @example\n\t * ```typescript\n\t * const userSchema = userBuilder.getEntitySchema();\n\t * ```\n\t */\n\tgetEntitySchema() {\n\t\treturn this.baseSchema\n\t\t\t.extend({\n\t\t\t\t_id: ZodValidation.objectId(),\n\t\t\t})\n\t\t\t.partial()\n\t\t\t.passthrough();\n\t}\n\n\t/**\n\t * Gets the schema for validating an entity ID.\n\t * Used for validating ID parameters in requests.\n\t *\n\t * @returns The ID validation schema\n\t *\n\t * @example\n\t * ```typescript\n\t * const userIdSchema = userBuilder.getIdSchema();\n\t * ```\n\t */\n\tgetIdSchema() {\n\t\treturn ZodValidation.objectId();\n\t}\n\n\t/**\n\t * Gets the schema for updating an entity, excluding specified fields.\n\t * Creates a partial schema where all fields are optional, and removes\n\t * fields that should not be updatable.\n\t *\n\t * @param excludeFields - Fields to exclude from update operations\n\t * @returns The update schema with excluded fields removed\n\t *\n\t * @example\n\t * ```typescript\n\t * // Prevent updating createdAt and status\n\t * const updateUserSchema = userBuilder.getUpdateSchema({\n\t * createdAt: true,\n\t * status: true\n\t * });\n\t * ```\n\t */\n\tgetUpdateSchema(excludeFields: ExcludeFromUpdate = { createdAt: true, updatedAt: true }) {\n\t\tconst entitySchema = this.getEntitySchema();\n\n\t\t// Simple approach - just make everything optional\n\t\tif (Object.keys(excludeFields).length === 0) {\n\t\t\treturn entitySchema;\n\t\t}\n\n\t\t// For the type-safe approach, we need to create a new schema\n\t\t// without the excluded fields and then make it partial\n\n\t\t// Get all fields from the entity schema\n\t\tconst shape = entitySchema._def.shape();\n\n\t\t// Filter out the fields we want to exclude\n\t\tconst filteredShape: z.ZodRawShape = {};\n\t\tfor (const key in shape) {\n\t\t\tif (!excludeFields[key as keyof typeof excludeFields]) {\n\t\t\t\tfilteredShape[key] = shape[key];\n\t\t\t}\n\t\t}\n\n\t\t// Create a new schema with the filtered fields\n\t\treturn z.object(filteredShape).partial().strict();\n\t}\n\n\t/**\n\t * Gets the schema for validating a delete request.\n\t * Used for validating parameters in delete requests, including the entity ID and soft delete flag.\n\t *\n\t * @returns The delete validation schema\n\t *\n\t * @example\n\t * ```typescript\n\t * const deleteSchema = userBuilder.getDeleteSchema();\n\t * ```\n\t */\n\tgetDeleteSchema() {\n\t\treturn z.object({\n\t\t\t_id: ZodValidation.objectId('_id'),\n\t\t\tsoftDelete: ZodValidation.boolean('Soft Delete').default(true),\n\t\t});\n\t}\n\n\t/**\n\t * Creates an update schema by optionally extending the base schema with additional fields\n\t * and optionally omitting specified fields.\n\t *\n\t * @param extendFields - Optional fields to add to the schema (e.g., `_id`, `softDelete`).\n\t * @param omitFields - Optional fields to omit from the base schema (e.g., `name`).\n\t * @returns A new Zod schema for updates.\n\t */\n\tupdateBaseSchema(extendFields?: z.ZodRawShape, omitFields?: string[]) {\n\t\tlet schema: z.ZodObject<any> = this.baseSchema;\n\n\t\tif (omitFields && omitFields.length > 0) {\n\t\t\tschema = schema.omit(omitFields.reduce((acc, key) => ({ ...acc, [key]: true }), {}));\n\t\t}\n\n\t\tif (extendFields) {\n\t\t\tschema = schema.extend({ _id: ZodValidation.objectId().optional(), ...extendFields });\n\t\t}\n\n\t\treturn schema;\n\t}\n\n\t/**\n\t * Gets all common schemas for an entity.\n\t * Returns base, entity, ID, and update schemas in a single object.\n\t *\n\t * @param excludeFromUpdate - Fields to exclude from update operations\n\t * @returns Object containing all schemas\n\t *\n\t * @example\n\t * ```typescript\n\t * const {\n\t * BaseSchema, // For creating\n\t * EntitySchema, // For reading\n\t * IdSchema, // For validating IDs\n\t * UpdateSchema // For updating\n\t * } = userBuilder.getAllSchemas();\n\t * ```\n\t */\n\tgetAllSchemas(excludeFromUpdate?: ExcludeFromUpdate) {\n\t\treturn {\n\t\t\tBaseSchema: this.getBaseSchema(),\n\t\t\tEntitySchema: this.getEntitySchema(),\n\t\t\tIdSchema: this.getIdSchema(),\n\t\t\tUpdateSchema: this.getUpdateSchema(excludeFromUpdate),\n\t\t\tDeleteSchema: this.getDeleteSchema(),\n\t\t};\n\t}\n}\n\n/**\n * Type helper for creating DTO types from creation schemas.\n * Used to derive the type for creating new entities.\n *\n * @template T - The schema type\n *\n * @example\n * ```typescript\n * type CreateUserDTO = DTO<typeof UserValidationSchema>;\n * ```\n */\nexport type DTO<T extends z.ZodType> = z.infer<T>;\n\n/**\n * Creates a schema builder for an entity.\n * Helper function to create a new SchemaBuilder instance.\n *\n * @template T - Type of the base schema shape\n * @param baseFields - Base fields for the entity\n * @param includeTimestamps - Whether to include timestamp fields (default: true)\n * @param includeTracking - Whether to include tracking fields (default: false)\n * @returns A new SchemaBuilder instance\n *\n * @example\n * ```typescript\n * const userFields = {\n * name: ZodValidation.requiredString(),\n * email: ZodValidation.email()\n * };\n *\n * const userSchemaBuilder = createSchemaBuilder(userFields);\n * const userSchemaBuilder = createSchemaBuilder(userFields, true, true); // With tracking\n * ```\n */\nexport type PaginatedResponse<T> = {\n\tmetadata: {\n\t\tpage: number;\n\t\tsize: number;\n\t\ttotalElements: number;\n\t\ttotalPages: number;\n\t};\n\tdocuments: T[];\n};\n\nexport function createSchemaBuilder<T extends z.ZodRawShape>(\n\tbaseFields: T,\n\tincludeTimestamps: boolean = true,\n\tincludeTracking: boolean = false\n) {\n\treturn new SchemaBuilder(baseFields, includeTimestamps, includeTracking);\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/core",
3
- "version": "1.0.62",
3
+ "version": "1.0.64",
4
4
  "description": "The Core system of the Lyxa services.",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",
@@ -30,6 +30,7 @@
30
30
  "firebase-admin": "^13.0.1",
31
31
  "ioredis": "^5.4.1",
32
32
  "jsonwebtoken": "^9.0.2",
33
+ "libphonenumber-js": "^1.12.8",
33
34
  "mime-types": "^3.0.1",
34
35
  "moment": "^2.30.1",
35
36
  "mongoose": "^8.13.0",