@lyxa.ai/core 1.0.154 → 1.0.156

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.
Files changed (40) hide show
  1. package/dist/libraries/auth/index.d.ts +2 -1
  2. package/dist/libraries/auth/index.js +1 -0
  3. package/dist/libraries/auth/index.js.map +1 -1
  4. package/dist/libraries/map/providers/google-maps.js +9 -40
  5. package/dist/libraries/map/providers/google-maps.js.map +1 -1
  6. package/dist/libraries/mongo/models/index.d.ts +9 -0
  7. package/dist/libraries/mongo/models/index.js +10 -1
  8. package/dist/libraries/mongo/models/index.js.map +1 -1
  9. package/dist/libraries/mongo/models/rider.model.d.ts +2 -0
  10. package/dist/libraries/mongo/models/rider.model.js +12 -2
  11. package/dist/libraries/mongo/models/rider.model.js.map +1 -1
  12. package/dist/libraries/mongo/models/service-package.model.d.ts +8 -0
  13. package/dist/libraries/mongo/models/service-package.model.js +41 -1
  14. package/dist/libraries/mongo/models/service-package.model.js.map +1 -1
  15. package/dist/libraries/mongo/models/vendor-access-control.model.d.ts +13 -0
  16. package/dist/libraries/mongo/models/vendor-access-control.model.js +70 -0
  17. package/dist/libraries/mongo/models/vendor-access-control.model.js.map +1 -0
  18. package/dist/libraries/socket-manager/connection.store.d.ts +11 -0
  19. package/dist/libraries/socket-manager/connection.store.js +46 -0
  20. package/dist/libraries/socket-manager/connection.store.js.map +1 -0
  21. package/dist/libraries/socket-manager/index.d.ts +1 -0
  22. package/dist/libraries/socket-manager/index.js +18 -0
  23. package/dist/libraries/socket-manager/index.js.map +1 -0
  24. package/dist/libraries/socket-manager/socket-manager.service.d.ts +23 -0
  25. package/dist/libraries/socket-manager/socket-manager.service.js +94 -0
  26. package/dist/libraries/socket-manager/socket-manager.service.js.map +1 -0
  27. package/dist/libraries/trpc/context.d.ts +1 -0
  28. package/dist/libraries/trpc/context.js.map +1 -1
  29. package/dist/types/README.md +1 -1
  30. package/dist/types/package.json +1 -1
  31. package/dist/types/utilities/enum.d.ts +20 -9
  32. package/dist/types/utilities/enum.js +23 -10
  33. package/dist/types/utilities/enum.js.map +1 -1
  34. package/dist/utilities/connection.types.d.ts +9 -0
  35. package/dist/utilities/connection.types.js +3 -0
  36. package/dist/utilities/connection.types.js.map +1 -0
  37. package/dist/utilities/enum.d.ts +20 -9
  38. package/dist/utilities/enum.js +23 -10
  39. package/dist/utilities/enum.js.map +1 -1
  40. package/package.json +1 -1
@@ -6,7 +6,8 @@ export declare enum AuthEntityType {
6
6
  USER = "USER",
7
7
  SELLER = "SELLER",
8
8
  DELIVERY_BOY = "DELIVERY_BOY",
9
- CRM = "CRM"
9
+ CRM = "CRM",
10
+ VENDOR = "VENDOR"
10
11
  }
11
12
  export declare enum TokenType {
12
13
  ACCESS = "ACCESS",
@@ -26,6 +26,7 @@ var AuthEntityType;
26
26
  AuthEntityType["SELLER"] = "SELLER";
27
27
  AuthEntityType["DELIVERY_BOY"] = "DELIVERY_BOY";
28
28
  AuthEntityType["CRM"] = "CRM";
29
+ AuthEntityType["VENDOR"] = "VENDOR";
29
30
  })(AuthEntityType || (exports.AuthEntityType = AuthEntityType = {}));
30
31
  var TokenType;
31
32
  (function (TokenType) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/auth/index.ts"],"names":[],"mappings":";;;;;;AAkCA,oDAKC;AAKD,kEAGC;AAMD,0CA2BC;AAKD,oDAuDC;AAaD,8CAwBC;AAKD,oDA2BC;AAMD,sCAoCC;AAKD,gDAGC;AAKD,wDAGC;AAKD,sCA6BC;AAOD,gDA2EC;AA/XD,gEAA4D;AAE5D,mCAAqC;AACrC,iDAA8C;AAC9C,uCAA2C;AAC3C,oDAAyE;AAEzE,IAAY,cAKX;AALD,WAAY,cAAc;IACzB,+BAAa,CAAA;IACb,mCAAiB,CAAA;IACjB,+CAA6B,CAAA;IAC7B,6BAAW,CAAA;AACZ,CAAC,EALW,cAAc,8BAAd,cAAc,QAKzB;AAED,IAAY,SAGX;AA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C,YAAY;aACpC;SACD,CAAC;IACH,CAAC;IAED,MAAM,cAAc,GAAG,MAAM,eAAe,CAAC;QAC5C,EAAE,EAAE,WAAW,CAAC,QAAQ;QACxB,IAAI,EAAE,WAAW,CAAC,UAAU;QAC5B,UAAU,EAAE,WAAW,CAAC,QAAQ,IAAI,EAAE;KACtC,CAAC,CAAC;IAEH,OAAO;QACN,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,UAAU;QAClB,WAAW,EAAE,OAAO;QACpB,SAAS,EAAE;YACV,WAAW,EAAE,cAAc;YAC3B,YAAY,EAAE,IAAI;SAClB;KACD,CAAC;AACH,CAAC","sourcesContent":["import jwt, { SignOptions, JwtPayload } from 'jsonwebtoken';\nimport { EntityContext } from '../trpc/context';\nimport { randomBytes } from 'crypto';\nimport { RefreshToken } from './refreshtoken';\nimport { getLibraries } from '../../index';\nimport { getModelForClass, ReturnModelType } from '@typegoose/typegoose';\n\nexport enum AuthEntityType {\n\tUSER = 'USER',\n\tSELLER = 'SELLER',\n\tDELIVERY_BOY = 'DELIVERY_BOY',\n\tCRM = 'CRM',\n}\n\nexport enum TokenType {\n\tACCESS = 'ACCESS',\n\tREFRESH = 'REFRESH',\n}\n\nexport interface RefreshTokenRecord {\n\ttoken: string;\n\tentityId: string;\n\tentityType: AuthEntityType;\n\texpiresAt: Date;\n\tisRevoked: boolean;\n\tmetadata?: Record<string, unknown>;\n}\n\n// Global model for RefreshToken - will be set after initGlobalConnection()\nlet actualRefreshTokenModel: ReturnModelType<typeof RefreshToken> | null = null;\n\n/**\n * Get the RefreshToken model (throws if not initialized)\n */\nexport function getRefreshTokenModel(): ReturnModelType<typeof RefreshToken> {\n\tif (!actualRefreshTokenModel) {\n\t\tthrow new Error('RefreshToken model not initialized yet. Call initGlobalConnection() first.');\n\t}\n\treturn actualRefreshTokenModel;\n}\n\n/**\n * Initialize the RefreshToken model (called from initGlobalConnection)\n */\nexport function initializeRefreshTokenModel(globalConnection: any) {\n\tactualRefreshTokenModel = getModelForClass(RefreshToken, { existingConnection: globalConnection });\n\tconsole.log('✅ RefreshToken model initialized');\n}\n\n/**\n * Sign a JWT access token for the given entity (id + type).\n * It will fetch the secret for that entity type and create a token.\n */\nexport async function signAccessToken(\n\tentity: { id: string; type: AuthEntityType; parameters: Record<string, unknown> },\n\toptions?: SignOptions\n): Promise<string> {\n\tif (!entity?.type) {\n\t\tthrow new Error('Entity type is required to sign token');\n\t}\n\n\tconst secret = await getLibraries().getSecretsService().getKey(`${entity.type.toUpperCase()}_JWT_TOKEN`);\n\n\tif (!secret) {\n\t\tthrow new Error(`No secret found for entity type ${entity.type}`);\n\t}\n\n\tconst payload = {\n\t\tid: entity.id,\n\t\ttype: entity.type,\n\t\tparameters: entity.parameters,\n\t\ttokenType: TokenType.ACCESS,\n\t};\n\n\tconst tokenOptions: SignOptions = {\n\t\t...options,\n\t\texpiresIn: options?.expiresIn || '1d',\n\t};\n\n\treturn jwt.sign(payload, secret, tokenOptions);\n}\n\n/**\n * Generate a refresh token for the given entity\n */\nexport async function generateRefreshToken(\n\tentity: { id: string; type: AuthEntityType; parameters?: Record<string, unknown> },\n\toptions?: { expiresIn?: string | number }\n): Promise<string> {\n\tconst tokenValue = randomBytes(40).toString('hex');\n\n\tconst expiresIn = options?.expiresIn || '7d';\n\tconst expiresAt = new Date();\n\n\tif (typeof expiresIn === 'string') {\n\t\t// Parse duration strings like '7d', '30d', etc.\n\t\tconst match = expiresIn.match(/^(\\d+)([smhdwy])$/);\n\t\tif (match) {\n\t\t\tconst value = parseInt(match[1]);\n\t\t\tconst unit = match[2];\n\n\t\t\tswitch (unit) {\n\t\t\t\tcase 's':\n\t\t\t\t\texpiresAt.setSeconds(expiresAt.getSeconds() + value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'm':\n\t\t\t\t\texpiresAt.setMinutes(expiresAt.getMinutes() + value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'h':\n\t\t\t\t\texpiresAt.setHours(expiresAt.getHours() + value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'd':\n\t\t\t\t\texpiresAt.setDate(expiresAt.getDate() + value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'w':\n\t\t\t\t\texpiresAt.setDate(expiresAt.getDate() + value * 7);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'y':\n\t\t\t\t\texpiresAt.setFullYear(expiresAt.getFullYear() + value);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\t// Default to 7 days if format is invalid\n\t\t\texpiresAt.setDate(expiresAt.getDate() + 7);\n\t\t}\n\t} else if (typeof expiresIn === 'number') {\n\t\t// Interpret number as seconds\n\t\texpiresAt.setSeconds(expiresAt.getSeconds() + expiresIn);\n\t}\n\n\tawait storeRefreshToken({\n\t\ttoken: tokenValue,\n\t\tentityId: entity.id,\n\t\tentityType: entity.type,\n\t\texpiresAt,\n\t\tisRevoked: false,\n\t\tmetadata: entity.parameters,\n\t});\n\n\treturn tokenValue;\n}\n\n/**\n * Store a refresh token in the database\n */\nasync function storeRefreshToken(tokenRecord: RefreshTokenRecord): Promise<void> {\n\tconst tokenRepository = getLibraries().getAuthTokenRepository();\n\tawait tokenRepository.saveRefreshToken(tokenRecord);\n}\n\n/**\n * Verify an access token for the given entity types\n */\nexport async function verifyAccessToken(\n\tentityTypes: AuthEntityType[],\n\ttoken: string\n): Promise<EntityContext | undefined> {\n\tfor (const entityType of entityTypes) {\n\t\tconst secret = await getLibraries()\n\t\t\t.getSecretsService()\n\t\t\t.getKey(entityType.toUpperCase() + '_JWT_TOKEN');\n\n\t\ttry {\n\t\t\tconst decoded = jwt.verify(token, secret!) as EntityContext & { tokenType?: TokenType };\n\n\t\t\t// Verify this is an access token\n\t\t\tif (decoded.tokenType !== TokenType.ACCESS) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\treturn decoded;\n\t\t} catch (err) {\n\t\t\t// Continue to the next entity type\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Validate a refresh token and return the associated entity\n */\nexport async function validateRefreshToken(token: string): Promise<{\n\tvalid: boolean;\n\tentity?: { id: string; type: AuthEntityType; parameters?: Record<string, unknown> };\n}> {\n\tconst tokenRepository = getLibraries().getAuthTokenRepository();\n\tconst storedToken = await tokenRepository.findRefreshToken(token);\n\n\tif (!storedToken) {\n\t\treturn { valid: false };\n\t}\n\n\tif (storedToken.expiresAt && new Date() > storedToken.expiresAt) {\n\t\treturn { valid: false };\n\t}\n\n\tif (storedToken.isRevoked) {\n\t\treturn { valid: false };\n\t}\n\n\treturn {\n\t\tvalid: true,\n\t\tentity: {\n\t\t\tid: storedToken.entityId,\n\t\t\ttype: storedToken.entityType,\n\t\t\tparameters: storedToken.metadata,\n\t\t},\n\t};\n}\n\n/**\n * Refresh authentication tokens\n * Returns new access and refresh tokens\n */\nexport async function refreshTokens(refreshToken: string): Promise<{\n\taccessToken: string;\n\trefreshToken: string;\n\tentity: { id: string; type: AuthEntityType };\n} | null> {\n\t// Validate the refresh token\n\tconst validation = await validateRefreshToken(refreshToken);\n\n\tif (!validation.valid || !validation.entity) {\n\t\treturn null;\n\t}\n\n\tawait revokeRefreshToken(refreshToken);\n\n\t// Create new tokens\n\tconst entity = validation.entity;\n\tconst newAccessToken = await signAccessToken({\n\t\tid: entity.id,\n\t\ttype: entity.type,\n\t\tparameters: entity.parameters || {},\n\t});\n\n\tconst newRefreshToken = await generateRefreshToken({\n\t\tid: entity.id,\n\t\ttype: entity.type,\n\t\tparameters: entity.parameters,\n\t});\n\n\treturn {\n\t\taccessToken: newAccessToken,\n\t\trefreshToken: newRefreshToken,\n\t\tentity: {\n\t\t\tid: entity.id,\n\t\t\ttype: entity.type,\n\t\t},\n\t};\n}\n\n/**\n * Revoke a refresh token\n */\nexport async function revokeRefreshToken(token: string): Promise<boolean> {\n\tconst tokenRepository = getLibraries().getAuthTokenRepository();\n\treturn tokenRepository.revokeRefreshToken(token);\n}\n\n/**\n * Revoke all refresh tokens for a specific entity\n */\nexport async function revokeAllRefreshTokens(entityId: string, entityType: AuthEntityType): Promise<boolean> {\n\tconst tokenRepository = getLibraries().getAuthTokenRepository();\n\treturn tokenRepository.revokeAllRefreshTokensForEntity(entityId, entityType);\n}\n\n/**\n * Sign both access and refresh tokens - utility for initial login/authentication\n */\nexport async function signTokenPair(\n\tentity: { id: string; type: AuthEntityType; parameters?: Record<string, unknown> },\n\toptions?: { accessTokenOptions?: SignOptions; refreshTokenExpiresIn?: string | number }\n): Promise<{\n\taccessToken: string;\n\trefreshToken: string;\n}> {\n\tconst accessToken = await signAccessToken(\n\t\t{\n\t\t\tid: entity.id,\n\t\t\ttype: entity.type,\n\t\t\tparameters: entity.parameters || {},\n\t\t},\n\t\toptions?.accessTokenOptions\n\t);\n\n\tconst refreshToken = await generateRefreshToken(\n\t\t{\n\t\t\tid: entity.id,\n\t\t\ttype: entity.type,\n\t\t\tparameters: entity.parameters,\n\t\t},\n\t\t{ expiresIn: options?.refreshTokenExpiresIn }\n\t);\n\n\treturn {\n\t\taccessToken,\n\t\trefreshToken,\n\t};\n}\n\n/**\n * Handle the refresh token validation and renewal logic\n * @param refreshToken The refresh token to validate or renew\n * @returns Result object with token status and renewal information\n */\nexport async function handleTokenRenewal(refreshToken: string): Promise<{\n\tsuccess: boolean;\n\tentity?: {\n\t\tid: string;\n\t\ttype: AuthEntityType;\n\t\tparameters: Record<string, unknown>;\n\t};\n\ttokenStatus: 'valid' | 'expired' | 'revoked' | 'invalid';\n\tnewTokens?: {\n\t\taccessToken: string;\n\t\trefreshToken?: string | null;\n\t};\n}> {\n\tconst tokenRepository = getLibraries().getAuthTokenRepository();\n\n\tconst storedToken = await tokenRepository.findRefreshToken(refreshToken);\n\n\tif (!storedToken) {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\ttokenStatus: 'invalid',\n\t\t};\n\t}\n\n\tconst isRevoked = storedToken.isRevoked;\n\tif (isRevoked) {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\ttokenStatus: 'revoked',\n\t\t};\n\t}\n\n\tconst isExpired = storedToken.isExpired();\n\n\tconst entityData = {\n\t\tid: storedToken.entityId,\n\t\ttype: storedToken.entityType,\n\t\tparameters: storedToken.metadata || {},\n\t};\n\n\tif (isExpired) {\n\t\tconst newTokens = await signTokenPair({\n\t\t\tid: storedToken.entityId,\n\t\t\ttype: storedToken.entityType,\n\t\t\tparameters: storedToken.metadata || {},\n\t\t});\n\n\t\tawait tokenRepository.revokeRefreshToken(refreshToken);\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tentity: entityData,\n\t\t\ttokenStatus: 'expired',\n\t\t\tnewTokens: {\n\t\t\t\taccessToken: newTokens.accessToken,\n\t\t\t\trefreshToken: newTokens.refreshToken,\n\t\t\t},\n\t\t};\n\t}\n\n\tconst newAccessToken = await signAccessToken({\n\t\tid: storedToken.entityId,\n\t\ttype: storedToken.entityType,\n\t\tparameters: storedToken.metadata || {},\n\t});\n\n\treturn {\n\t\tsuccess: true,\n\t\tentity: entityData,\n\t\ttokenStatus: 'valid',\n\t\tnewTokens: {\n\t\t\taccessToken: newAccessToken,\n\t\t\trefreshToken: null,\n\t\t},\n\t};\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/auth/index.ts"],"names":[],"mappings":";;;;;;AAmCA,oDAKC;AAKD,kEAGC;AAMD,0CA2BC;AAKD,oDAuDC;AAaD,8CAwBC;AAKD,oDA2BC;AAMD,sCAoCC;AAKD,gDAGC;AAKD,wDAGC;AAKD,sCA6BC;AAOD,gDA2EC;AAhYD,gEAA4D;AAE5D,mCAAqC;AACrC,iDAA8C;AAC9C,uCAA2C;AAC3C,oDAAyE;AAEzE,IAAY,cAMX;AAND,WAAY,cAAc;IACzB,+BAAa,CAAA;IACb,mCAAiB,CAAA;IACjB,+CAA6B,CAAA;IAC7B,6BAAW,CAAA;IACX,mCAAiB,CAAA;AAClB,CAAC,EANW,cAAc,8BAAd,cAAc,QAMzB;AAED,IAAY,SAGX;AAHD,WA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Y;aACpC;SACD,CAAC;IACH,CAAC;IAED,MAAM,cAAc,GAAG,MAAM,eAAe,CAAC;QAC5C,EAAE,EAAE,WAAW,CAAC,QAAQ;QACxB,IAAI,EAAE,WAAW,CAAC,UAAU;QAC5B,UAAU,EAAE,WAAW,CAAC,QAAQ,IAAI,EAAE;KACtC,CAAC,CAAC;IAEH,OAAO;QACN,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,UAAU;QAClB,WAAW,EAAE,OAAO;QACpB,SAAS,EAAE;YACV,WAAW,EAAE,cAAc;YAC3B,YAAY,EAAE,IAAI;SAClB;KACD,CAAC;AACH,CAAC","sourcesContent":["import jwt, { SignOptions, JwtPayload } from 'jsonwebtoken';\nimport { EntityContext } from '../trpc/context';\nimport { randomBytes } from 'crypto';\nimport { RefreshToken } from './refreshtoken';\nimport { getLibraries } from '../../index';\nimport { getModelForClass, ReturnModelType } from '@typegoose/typegoose';\n\nexport enum AuthEntityType {\n\tUSER = 'USER',\n\tSELLER = 'SELLER',\n\tDELIVERY_BOY = 'DELIVERY_BOY',\n\tCRM = 'CRM',\n\tVENDOR = 'VENDOR'\n}\n\nexport enum TokenType {\n\tACCESS = 'ACCESS',\n\tREFRESH = 'REFRESH',\n}\n\nexport interface RefreshTokenRecord {\n\ttoken: string;\n\tentityId: string;\n\tentityType: AuthEntityType;\n\texpiresAt: Date;\n\tisRevoked: boolean;\n\tmetadata?: Record<string, unknown>;\n}\n\n// Global model for RefreshToken - will be set after initGlobalConnection()\nlet actualRefreshTokenModel: ReturnModelType<typeof RefreshToken> | null = null;\n\n/**\n * Get the RefreshToken model (throws if not initialized)\n */\nexport function getRefreshTokenModel(): ReturnModelType<typeof RefreshToken> {\n\tif (!actualRefreshTokenModel) {\n\t\tthrow new Error('RefreshToken model not initialized yet. Call initGlobalConnection() first.');\n\t}\n\treturn actualRefreshTokenModel;\n}\n\n/**\n * Initialize the RefreshToken model (called from initGlobalConnection)\n */\nexport function initializeRefreshTokenModel(globalConnection: any) {\n\tactualRefreshTokenModel = getModelForClass(RefreshToken, { existingConnection: globalConnection });\n\tconsole.log('✅ RefreshToken model initialized');\n}\n\n/**\n * Sign a JWT access token for the given entity (id + type).\n * It will fetch the secret for that entity type and create a token.\n */\nexport async function signAccessToken(\n\tentity: { id: string; type: AuthEntityType; parameters: Record<string, unknown> },\n\toptions?: SignOptions\n): Promise<string> {\n\tif (!entity?.type) {\n\t\tthrow new Error('Entity type is required to sign token');\n\t}\n\n\tconst secret = await getLibraries().getSecretsService().getKey(`${entity.type.toUpperCase()}_JWT_TOKEN`);\n\n\tif (!secret) {\n\t\tthrow new Error(`No secret found for entity type ${entity.type}`);\n\t}\n\n\tconst payload = {\n\t\tid: entity.id,\n\t\ttype: entity.type,\n\t\tparameters: entity.parameters,\n\t\ttokenType: TokenType.ACCESS,\n\t};\n\n\tconst tokenOptions: SignOptions = {\n\t\t...options,\n\t\texpiresIn: options?.expiresIn || '1d',\n\t};\n\n\treturn jwt.sign(payload, secret, tokenOptions);\n}\n\n/**\n * Generate a refresh token for the given entity\n */\nexport async function generateRefreshToken(\n\tentity: { id: string; type: AuthEntityType; parameters?: Record<string, unknown> },\n\toptions?: { expiresIn?: string | number }\n): Promise<string> {\n\tconst tokenValue = randomBytes(40).toString('hex');\n\n\tconst expiresIn = options?.expiresIn || '7d';\n\tconst expiresAt = new Date();\n\n\tif (typeof expiresIn === 'string') {\n\t\t// Parse duration strings like '7d', '30d', etc.\n\t\tconst match = expiresIn.match(/^(\\d+)([smhdwy])$/);\n\t\tif (match) {\n\t\t\tconst value = parseInt(match[1]);\n\t\t\tconst unit = match[2];\n\n\t\t\tswitch (unit) {\n\t\t\t\tcase 's':\n\t\t\t\t\texpiresAt.setSeconds(expiresAt.getSeconds() + value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'm':\n\t\t\t\t\texpiresAt.setMinutes(expiresAt.getMinutes() + value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'h':\n\t\t\t\t\texpiresAt.setHours(expiresAt.getHours() + value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'd':\n\t\t\t\t\texpiresAt.setDate(expiresAt.getDate() + value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'w':\n\t\t\t\t\texpiresAt.setDate(expiresAt.getDate() + value * 7);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'y':\n\t\t\t\t\texpiresAt.setFullYear(expiresAt.getFullYear() + value);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\t// Default to 7 days if format is invalid\n\t\t\texpiresAt.setDate(expiresAt.getDate() + 7);\n\t\t}\n\t} else if (typeof expiresIn === 'number') {\n\t\t// Interpret number as seconds\n\t\texpiresAt.setSeconds(expiresAt.getSeconds() + expiresIn);\n\t}\n\n\tawait storeRefreshToken({\n\t\ttoken: tokenValue,\n\t\tentityId: entity.id,\n\t\tentityType: entity.type,\n\t\texpiresAt,\n\t\tisRevoked: false,\n\t\tmetadata: entity.parameters,\n\t});\n\n\treturn tokenValue;\n}\n\n/**\n * Store a refresh token in the database\n */\nasync function storeRefreshToken(tokenRecord: RefreshTokenRecord): Promise<void> {\n\tconst tokenRepository = getLibraries().getAuthTokenRepository();\n\tawait tokenRepository.saveRefreshToken(tokenRecord);\n}\n\n/**\n * Verify an access token for the given entity types\n */\nexport async function verifyAccessToken(\n\tentityTypes: AuthEntityType[],\n\ttoken: string\n): Promise<EntityContext | undefined> {\n\tfor (const entityType of entityTypes) {\n\t\tconst secret = await getLibraries()\n\t\t\t.getSecretsService()\n\t\t\t.getKey(entityType.toUpperCase() + '_JWT_TOKEN');\n\n\t\ttry {\n\t\t\tconst decoded = jwt.verify(token, secret!) as EntityContext & { tokenType?: TokenType };\n\n\t\t\t// Verify this is an access token\n\t\t\tif (decoded.tokenType !== TokenType.ACCESS) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\treturn decoded;\n\t\t} catch (err) {\n\t\t\t// Continue to the next entity type\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Validate a refresh token and return the associated entity\n */\nexport async function validateRefreshToken(token: string): Promise<{\n\tvalid: boolean;\n\tentity?: { id: string; type: AuthEntityType; parameters?: Record<string, unknown> };\n}> {\n\tconst tokenRepository = getLibraries().getAuthTokenRepository();\n\tconst storedToken = await tokenRepository.findRefreshToken(token);\n\n\tif (!storedToken) {\n\t\treturn { valid: false };\n\t}\n\n\tif (storedToken.expiresAt && new Date() > storedToken.expiresAt) {\n\t\treturn { valid: false };\n\t}\n\n\tif (storedToken.isRevoked) {\n\t\treturn { valid: false };\n\t}\n\n\treturn {\n\t\tvalid: true,\n\t\tentity: {\n\t\t\tid: storedToken.entityId,\n\t\t\ttype: storedToken.entityType,\n\t\t\tparameters: storedToken.metadata,\n\t\t},\n\t};\n}\n\n/**\n * Refresh authentication tokens\n * Returns new access and refresh tokens\n */\nexport async function refreshTokens(refreshToken: string): Promise<{\n\taccessToken: string;\n\trefreshToken: string;\n\tentity: { id: string; type: AuthEntityType };\n} | null> {\n\t// Validate the refresh token\n\tconst validation = await validateRefreshToken(refreshToken);\n\n\tif (!validation.valid || !validation.entity) {\n\t\treturn null;\n\t}\n\n\tawait revokeRefreshToken(refreshToken);\n\n\t// Create new tokens\n\tconst entity = validation.entity;\n\tconst newAccessToken = await signAccessToken({\n\t\tid: entity.id,\n\t\ttype: entity.type,\n\t\tparameters: entity.parameters || {},\n\t});\n\n\tconst newRefreshToken = await generateRefreshToken({\n\t\tid: entity.id,\n\t\ttype: entity.type,\n\t\tparameters: entity.parameters,\n\t});\n\n\treturn {\n\t\taccessToken: newAccessToken,\n\t\trefreshToken: newRefreshToken,\n\t\tentity: {\n\t\t\tid: entity.id,\n\t\t\ttype: entity.type,\n\t\t},\n\t};\n}\n\n/**\n * Revoke a refresh token\n */\nexport async function revokeRefreshToken(token: string): Promise<boolean> {\n\tconst tokenRepository = getLibraries().getAuthTokenRepository();\n\treturn tokenRepository.revokeRefreshToken(token);\n}\n\n/**\n * Revoke all refresh tokens for a specific entity\n */\nexport async function revokeAllRefreshTokens(entityId: string, entityType: AuthEntityType): Promise<boolean> {\n\tconst tokenRepository = getLibraries().getAuthTokenRepository();\n\treturn tokenRepository.revokeAllRefreshTokensForEntity(entityId, entityType);\n}\n\n/**\n * Sign both access and refresh tokens - utility for initial login/authentication\n */\nexport async function signTokenPair(\n\tentity: { id: string; type: AuthEntityType; parameters?: Record<string, unknown> },\n\toptions?: { accessTokenOptions?: SignOptions; refreshTokenExpiresIn?: string | number }\n): Promise<{\n\taccessToken: string;\n\trefreshToken: string;\n}> {\n\tconst accessToken = await signAccessToken(\n\t\t{\n\t\t\tid: entity.id,\n\t\t\ttype: entity.type,\n\t\t\tparameters: entity.parameters || {},\n\t\t},\n\t\toptions?.accessTokenOptions\n\t);\n\n\tconst refreshToken = await generateRefreshToken(\n\t\t{\n\t\t\tid: entity.id,\n\t\t\ttype: entity.type,\n\t\t\tparameters: entity.parameters,\n\t\t},\n\t\t{ expiresIn: options?.refreshTokenExpiresIn }\n\t);\n\n\treturn {\n\t\taccessToken,\n\t\trefreshToken,\n\t};\n}\n\n/**\n * Handle the refresh token validation and renewal logic\n * @param refreshToken The refresh token to validate or renew\n * @returns Result object with token status and renewal information\n */\nexport async function handleTokenRenewal(refreshToken: string): Promise<{\n\tsuccess: boolean;\n\tentity?: {\n\t\tid: string;\n\t\ttype: AuthEntityType;\n\t\tparameters: Record<string, unknown>;\n\t};\n\ttokenStatus: 'valid' | 'expired' | 'revoked' | 'invalid';\n\tnewTokens?: {\n\t\taccessToken: string;\n\t\trefreshToken?: string | null;\n\t};\n}> {\n\tconst tokenRepository = getLibraries().getAuthTokenRepository();\n\n\tconst storedToken = await tokenRepository.findRefreshToken(refreshToken);\n\n\tif (!storedToken) {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\ttokenStatus: 'invalid',\n\t\t};\n\t}\n\n\tconst isRevoked = storedToken.isRevoked;\n\tif (isRevoked) {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\ttokenStatus: 'revoked',\n\t\t};\n\t}\n\n\tconst isExpired = storedToken.isExpired();\n\n\tconst entityData = {\n\t\tid: storedToken.entityId,\n\t\ttype: storedToken.entityType,\n\t\tparameters: storedToken.metadata || {},\n\t};\n\n\tif (isExpired) {\n\t\tconst newTokens = await signTokenPair({\n\t\t\tid: storedToken.entityId,\n\t\t\ttype: storedToken.entityType,\n\t\t\tparameters: storedToken.metadata || {},\n\t\t});\n\n\t\tawait tokenRepository.revokeRefreshToken(refreshToken);\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tentity: entityData,\n\t\t\ttokenStatus: 'expired',\n\t\t\tnewTokens: {\n\t\t\t\taccessToken: newTokens.accessToken,\n\t\t\t\trefreshToken: newTokens.refreshToken,\n\t\t\t},\n\t\t};\n\t}\n\n\tconst newAccessToken = await signAccessToken({\n\t\tid: storedToken.entityId,\n\t\ttype: storedToken.entityType,\n\t\tparameters: storedToken.metadata || {},\n\t});\n\n\treturn {\n\t\tsuccess: true,\n\t\tentity: entityData,\n\t\ttokenStatus: 'valid',\n\t\tnewTokens: {\n\t\t\taccessToken: newAccessToken,\n\t\t\trefreshToken: null,\n\t\t},\n\t};\n}\n"]}
@@ -39,6 +39,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.GoogleMapsService = void 0;
40
40
  const axios_1 = __importDefault(require("axios"));
41
41
  const polyline = __importStar(require("@mapbox/polyline"));
42
+ const server_1 = require("@trpc/server");
42
43
  class GoogleMapsService {
43
44
  _apiKey;
44
45
  constructor(apiKey) {
@@ -55,16 +56,10 @@ class GoogleMapsService {
55
56
  }
56
57
  catch (error) {
57
58
  console.error(`Error in getDistanceInfo: ${error}`);
58
- return {
59
- distance: {
60
- text: '',
61
- value: 0,
62
- },
63
- duration: {
64
- text: '',
65
- value: 0,
66
- },
67
- };
59
+ throw new server_1.TRPCError({
60
+ code: 'INTERNAL_SERVER_ERROR',
61
+ message: 'Failed to fetch distance information from Google Maps API.',
62
+ });
68
63
  }
69
64
  }
70
65
  async getWaypointsDistanceInfo(origin, destination, waypoints) {
@@ -96,36 +91,10 @@ class GoogleMapsService {
96
91
  }
97
92
  catch (error) {
98
93
  console.error(`Error in getWaypointsDistanceInfo: ${error}`);
99
- return {
100
- distance: {
101
- text: '',
102
- value: 0,
103
- },
104
- duration: {
105
- text: '',
106
- value: 0,
107
- },
108
- legs: [
109
- {
110
- distance: {
111
- text: '',
112
- value: 0,
113
- },
114
- duration: {
115
- text: '',
116
- value: 0,
117
- },
118
- overviewPolyline: [
119
- [0, 0],
120
- [1, 1],
121
- ],
122
- },
123
- ],
124
- overviewPolyline: [
125
- [0, 0],
126
- [1, 1],
127
- ],
128
- };
94
+ throw new server_1.TRPCError({
95
+ code: 'INTERNAL_SERVER_ERROR',
96
+ message: 'Failed to fetch waypoint distance information from Google Maps API.',
97
+ });
129
98
  }
130
99
  }
131
100
  }
@@ -1 +1 @@
1
- {"version":3,"file":"google-maps.js","sourceRoot":"/","sources":["libraries/map/providers/google-maps.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAU1B,2DAA6C;AAE7C,MAAa,iBAAiB;IACrB,OAAO,CAAqB;IAEpC,YAAY,MAAc;QACzB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACvB,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,MAAmB,EAAE,WAAwB;QACzE,IAAI,CAAC;YACJ,MAAM,GAAG,GAAG,+DAA+D,MAAM,CAAC,QAAQ,KAAK,MAAM,CAAC,SAAS,gBAAgB,WAAW,CAAC,QAAQ,KAAK,WAAW,CAAC,SAAS,QAAQ,IAAI,CAAC,OAAO,eAAe,CAAC;YAEjN,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,eAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAEtC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAA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,EAAE;oBACR,KAAK,EAAE,CAAC;iBACR;gBACD,IAAI,EAAE;oBACL;wBACC,QAAQ,EAAE;4BACT,IAAI,EAAE,EAAE;4BACR,KAAK,EAAE,CAAC;yBACR;wBACD,QAAQ,EAAE;4BACT,IAAI,EAAE,EAAE;4BACR,KAAK,EAAE,CAAC;yBACR;wBACD,gBAAgB,EAAE;4BACjB,CAAC,CAAC,EAAE,CAAC,CAAC;4BACN,CAAC,CAAC,EAAE,CAAC,CAAC;yBACN;qBACD;iBACD;gBACD,gBAAgB,EAAE;oBACjB,CAAC,CAAC,EAAE,CAAC,CAAC;oBACN,CAAC,CAAC,EAAE,CAAC,CAAC;iBACN;aACD,CAAC;QACH,CAAC;IACF,CAAC;CACD;AAjHD,8CAiHC","sourcesContent":["import axios from 'axios';\nimport {\n\tIMapService,\n\tICoordinate,\n\tIDistance,\n\tIDuration,\n\tILeg,\n\tIDistanceInfo,\n\tIWaypointDistanceInfo,\n} from '../interfaces/IMapService';\nimport * as polyline from '@mapbox/polyline';\n\nexport class GoogleMapsService implements IMapService {\n\tprivate _apiKey: string | undefined;\n\n\tconstructor(apiKey: string) {\n\t\tthis._apiKey = apiKey;\n\t}\n\n\tpublic async getDistanceInfo(origin: ICoordinate, destination: ICoordinate): Promise<IDistanceInfo> {\n\t\ttry {\n\t\t\tconst url = `https://maps.googleapis.com/maps/api/directions/json?origin=${origin.latitude}, ${origin.longitude}&destination=${destination.latitude}, ${destination.longitude}&key=${this._apiKey}&mode=DRIVING`;\n\n\t\t\tconst { data } = await axios.get(url);\n\n\t\t\tconst legs = data.routes[0].legs[0];\n\n\t\t\tconst distance = legs.distance;\n\t\t\tconst duration = legs.duration;\n\n\t\t\treturn { distance, duration };\n\t\t} catch (error) {\n\t\t\tconsole.error(`Error in getDistanceInfo: ${error}`);\n\t\t\treturn {\n\t\t\t\tdistance: {\n\t\t\t\t\ttext: '',\n\t\t\t\t\tvalue: 0,\n\t\t\t\t},\n\t\t\t\tduration: {\n\t\t\t\t\ttext: '',\n\t\t\t\t\tvalue: 0,\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t}\n\n\tpublic async getWaypointsDistanceInfo(\n\t\torigin: ICoordinate,\n\t\tdestination: ICoordinate,\n\t\twaypoints: Array<ICoordinate>\n\t): Promise<IWaypointDistanceInfo> {\n\t\ttry {\n\t\t\tconst waypointsStr = waypoints.map(point => `${point.latitude},${point.longitude}`).join('|');\n\n\t\t\tconst url = `https://maps.googleapis.com/maps/api/directions/json?origin=${origin.latitude},${origin.longitude}&destination=${destination.latitude},${destination.longitude}&waypoints=${waypointsStr}&key=${this._apiKey}&mode=DRIVING`;\n\n\t\t\tconst { data } = await axios.get(url);\n\n\t\t\tconst routes = data.routes[0];\n\n\t\t\tconst overviewPolyline = polyline.decode(routes.overview_polyline.points);\n\n\t\t\tconst legs = routes.legs.map((leg: { steps: any[]; distance: any; duration: any }) => {\n\t\t\t\tconst overviewPolyline = leg?.steps?.flatMap(step => polyline.decode(step?.polyline?.points));\n\n\t\t\t\treturn {\n\t\t\t\t\tdistance: leg.distance,\n\t\t\t\t\tduration: leg.duration,\n\t\t\t\t\toverviewPolyline,\n\t\t\t\t};\n\t\t\t});\n\n\t\t\tconst totalDistance = legs.reduce(\n\t\t\t\t(acc: any, curr: { distance: { value: any } }) => acc + curr.distance.value,\n\t\t\t\t0\n\t\t\t);\n\t\t\tconst distance = {\n\t\t\t\ttext: `${(totalDistance / 1000).toFixed(2)} km`,\n\t\t\t\tvalue: totalDistance,\n\t\t\t};\n\n\t\t\tconst totalDuration = legs.reduce(\n\t\t\t\t(acc: any, curr: { duration: { value: any } }) => acc + curr.duration.value,\n\t\t\t\t0\n\t\t\t);\n\t\t\tconst duration = {\n\t\t\t\ttext: `${Math.round(totalDuration / 60)} mins`,\n\t\t\t\tvalue: totalDuration,\n\t\t\t};\n\n\t\t\treturn { distance, duration, legs, overviewPolyline };\n\t\t} catch (error) {\n\t\t\tconsole.error(`Error in getWaypointsDistanceInfo: ${error}`);\n\t\t\treturn {\n\t\t\t\tdistance: {\n\t\t\t\t\ttext: '',\n\t\t\t\t\tvalue: 0,\n\t\t\t\t},\n\t\t\t\tduration: {\n\t\t\t\t\ttext: '',\n\t\t\t\t\tvalue: 0,\n\t\t\t\t},\n\t\t\t\tlegs: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdistance: {\n\t\t\t\t\t\t\ttext: '',\n\t\t\t\t\t\t\tvalue: 0,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tduration: {\n\t\t\t\t\t\t\ttext: '',\n\t\t\t\t\t\t\tvalue: 0,\n\t\t\t\t\t\t},\n\t\t\t\t\t\toverviewPolyline: [\n\t\t\t\t\t\t\t[0, 0],\n\t\t\t\t\t\t\t[1, 1],\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\toverviewPolyline: [\n\t\t\t\t\t[0, 0],\n\t\t\t\t\t[1, 1],\n\t\t\t\t],\n\t\t\t};\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"google-maps.js","sourceRoot":"/","sources":["libraries/map/providers/google-maps.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAU1B,2DAA6C;AAC7C,yCAAyC;AAEzC,MAAa,iBAAiB;IACrB,OAAO,CAAqB;IAEpC,YAAY,MAAc;QACzB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACvB,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,MAAmB,EAAE,WAAwB;QACzE,IAAI,CAAC;YACJ,MAAM,GAAG,GAAG,+DAA+D,MAAM,CAAC,QAAQ,KAAK,MAAM,CAAC,SAAS,gBAAgB,WAAW,CAAC,QAAQ,KAAK,WAAW,CAAC,SAAS,QAAQ,IAAI,CAAC,OAAO,eAAe,CAAC;YAEjN,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,eAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAEtC,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ACJ,CAAC;IACF,CAAC;CACD;AAjFD,8CAiFC","sourcesContent":["import axios from 'axios';\nimport {\n\tIMapService,\n\tICoordinate,\n\tIDistance,\n\tIDuration,\n\tILeg,\n\tIDistanceInfo,\n\tIWaypointDistanceInfo,\n} from '../interfaces/IMapService';\nimport * as polyline from '@mapbox/polyline';\nimport { TRPCError } from '@trpc/server';\n\nexport class GoogleMapsService implements IMapService {\n\tprivate _apiKey: string | undefined;\n\n\tconstructor(apiKey: string) {\n\t\tthis._apiKey = apiKey;\n\t}\n\n\tpublic async getDistanceInfo(origin: ICoordinate, destination: ICoordinate): Promise<IDistanceInfo> {\n\t\ttry {\n\t\t\tconst url = `https://maps.googleapis.com/maps/api/directions/json?origin=${origin.latitude}, ${origin.longitude}&destination=${destination.latitude}, ${destination.longitude}&key=${this._apiKey}&mode=DRIVING`;\n\n\t\t\tconst { data } = await axios.get(url);\n\n\t\t\tconst legs = data.routes[0].legs[0];\n\n\t\t\tconst distance = legs.distance;\n\t\t\tconst duration = legs.duration;\n\n\t\t\treturn { distance, duration };\n\t\t} catch (error) {\n\t\t\tconsole.error(`Error in getDistanceInfo: ${error}`);\n\t\t\tthrow new TRPCError({\n\t\t\t\tcode: 'INTERNAL_SERVER_ERROR',\n\t\t\t\tmessage: 'Failed to fetch distance information from Google Maps API.',\n\t\t\t});\n\t\t}\n\t}\n\n\tpublic async getWaypointsDistanceInfo(\n\t\torigin: ICoordinate,\n\t\tdestination: ICoordinate,\n\t\twaypoints: Array<ICoordinate>\n\t): Promise<IWaypointDistanceInfo> {\n\t\ttry {\n\t\t\tconst waypointsStr = waypoints.map(point => `${point.latitude},${point.longitude}`).join('|');\n\n\t\t\tconst url = `https://maps.googleapis.com/maps/api/directions/json?origin=${origin.latitude},${origin.longitude}&destination=${destination.latitude},${destination.longitude}&waypoints=${waypointsStr}&key=${this._apiKey}&mode=DRIVING`;\n\n\t\t\tconst { data } = await axios.get(url);\n\n\t\t\tconst routes = data.routes[0];\n\n\t\t\tconst overviewPolyline = polyline.decode(routes.overview_polyline.points);\n\n\t\t\tconst legs = routes.legs.map((leg: { steps: any[]; distance: any; duration: any }) => {\n\t\t\t\tconst overviewPolyline = leg?.steps?.flatMap(step => polyline.decode(step?.polyline?.points));\n\n\t\t\t\treturn {\n\t\t\t\t\tdistance: leg.distance,\n\t\t\t\t\tduration: leg.duration,\n\t\t\t\t\toverviewPolyline,\n\t\t\t\t};\n\t\t\t});\n\n\t\t\tconst totalDistance = legs.reduce(\n\t\t\t\t(acc: any, curr: { distance: { value: any } }) => acc + curr.distance.value,\n\t\t\t\t0\n\t\t\t);\n\t\t\tconst distance = {\n\t\t\t\ttext: `${(totalDistance / 1000).toFixed(2)} km`,\n\t\t\t\tvalue: totalDistance,\n\t\t\t};\n\n\t\t\tconst totalDuration = legs.reduce(\n\t\t\t\t(acc: any, curr: { duration: { value: any } }) => acc + curr.duration.value,\n\t\t\t\t0\n\t\t\t);\n\t\t\tconst duration = {\n\t\t\t\ttext: `${Math.round(totalDuration / 60)} mins`,\n\t\t\t\tvalue: totalDuration,\n\t\t\t};\n\n\t\t\treturn { distance, duration, legs, overviewPolyline };\n\t\t} catch (error) {\n\t\t\tconsole.error(`Error in getWaypointsDistanceInfo: ${error}`);\n\t\t\tthrow new TRPCError({\n\t\t\t\tcode: 'INTERNAL_SERVER_ERROR',\n\t\t\t\tmessage: 'Failed to fetch waypoint distance information from Google Maps API.',\n\t\t\t});\n\t\t}\n\t}\n}\n"]}
@@ -89,6 +89,9 @@ import { AgentPerformance } from './agent-performance.model';
89
89
  import { Chatroom } from './chat-room.model';
90
90
  import { ServiceParent } from './service-parent.model';
91
91
  import { Vendor } from './vendor.model';
92
+ import { VendorAccessControl } from './vendor-access-control.model';
93
+ import { ServiceCategory } from './service-category.model';
94
+ import { ServicePackage } from './service-package.model';
92
95
  export declare const ActivityLogModel: ReturnModelType<typeof ActivityLog>;
93
96
  export * from './activity-log.model';
94
97
  export declare const AdminAccessControlModel: ReturnModelType<typeof AdminAccessControl>;
@@ -273,3 +276,9 @@ export declare const ServiceParentModel: ReturnModelType<typeof ServiceParent>;
273
276
  export * from './service-parent.model';
274
277
  export declare const VendorModel: ReturnModelType<typeof Vendor>;
275
278
  export * from './vendor.model';
279
+ export declare const VendorAccessControlModel: ReturnModelType<typeof VendorAccessControl>;
280
+ export * from './vendor-access-control.model';
281
+ export declare const ServiceCategoryModel: ReturnModelType<typeof ServiceCategory>;
282
+ export * from './service-category.model';
283
+ export declare const ServicePackageModel: ReturnModelType<typeof ServicePackage>;
284
+ export * from './service-package.model';
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.ProductMarketingModel = exports.RiderPayoutModel = exports.ShopPayoutModel = exports.PayoutModel = exports.ParentModel = exports.OrderDeliveryModel = exports.CourierOrderModel = exports.RegularOrderModel = exports.OrderModel = exports.NutritionModel = exports.NotificationModel = exports.MealPlanModel = exports.PunchMarketingModel = exports.LoyaltyPointMarketingModel = exports.FreeDeliveryMarketingModel = exports.FeaturedMarketingModel = exports.DiscountMarketingModel = exports.Buy1Get1MarketingModel = exports.MarketingModel = exports.LoyaltyPointSettingModel = exports.LoyaltyPointCategoryModel = exports.ListContainerModel = exports.LineItemModel = exports.GalleryModel = exports.FinanceSettlementModel = exports.FilterContainerModel = exports.FeaturedSettingModel = exports.FavouriteModel = exports.FaqModel = exports.DishModel = exports.DealSettingModel = exports.ReferralRewardCouponModel = exports.ReferralCodeCouponModel = exports.IndividualUserCouponModel = exports.IndividualStoreCouponModel = exports.GlobalCouponModel = exports.CustomCouponModel = exports.CouponModel = exports.CounterModel = exports.CategoryModel = exports.CartParticipantModel = exports.CartModel = exports.BrandModel = exports.BOBFinanceModel = exports.BannerModel = exports.AttributeModel = exports.UserAppSectionSettingModel = exports.AdminModel = exports.AdminAccessControlModel = exports.ActivityLogModel = void 0;
18
- exports.VendorModel = exports.ServiceParentModel = exports.ChatroomModel = exports.AgentPerformanceModel = exports.MessageModel = exports.TicketModel = exports.RewardModel = exports.CancellationReasonModel = exports.SupportReasonModel = exports.TermsAndConditionsModel = exports.DefaultChatModel = exports.ZoneModel = exports.UserModel = exports.TagModel = exports.SubscriptionModel = exports.SubscriptionSettingModel = exports.ShopModel = exports.ShopReviewModel = exports.ShopMealPlanModel = exports.ShopCategoryModel = exports.ShopAccessControlModel = exports.SettingModel = exports.RiderModel = exports.RiderTrackingModel = exports.RiderTimeoutModel = exports.RiderReviewModel = exports.RequestAreaModel = exports.ReferralSettingModel = exports.RatingSettingModel = exports.PunchMarketingHistoryModel = exports.ProductModel = void 0;
18
+ exports.ServicePackageModel = exports.ServiceCategoryModel = exports.VendorAccessControlModel = exports.VendorModel = exports.ServiceParentModel = exports.ChatroomModel = exports.AgentPerformanceModel = exports.MessageModel = exports.TicketModel = exports.RewardModel = exports.CancellationReasonModel = exports.SupportReasonModel = exports.TermsAndConditionsModel = exports.DefaultChatModel = exports.ZoneModel = exports.UserModel = exports.TagModel = exports.SubscriptionModel = exports.SubscriptionSettingModel = exports.ShopModel = exports.ShopReviewModel = exports.ShopMealPlanModel = exports.ShopCategoryModel = exports.ShopAccessControlModel = exports.SettingModel = exports.RiderModel = exports.RiderTrackingModel = exports.RiderTimeoutModel = exports.RiderReviewModel = exports.RequestAreaModel = exports.ReferralSettingModel = exports.RatingSettingModel = exports.PunchMarketingHistoryModel = exports.ProductModel = void 0;
19
19
  exports.getCardModel = getCardModel;
20
20
  exports.getAreebaCardModel = getAreebaCardModel;
21
21
  exports.getCoreAuthIdentityModel = getCoreAuthIdentityModel;
@@ -119,6 +119,9 @@ const chat_room_model_1 = require("./chat-room.model");
119
119
  const auth_1 = require("../../auth");
120
120
  const service_parent_model_1 = require("./service-parent.model");
121
121
  const vendor_model_1 = require("./vendor.model");
122
+ const vendor_access_control_model_1 = require("./vendor-access-control.model");
123
+ const service_category_model_1 = require("./service-category.model");
124
+ const service_package_model_1 = require("./service-package.model");
122
125
  exports.ActivityLogModel = (0, typegoose_1.getModelForClass)(activity_log_model_1.ActivityLog);
123
126
  __exportStar(require("./activity-log.model"), exports);
124
127
  exports.AdminAccessControlModel = (0, typegoose_1.getModelForClass)(admin_access_control_model_1.AdminAccessControl);
@@ -360,4 +363,10 @@ exports.ServiceParentModel = (0, typegoose_1.getModelForClass)(service_parent_mo
360
363
  __exportStar(require("./service-parent.model"), exports);
361
364
  exports.VendorModel = (0, typegoose_1.getModelForClass)(vendor_model_1.Vendor);
362
365
  __exportStar(require("./vendor.model"), exports);
366
+ exports.VendorAccessControlModel = (0, typegoose_1.getModelForClass)(vendor_access_control_model_1.VendorAccessControl);
367
+ __exportStar(require("./vendor-access-control.model"), exports);
368
+ exports.ServiceCategoryModel = (0, typegoose_1.getModelForClass)(service_category_model_1.ServiceCategory);
369
+ __exportStar(require("./service-category.model"), exports);
370
+ exports.ServicePackageModel = (0, typegoose_1.getModelForClass)(service_package_model_1.ServicePackage);
371
+ __exportStar(require("./service-package.model"), exports);
363
372
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/mongo/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA8IA,oCAGC;AAED,gDAGC;AAED,4DAGC;AAED,sEAGC;AAED,sEAGC;AAED,wEAGC;AAED,sEAGC;AAED,4CAGC;AAED,oCAGC;AAGD,wDA8CC;AA1OD,uEAA6D;AAC7D,qEAA2D;AAC3D,oDAAwG;AACxG,+CAAsC;AACtC,6EAAkE;AAClE,6DAAmD;AACnD,qFAAyE;AACzE,uDAA8C;AAC9C,iDAAwC;AACxC,2DAAiD;AACjD,+CAAsC;AACtC,qDAA4C;AAC5C,mDAA0C;AAC1C,iDAAwC;AACxC,6DAAmD;AACnD,6CAAoC;AACpC,2CAAkC;AAClC,uDAA8C;AAC9C,qEAA2D;AAC3D,qEAA2D;AAC3D,iEAAuD;AACvD,iFAAsE;AACtE,+EAAoE;AACpE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AAC,0BAAQ,CAAC,CAAC;AAC1F,oDAAkC;AAElC,oEAAkD;AAErC,QAAA,kBAAkB,GAA0C,IAAA,4BAAgB,EAAC,oCAAa,CAAC,CAAC;AACzG,yDAAuC;AAE1B,QAAA,WAAW,GAAmC,IAAA,4BAAgB,EAAC,qBAAM,CAAC,CAAC;AACpF,iDAA+B","sourcesContent":["import { RiderPayout } from './providers/rider-payout.model';\nimport { ShopPayout } from './providers/shop-payout.model';\nimport { getDiscriminatorModelForClass, getModelForClass, ReturnModelType } from '@typegoose/typegoose';\nimport { Admin } from './admin.model';\nimport { AdminAccessControl } from './admin-access-control.model';\nimport { ActivityLog } from './activity-log.model';\nimport { UserAppSectionSetting } from './user-app-section-setting.model';\nimport { Attribute } from './attribute.model';\nimport { Banner } from './banner.model';\nimport { BOBFinance } from './bob-finance.model';\nimport { Brand } from './brand.model';\nimport { Category } from './category.model';\nimport { Counter } from './counter.model';\nimport { Coupon } from './coupon.model';\nimport { DealSetting } from './deal-setting.model';\nimport { Dish } from './dish.model';\nimport { Faq } from './faq.model';\nimport { Favourite } from './favourite.model';\nimport { FeaturedSetting } from './featured-setting.model';\nimport { FilterContainer } from './filter-container.model';\nimport { ListContainer } from './list-container.model';\nimport { LoyaltyPointCategory } from './loyalty-point-category.model';\nimport { LoyaltyPointSetting } from './loyalty-point-setting.model';\nimport { Marketing } from './marketing.model';\nimport { MealPlan } from './meal-plan.model';\nimport { Nutrition } from './nutrition.model';\nimport { Parent } from './parent.model';\nimport { ProductMarketing } from './product-marketing.model';\nimport { Product } from './product.model';\nimport { PunchMarketingHistory } from './punch-marketing-history.model';\nimport { RatingSetting } from './rating-setting.model';\nimport { ReferralSetting } from './referral-setting.model';\nimport { RequestArea } from './request-area.model';\nimport { RiderReview } from './rider-review.model';\nimport { Role } from './role.model';\nimport { Setting } from './setting.model';\nimport { ShopAccessControl } from './shop-access-control.model';\nimport { ShopCategory } from './shop-category.model';\nimport { ShopMealPlan } from './shop-meal-plan.model';\nimport { ShopReview } from './shop-review.model';\nimport { Shop } from './shop.model';\nimport { SubscriptionSetting } from './subscription-setting.model';\nimport { Subscription } from './subscription.model';\nimport { Tag } from './tag.model';\nimport { Zone } from './zone.model';\nimport { Buy1Get1Marketing } from './providers/buy1-get1-marketing.model';\nimport {\n\tCardType,\n\tCoreAuthIdentityType,\n\tCouponType,\n\tMarketingType,\n\tOrderType,\n\tPayoutType,\n} from '../../../utilities/enum';\nimport { CustomCoupon } from './providers/custom-coupon.model';\nimport { DiscountMarketing } from './providers/discount-marketing.model';\nimport { FeaturedMarketing } from './providers/featured-marketing.model';\nimport { FreeDeliveryMarketing } from './providers/free-delivery-marketing.model';\nimport { GlobalCoupon } from './providers/global-coupon.model';\nimport { IndividualStoreCoupon } from './providers/individual-store-coupon.model';\nimport { IndividualUserCoupon } from './providers/individual-user-coupon.model';\nimport { LoyaltyPointMarketing } from './providers/loyalty-point-marketing.model';\nimport { PunchMarketing } from './providers/punch-marketing.model';\nimport { ReferralCodeCoupon } from './providers/referral-code-coupon.model';\nimport { ReferralRewardCoupon } from './providers/referral-reward-coupon.model';\nimport { Notification } from './notification.model';\nimport { CoreAuthIdentity } from './core-auth-identity.model';\nimport { CoreEmailAuthIdentity } from './providers/core-email-auth-identity.model';\nimport { CorePhoneAuthIdentity } from './providers/core-phone-auth-identity.model';\nimport { CoreGoogleAuthIdentity } from './providers/core-google-auth-identity.model';\nimport { CoreAppleAuthIdentity } from './providers/core-apple-auth-identity.model';\nimport { CoreUser } from './core-user.model';\nimport { Card } from './card.model';\nimport { AreebaCard } from './providers/areeba-card.model';\nimport { RiderTracking } from './rider-tracking.model';\nimport { Rider } from './rider.model';\nimport { RiderTimeout } from './rider-timeout.model';\nimport { User } from './user.model';\nimport { Cart } from './cart.model';\nimport { LineItem } from './line-item.model';\nimport { CartParticipant } from './cart-participant.model';\nimport { Gallery } from './gallery.model';\nimport { Order } from './order.model';\nimport { RegularOrder } from './providers/regular-order.model';\nimport { CourierOrder } from './providers/courier-order.model';\nimport { OrderDelivery } from './order-delivery.model';\nimport { FinanceSettlement } from './finance-settlement.model';\nimport { DefaultChat } from './default-chat.model';\nimport { TermsAndConditions } from './terms-and-conditions.model';\nimport { SupportReason } from './support-reason.model';\nimport { CancellationReason } from './cancellation-reason.model';\nimport { Payout } from './payout.model';\nimport { Reward } from './reward.model';\nimport { Ticket } from './ticket.model';\nimport { Message } from './message.model';\nimport { AgentPerformance } from './agent-performance.model';\nimport { Chatroom } from './chat-room.model';\nimport {initializeRefreshTokenModel} from \"../../auth\";\nimport { ServiceParent } from './service-parent.model';\nimport { Vendor } from './vendor.model';\n\n// Regular models (using standard getModelForClass)\nexport const ActivityLogModel: ReturnModelType<typeof ActivityLog> = getModelForClass(ActivityLog);\nexport * from './activity-log.model';\n\nexport const AdminAccessControlModel: ReturnModelType<typeof AdminAccessControl> =\n\tgetModelForClass(AdminAccessControl);\nexport * from './admin-access-control.model';\n\nexport const AdminModel: ReturnModelType<typeof Admin> = getModelForClass(Admin);\nexport * from './admin.model';\n\nexport const UserAppSectionSettingModel: ReturnModelType<typeof UserAppSectionSetting> =\n\tgetModelForClass(UserAppSectionSetting);\nexport * from './user-app-section-setting.model';\n\nexport const AttributeModel: ReturnModelType<typeof Attribute> = getModelForClass(Attribute);\nexport * from './attribute.model';\n\nexport const BannerModel: ReturnModelType<typeof Banner> = getModelForClass(Banner);\nexport * from './banner.model';\n\nexport const BOBFinanceModel: ReturnModelType<typeof BOBFinance> = getModelForClass(BOBFinance);\nexport * from './bob-finance.model';\n\nexport const BrandModel: ReturnModelType<typeof Brand> = getModelForClass(Brand);\nexport * from './brand.model';\n\n// Global models - will be set after initGlobalConnection()\nlet actualCardModel: ReturnModelType<typeof Card> | null = null;\nlet actualCoreAuthIdentityModel: ReturnModelType<typeof CoreAuthIdentity> | null = null;\nlet actualCoreUserModel: ReturnModelType<typeof CoreUser> | null = null;\nlet actualRoleModel: ReturnModelType<typeof Role> | null = null;\n\n// Global discriminator models - will be set after initGlobalConnection()\nlet actualAreebaCardModel: ReturnModelType<typeof AreebaCard> | null = null;\nlet actualCoreEmailAuthIdentityModel: ReturnModelType<typeof CoreEmailAuthIdentity> | null = null;\nlet actualCorePhoneAuthIdentityModel: ReturnModelType<typeof CorePhoneAuthIdentity> | null = null;\nlet actualCoreGoogleAuthIdentityModel: ReturnModelType<typeof CoreGoogleAuthIdentity> | null = null;\nlet actualCoreAppleAuthIdentityModel: ReturnModelType<typeof CoreAppleAuthIdentity> | null = null;\n\n// Export getter functions for global models\nexport function getCardModel(): ReturnModelType<typeof Card> {\n\tif (!actualCardModel) throw new Error('Card model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCardModel;\n}\n\nexport function getAreebaCardModel(): ReturnModelType<typeof AreebaCard> {\n\tif (!actualAreebaCardModel) throw new Error('AreebaCard model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualAreebaCardModel;\n}\n\nexport function getCoreAuthIdentityModel(): ReturnModelType<typeof CoreAuthIdentity> {\n\tif (!actualCoreAuthIdentityModel) throw new Error('CoreAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreAuthIdentityModel;\n}\n\nexport function getCoreEmailAuthIdentityModel(): ReturnModelType<typeof CoreEmailAuthIdentity> {\n\tif (!actualCoreEmailAuthIdentityModel) throw new Error('CoreEmailAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreEmailAuthIdentityModel;\n}\n\nexport function getCorePhoneAuthIdentityModel(): ReturnModelType<typeof CorePhoneAuthIdentity> {\n\tif (!actualCorePhoneAuthIdentityModel) throw new Error('CorePhoneAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCorePhoneAuthIdentityModel;\n}\n\nexport function getCoreGoogleAuthIdentityModel(): ReturnModelType<typeof CoreGoogleAuthIdentity> {\n\tif (!actualCoreGoogleAuthIdentityModel) throw new Error('CoreGoogleAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreGoogleAuthIdentityModel;\n}\n\nexport function getCoreAppleAuthIdentityModel(): ReturnModelType<typeof CoreAppleAuthIdentity> {\n\tif (!actualCoreAppleAuthIdentityModel) throw new Error('CoreAppleAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreAppleAuthIdentityModel;\n}\n\nexport function getCoreUserModel(): ReturnModelType<typeof CoreUser> {\n\tif (!actualCoreUserModel) throw new Error('CoreUser model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreUserModel;\n}\n\nexport function getRoleModel(): ReturnModelType<typeof Role> {\n\tif (!actualRoleModel) throw new Error('Role model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualRoleModel;\n}\n\n// Function to initialize all global models (called from initGlobalConnection)\nexport function initializeGlobalModels(globalConnection: any) {\n\t// Initialize base global models\n\tactualCardModel = getModelForClass(Card, { existingConnection: globalConnection });\n\tactualCoreAuthIdentityModel = getModelForClass(CoreAuthIdentity, { existingConnection: globalConnection });\n\tactualCoreUserModel = getModelForClass(CoreUser, { existingConnection: globalConnection });\n\tactualRoleModel = getModelForClass(Role, { existingConnection: globalConnection });\n\n\t// Initialize discriminator models\n\tactualAreebaCardModel = getDiscriminatorModelForClass(\n\t\tactualCardModel,\n\t\tAreebaCard,\n\t\tCardType.AREEBA,\n\t\t{ existingConnection: globalConnection }\n\t);\n\n\tactualCoreEmailAuthIdentityModel = getDiscriminatorModelForClass(\n\t\tactualCoreAuthIdentityModel,\n\t\tCoreEmailAuthIdentity,\n\t\tCoreAuthIdentityType.EMAIL,\n\t\t{ existingConnection: globalConnection }\n\t);\n\n\tactualCorePhoneAuthIdentityModel = getDiscriminatorModelForClass(\n\t\tactualCoreAuthIdentityModel,\n\t\tCorePhoneAuthIdentity,\n\t\tCoreAuthIdentityType.PHONE,\n\t\t{ existingConnection: globalConnection }\n\t);\n\n\tactualCoreGoogleAuthIdentityModel = getDiscriminatorModelForClass(\n\t\tactualCoreAuthIdentityModel,\n\t\tCoreGoogleAuthIdentity,\n\t\tCoreAuthIdentityType.GOOGLE,\n\t\t{ existingConnection: globalConnection }\n\t);\n\n\tactualCoreAppleAuthIdentityModel = getDiscriminatorModelForClass(\n\t\tactualCoreAuthIdentityModel,\n\t\tCoreAppleAuthIdentity,\n\t\tCoreAuthIdentityType.APPLE,\n\t\t{ existingConnection: globalConnection }\n\t);\n\n\tinitializeRefreshTokenModel(globalConnection);\n\n\tconsole.log('✅ All global models initialized');\n}\n\nexport * from './card.model';\nexport * from './providers/areeba-card.model';\n\nexport const CartModel: ReturnModelType<typeof Cart> = getModelForClass(Cart);\nexport * from './cart.model';\n\nexport const CartParticipantModel: ReturnModelType<typeof CartParticipant> =\n\tgetModelForClass(CartParticipant);\nexport * from './cart-participant.model';\n\nexport const CategoryModel: ReturnModelType<typeof Category> = getModelForClass(Category);\nexport * from './category.model';\n\nexport * from './core-auth-identity.model';\nexport * from './providers/core-apple-auth-identity.model';\nexport * from './providers/core-email-auth-identity.model';\nexport * from './providers/core-google-auth-identity.model';\nexport * from './providers/core-phone-auth-identity.model';\nexport * from './core-user.model';\nexport * from './role.model';\n\nexport const CounterModel: ReturnModelType<typeof Counter> = getModelForClass(Counter);\nexport * from './counter.model';\n\nexport const CouponModel: ReturnModelType<typeof Coupon> = getModelForClass(Coupon);\nexport const CustomCouponModel: ReturnModelType<typeof CustomCoupon> = getDiscriminatorModelForClass(\n\tCouponModel,\n\tCustomCoupon,\n\tCouponType.CUSTOM_COUPON\n);\nexport const GlobalCouponModel: ReturnModelType<typeof GlobalCoupon> = getDiscriminatorModelForClass(\n\tCouponModel,\n\tGlobalCoupon,\n\tCouponType.GLOBAL\n);\nexport const IndividualStoreCouponModel: ReturnModelType<typeof IndividualStoreCoupon> =\n\tgetDiscriminatorModelForClass(CouponModel, IndividualStoreCoupon, CouponType.INDIVIDUAL_STORE);\nexport const IndividualUserCouponModel: ReturnModelType<typeof IndividualUserCoupon> =\n\tgetDiscriminatorModelForClass(CouponModel, IndividualUserCoupon, CouponType.INDIVIDUAL_USER);\nexport const ReferralCodeCouponModel: ReturnModelType<typeof ReferralCodeCoupon> =\n\tgetDiscriminatorModelForClass(CouponModel, ReferralCodeCoupon, CouponType.REFERRAL_CODE);\nexport const ReferralRewardCouponModel: ReturnModelType<typeof ReferralRewardCoupon> =\n\tgetDiscriminatorModelForClass(CouponModel, ReferralRewardCoupon, CouponType.REFERRAL_REWARD);\nexport * from './coupon.model';\nexport * from './providers/custom-coupon.model';\nexport * from './providers/global-coupon.model';\nexport * from './providers/individual-store-coupon.model';\nexport * from './providers/individual-user-coupon.model';\nexport * from './providers/referral-code-coupon.model';\nexport * from './providers/referral-reward-coupon.model';\n\nexport const DealSettingModel: ReturnModelType<typeof DealSetting> = getModelForClass(DealSetting);\nexport * from './deal-setting.model';\n\nexport const DishModel: ReturnModelType<typeof Dish> = getModelForClass(Dish);\nexport * from './dish.model';\n\nexport const FaqModel: ReturnModelType<typeof Faq> = getModelForClass(Faq);\nexport * from './faq.model';\n\nexport const FavouriteModel: ReturnModelType<typeof Favourite> = getModelForClass(Favourite);\nexport * from './favourite.model';\n\nexport const FeaturedSettingModel: ReturnModelType<typeof FeaturedSetting> =\n\tgetModelForClass(FeaturedSetting);\nexport * from './featured-setting.model';\n\nexport const FilterContainerModel: ReturnModelType<typeof FilterContainer> =\n\tgetModelForClass(FilterContainer);\nexport * from './filter-container.model';\n\nexport const FinanceSettlementModel: ReturnModelType<typeof FinanceSettlement> =\n\tgetModelForClass(FinanceSettlement);\nexport * from './finance-settlement.model';\n\nexport const GalleryModel: ReturnModelType<typeof Gallery> = getModelForClass(Gallery);\nexport * from './gallery.model';\n\nexport const LineItemModel: ReturnModelType<typeof LineItem> = getModelForClass(LineItem);\nexport * from './line-item.model';\n\nexport const ListContainerModel: ReturnModelType<typeof ListContainer> = getModelForClass(ListContainer);\nexport * from './list-container.model';\n\nexport const LoyaltyPointCategoryModel: ReturnModelType<typeof LoyaltyPointCategory> =\n\tgetModelForClass(LoyaltyPointCategory);\nexport * from './loyalty-point-category.model';\n\nexport const LoyaltyPointSettingModel: ReturnModelType<typeof LoyaltyPointSetting> =\n\tgetModelForClass(LoyaltyPointSetting);\nexport * from './loyalty-point-setting.model';\n\nexport const MarketingModel: ReturnModelType<typeof Marketing> = getModelForClass(Marketing);\nexport const Buy1Get1MarketingModel: ReturnModelType<typeof Buy1Get1Marketing> =\n\tgetDiscriminatorModelForClass(MarketingModel, Buy1Get1Marketing, MarketingType.BUY1GET1);\nexport const DiscountMarketingModel: ReturnModelType<typeof DiscountMarketing> =\n\tgetDiscriminatorModelForClass(MarketingModel, DiscountMarketing, MarketingType.DISCOUNT);\nexport const FeaturedMarketingModel: ReturnModelType<typeof FeaturedMarketing> =\n\tgetDiscriminatorModelForClass(MarketingModel, FeaturedMarketing, MarketingType.FEATURED);\nexport const FreeDeliveryMarketingModel: ReturnModelType<typeof FreeDeliveryMarketing> =\n\tgetDiscriminatorModelForClass(MarketingModel, FreeDeliveryMarketing, MarketingType.FREE_DELIVERY);\nexport const LoyaltyPointMarketingModel: ReturnModelType<typeof LoyaltyPointMarketing> =\n\tgetDiscriminatorModelForClass(MarketingModel, LoyaltyPointMarketing, MarketingType.LOYALTY_POINT);\nexport const PunchMarketingModel: ReturnModelType<typeof PunchMarketing> = getDiscriminatorModelForClass(\n\tMarketingModel,\n\tPunchMarketing,\n\tMarketingType.PUNCH_MARKETING\n);\nexport * from './marketing.model';\nexport * from './providers/buy1-get1-marketing.model';\nexport * from './providers/discount-marketing.model';\nexport * from './providers/featured-marketing.model';\nexport * from './providers/free-delivery-marketing.model';\nexport * from './providers/loyalty-point-marketing.model';\nexport * from './providers/punch-marketing.model';\n\nexport const MealPlanModel: ReturnModelType<typeof MealPlan> = getModelForClass(MealPlan);\nexport * from './meal-plan.model';\n\nexport const NotificationModel: ReturnModelType<typeof Notification> = getModelForClass(Notification);\nexport * from './notification.model';\n\nexport const NutritionModel: ReturnModelType<typeof Nutrition> = getModelForClass(Nutrition);\nexport * from './nutrition.model';\n\nexport const OrderModel: ReturnModelType<typeof Order> = getModelForClass(Order);\nexport const RegularOrderModel: ReturnModelType<typeof RegularOrder> = getDiscriminatorModelForClass(\n\tOrderModel,\n\tRegularOrder,\n\tOrderType.REGULAR\n);\nexport const CourierOrderModel: ReturnModelType<typeof CourierOrder> = getDiscriminatorModelForClass(\n\tOrderModel,\n\tCourierOrder,\n\tOrderType.COURIER\n);\nexport * from './order.model';\nexport * from './providers/regular-order.model';\nexport * from './providers/courier-order.model';\n\nexport const OrderDeliveryModel: ReturnModelType<typeof OrderDelivery> = getModelForClass(OrderDelivery);\nexport * from './order-delivery.model';\n\nexport const ParentModel: ReturnModelType<typeof Parent> = getModelForClass(Parent);\nexport * from './parent.model';\n\nexport const PayoutModel: ReturnModelType<typeof Payout> = getModelForClass(Payout);\nexport const ShopPayoutModel: ReturnModelType<typeof ShopPayout> = getDiscriminatorModelForClass(\n\tPayoutModel,\n\tShopPayout,\n\tPayoutType.SHOP\n);\nexport const RiderPayoutModel: ReturnModelType<typeof RiderPayout> = getDiscriminatorModelForClass(\n\tPayoutModel,\n\tRiderPayout,\n\tPayoutType.RIDER\n);\nexport * from './payout.model';\nexport * from './providers/shop-payout.model';\nexport * from './providers/rider-payout.model';\n\nexport const ProductMarketingModel: ReturnModelType<typeof ProductMarketing> =\n\tgetModelForClass(ProductMarketing);\nexport * from './product-marketing.model';\n\nexport const ProductModel: ReturnModelType<typeof Product> = getModelForClass(Product);\nexport * from './product.model';\n\nexport const PunchMarketingHistoryModel: ReturnModelType<typeof PunchMarketingHistory> =\n\tgetModelForClass(PunchMarketingHistory);\nexport * from './punch-marketing-history.model';\n\nexport const RatingSettingModel: ReturnModelType<typeof RatingSetting> = getModelForClass(RatingSetting);\nexport * from './rating-setting.model';\n\nexport const ReferralSettingModel: ReturnModelType<typeof ReferralSetting> =\n\tgetModelForClass(ReferralSetting);\nexport * from './referral-setting.model';\n\nexport const RequestAreaModel: ReturnModelType<typeof RequestArea> = getModelForClass(RequestArea);\nexport * from './request-area.model';\n\nexport const RiderReviewModel: ReturnModelType<typeof RiderReview> = getModelForClass(RiderReview);\nexport * from './rider-review.model';\n\nexport const RiderTimeoutModel: ReturnModelType<typeof RiderTimeout> = getModelForClass(RiderTimeout);\nexport * from './rider-timeout.model';\n\nexport const RiderTrackingModel: ReturnModelType<typeof RiderTracking> = getModelForClass(RiderTracking);\nexport * from './rider-tracking.model';\n\nexport const RiderModel: ReturnModelType<typeof Rider> = getModelForClass(Rider);\nexport * from './rider.model';\n\nexport const SettingModel: ReturnModelType<typeof Setting> = getModelForClass(Setting);\nexport * from './setting.model';\n\nexport const ShopAccessControlModel: ReturnModelType<typeof ShopAccessControl> =\n\tgetModelForClass(ShopAccessControl);\nexport * from './shop-access-control.model';\n\nexport const ShopCategoryModel: ReturnModelType<typeof ShopCategory> = getModelForClass(ShopCategory);\nexport * from './shop-category.model';\n\nexport const ShopMealPlanModel: ReturnModelType<typeof ShopMealPlan> = getModelForClass(ShopMealPlan);\nexport * from './shop-meal-plan.model';\n\nexport const ShopReviewModel: ReturnModelType<typeof ShopReview> = getModelForClass(ShopReview);\nexport * from './shop-review.model';\n\nexport const ShopModel: ReturnModelType<typeof Shop> = getModelForClass(Shop);\nexport * from './shop.model';\n\nexport const SubscriptionSettingModel: ReturnModelType<typeof SubscriptionSetting> =\n\tgetModelForClass(SubscriptionSetting);\nexport * from './subscription-setting.model';\n\nexport const SubscriptionModel: ReturnModelType<typeof Subscription> = getModelForClass(Subscription);\nexport * from './subscription.model';\n\nexport const TagModel: ReturnModelType<typeof Tag> = getModelForClass(Tag);\nexport * from './tag.model';\n\nexport const UserModel: ReturnModelType<typeof User> = getModelForClass(User);\nexport * from './user.model';\n\nexport const ZoneModel: ReturnModelType<typeof Zone> = getModelForClass(Zone);\nexport * from './zone.model';\n\nexport const DefaultChatModel: ReturnModelType<typeof DefaultChat> = getModelForClass(DefaultChat);\nexport * from './default-chat.model';\n\nexport const TermsAndConditionsModel: ReturnModelType<typeof TermsAndConditions> =\n\tgetModelForClass(TermsAndConditions);\nexport * from './terms-and-conditions.model';\n\nexport const SupportReasonModel: ReturnModelType<typeof SupportReason> = getModelForClass(SupportReason);\nexport * from './support-reason.model';\n\nexport const CancellationReasonModel: ReturnModelType<typeof CancellationReason> =\n\tgetModelForClass(CancellationReason);\nexport * from './cancellation-reason.model';\n\nexport * from './embedded/trip-leg.mode';\nexport * from './embedded/rider-assignment-model';\n\nexport const RewardModel: ReturnModelType<typeof Reward> = getModelForClass(Reward);\nexport * from './reward.model';\n\nexport const TicketModel: ReturnModelType<typeof Ticket> = getModelForClass(Ticket);\nexport * from './ticket.model';\n\nexport const MessageModel: ReturnModelType<typeof Message> = getModelForClass(Message);\nexport * from './message.model';\n\nexport const AgentPerformanceModel: ReturnModelType<typeof AgentPerformance> =\n\tgetModelForClass(AgentPerformance);\nexport * from './agent-performance.model';\n\nexport const ChatroomModel: ReturnModelType<typeof Chatroom> = getModelForClass(Chatroom);\nexport * from './chat-room.model';\n\nexport * from './embedded/chat-participant.model';\n\nexport const ServiceParentModel: ReturnModelType<typeof ServiceParent> = getModelForClass(ServiceParent);\nexport * from './service-parent.model';\n\nexport const VendorModel: ReturnModelType<typeof Vendor> = getModelForClass(Vendor);\nexport * from './vendor.model';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/mongo/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAiJA,oCAGC;AAED,gDAGC;AAED,4DAGC;AAED,sEAGC;AAED,sEAGC;AAED,wEAGC;AAED,sEAGC;AAED,4CAGC;AAED,oCAGC;AAGD,wDA8CC;AA7OD,uEAA6D;AAC7D,qEAA2D;AAC3D,oDAAwG;AACxG,+CAAsC;AACtC,6EAAkE;AAClE,6DAAmD;AACnD,qFAAyE;AACzE,uDAA8C;AAC9C,iDAAwC;AACxC,2DAAiD;AACjD,+CAAsC;AACtC,qDAA4C;AAC5C,mDAA0C;AAC1C,iDAAwC;AACxC,6DAAmD;AACnD,6CAAoC;AACpC,2CAAkC;AAClC,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kDAAgC;AAEnB,QAAA,qBAAqB,GACjC,IAAA,4BAAgB,EAAC,0CAAgB,CAAC,CAAC;AACpC,4DAA0C;AAE7B,QAAA,aAAa,GAAqC,IAAA,4BAAgB,EAAC,0BAAQ,CAAC,CAAC;AAC1F,oDAAkC;AAElC,oEAAkD;AAErC,QAAA,kBAAkB,GAA0C,IAAA,4BAAgB,EAAC,oCAAa,CAAC,CAAC;AACzG,yDAAuC;AAE1B,QAAA,WAAW,GAAmC,IAAA,4BAAgB,EAAC,qBAAM,CAAC,CAAC;AACpF,iDAA+B;AAElB,QAAA,wBAAwB,GAAgD,IAAA,4BAAgB,EAAC,iDAAmB,CAAC,CAAC;AAC3H,gEAA8C;AAEjC,QAAA,oBAAoB,GAA4C,IAAA,4BAAgB,EAAC,wCAAe,CAAC,CAAC;AAC/G,2DAAyC;AAE5B,QAAA,mBAAmB,GAA2C,IAAA,4BAAgB,EAAC,sCAAc,CAAC,CAAC;AAC5G,0DAAwC","sourcesContent":["import { RiderPayout } from './providers/rider-payout.model';\nimport { ShopPayout } from './providers/shop-payout.model';\nimport { getDiscriminatorModelForClass, getModelForClass, ReturnModelType } from '@typegoose/typegoose';\nimport { Admin } from './admin.model';\nimport { AdminAccessControl } from './admin-access-control.model';\nimport { ActivityLog } from './activity-log.model';\nimport { UserAppSectionSetting } from './user-app-section-setting.model';\nimport { Attribute } from './attribute.model';\nimport { Banner } from './banner.model';\nimport { BOBFinance } from './bob-finance.model';\nimport { Brand } from './brand.model';\nimport { Category } from './category.model';\nimport { Counter } from './counter.model';\nimport { Coupon } from './coupon.model';\nimport { DealSetting } from './deal-setting.model';\nimport { Dish } from './dish.model';\nimport { Faq } from './faq.model';\nimport { Favourite } from './favourite.model';\nimport { FeaturedSetting } from './featured-setting.model';\nimport { FilterContainer } from './filter-container.model';\nimport { ListContainer } from './list-container.model';\nimport { LoyaltyPointCategory } from './loyalty-point-category.model';\nimport { LoyaltyPointSetting } from './loyalty-point-setting.model';\nimport { Marketing } from './marketing.model';\nimport { MealPlan } from './meal-plan.model';\nimport { Nutrition } from './nutrition.model';\nimport { Parent } from './parent.model';\nimport { ProductMarketing } from './product-marketing.model';\nimport { Product } from './product.model';\nimport { PunchMarketingHistory } from './punch-marketing-history.model';\nimport { RatingSetting } from './rating-setting.model';\nimport { ReferralSetting } from './referral-setting.model';\nimport { RequestArea } from './request-area.model';\nimport { RiderReview } from './rider-review.model';\nimport { Role } from './role.model';\nimport { Setting } from './setting.model';\nimport { ShopAccessControl } from './shop-access-control.model';\nimport { ShopCategory } from './shop-category.model';\nimport { ShopMealPlan } from './shop-meal-plan.model';\nimport { ShopReview } from './shop-review.model';\nimport { Shop } from './shop.model';\nimport { SubscriptionSetting } from './subscription-setting.model';\nimport { Subscription } from './subscription.model';\nimport { Tag } from './tag.model';\nimport { Zone } from './zone.model';\nimport { Buy1Get1Marketing } from './providers/buy1-get1-marketing.model';\nimport {\n\tCardType,\n\tCoreAuthIdentityType,\n\tCouponType,\n\tMarketingType,\n\tOrderType,\n\tPayoutType,\n} from '../../../utilities/enum';\nimport { CustomCoupon } from './providers/custom-coupon.model';\nimport { DiscountMarketing } from './providers/discount-marketing.model';\nimport { FeaturedMarketing } from './providers/featured-marketing.model';\nimport { FreeDeliveryMarketing } from './providers/free-delivery-marketing.model';\nimport { GlobalCoupon } from './providers/global-coupon.model';\nimport { IndividualStoreCoupon } from './providers/individual-store-coupon.model';\nimport { IndividualUserCoupon } from './providers/individual-user-coupon.model';\nimport { LoyaltyPointMarketing } from './providers/loyalty-point-marketing.model';\nimport { PunchMarketing } from './providers/punch-marketing.model';\nimport { ReferralCodeCoupon } from './providers/referral-code-coupon.model';\nimport { ReferralRewardCoupon } from './providers/referral-reward-coupon.model';\nimport { Notification } from './notification.model';\nimport { CoreAuthIdentity } from './core-auth-identity.model';\nimport { CoreEmailAuthIdentity } from './providers/core-email-auth-identity.model';\nimport { CorePhoneAuthIdentity } from './providers/core-phone-auth-identity.model';\nimport { CoreGoogleAuthIdentity } from './providers/core-google-auth-identity.model';\nimport { CoreAppleAuthIdentity } from './providers/core-apple-auth-identity.model';\nimport { CoreUser } from './core-user.model';\nimport { Card } from './card.model';\nimport { AreebaCard } from './providers/areeba-card.model';\nimport { RiderTracking } from './rider-tracking.model';\nimport { Rider } from './rider.model';\nimport { RiderTimeout } from './rider-timeout.model';\nimport { User } from './user.model';\nimport { Cart } from './cart.model';\nimport { LineItem } from './line-item.model';\nimport { CartParticipant } from './cart-participant.model';\nimport { Gallery } from './gallery.model';\nimport { Order } from './order.model';\nimport { RegularOrder } from './providers/regular-order.model';\nimport { CourierOrder } from './providers/courier-order.model';\nimport { OrderDelivery } from './order-delivery.model';\nimport { FinanceSettlement } from './finance-settlement.model';\nimport { DefaultChat } from './default-chat.model';\nimport { TermsAndConditions } from './terms-and-conditions.model';\nimport { SupportReason } from './support-reason.model';\nimport { CancellationReason } from './cancellation-reason.model';\nimport { Payout } from './payout.model';\nimport { Reward } from './reward.model';\nimport { Ticket } from './ticket.model';\nimport { Message } from './message.model';\nimport { AgentPerformance } from './agent-performance.model';\nimport { Chatroom } from './chat-room.model';\nimport {initializeRefreshTokenModel} from \"../../auth\";\nimport { ServiceParent } from './service-parent.model';\nimport { Vendor } from './vendor.model';\nimport { VendorAccessControl } from './vendor-access-control.model';\nimport { ServiceCategory } from './service-category.model';\nimport { ServicePackage } from './service-package.model';\n\n// Regular models (using standard getModelForClass)\nexport const ActivityLogModel: ReturnModelType<typeof ActivityLog> = getModelForClass(ActivityLog);\nexport * from './activity-log.model';\n\nexport const AdminAccessControlModel: ReturnModelType<typeof AdminAccessControl> =\n\tgetModelForClass(AdminAccessControl);\nexport * from './admin-access-control.model';\n\nexport const AdminModel: ReturnModelType<typeof Admin> = getModelForClass(Admin);\nexport * from './admin.model';\n\nexport const UserAppSectionSettingModel: ReturnModelType<typeof UserAppSectionSetting> =\n\tgetModelForClass(UserAppSectionSetting);\nexport * from './user-app-section-setting.model';\n\nexport const AttributeModel: ReturnModelType<typeof Attribute> = getModelForClass(Attribute);\nexport * from './attribute.model';\n\nexport const BannerModel: ReturnModelType<typeof Banner> = getModelForClass(Banner);\nexport * from './banner.model';\n\nexport const BOBFinanceModel: ReturnModelType<typeof BOBFinance> = getModelForClass(BOBFinance);\nexport * from './bob-finance.model';\n\nexport const BrandModel: ReturnModelType<typeof Brand> = getModelForClass(Brand);\nexport * from './brand.model';\n\n// Global models - will be set after initGlobalConnection()\nlet actualCardModel: ReturnModelType<typeof Card> | null = null;\nlet actualCoreAuthIdentityModel: ReturnModelType<typeof CoreAuthIdentity> | null = null;\nlet actualCoreUserModel: ReturnModelType<typeof CoreUser> | null = null;\nlet actualRoleModel: ReturnModelType<typeof Role> | null = null;\n\n// Global discriminator models - will be set after initGlobalConnection()\nlet actualAreebaCardModel: ReturnModelType<typeof AreebaCard> | null = null;\nlet actualCoreEmailAuthIdentityModel: ReturnModelType<typeof CoreEmailAuthIdentity> | null = null;\nlet actualCorePhoneAuthIdentityModel: ReturnModelType<typeof CorePhoneAuthIdentity> | null = null;\nlet actualCoreGoogleAuthIdentityModel: ReturnModelType<typeof CoreGoogleAuthIdentity> | null = null;\nlet actualCoreAppleAuthIdentityModel: ReturnModelType<typeof CoreAppleAuthIdentity> | null = null;\n\n// Export getter functions for global models\nexport function getCardModel(): ReturnModelType<typeof Card> {\n\tif (!actualCardModel) throw new Error('Card model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCardModel;\n}\n\nexport function getAreebaCardModel(): ReturnModelType<typeof AreebaCard> {\n\tif (!actualAreebaCardModel) throw new Error('AreebaCard model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualAreebaCardModel;\n}\n\nexport function getCoreAuthIdentityModel(): ReturnModelType<typeof CoreAuthIdentity> {\n\tif (!actualCoreAuthIdentityModel) throw new Error('CoreAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreAuthIdentityModel;\n}\n\nexport function getCoreEmailAuthIdentityModel(): ReturnModelType<typeof CoreEmailAuthIdentity> {\n\tif (!actualCoreEmailAuthIdentityModel) throw new Error('CoreEmailAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreEmailAuthIdentityModel;\n}\n\nexport function getCorePhoneAuthIdentityModel(): ReturnModelType<typeof CorePhoneAuthIdentity> {\n\tif (!actualCorePhoneAuthIdentityModel) throw new Error('CorePhoneAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCorePhoneAuthIdentityModel;\n}\n\nexport function getCoreGoogleAuthIdentityModel(): ReturnModelType<typeof CoreGoogleAuthIdentity> {\n\tif (!actualCoreGoogleAuthIdentityModel) throw new Error('CoreGoogleAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreGoogleAuthIdentityModel;\n}\n\nexport function getCoreAppleAuthIdentityModel(): ReturnModelType<typeof CoreAppleAuthIdentity> {\n\tif (!actualCoreAppleAuthIdentityModel) throw new Error('CoreAppleAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreAppleAuthIdentityModel;\n}\n\nexport function getCoreUserModel(): ReturnModelType<typeof CoreUser> {\n\tif (!actualCoreUserModel) throw new Error('CoreUser model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreUserModel;\n}\n\nexport function getRoleModel(): ReturnModelType<typeof Role> {\n\tif (!actualRoleModel) throw new Error('Role model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualRoleModel;\n}\n\n// Function to initialize all global models (called from initGlobalConnection)\nexport function initializeGlobalModels(globalConnection: any) {\n\t// Initialize base global models\n\tactualCardModel = getModelForClass(Card, { existingConnection: globalConnection });\n\tactualCoreAuthIdentityModel = getModelForClass(CoreAuthIdentity, { existingConnection: globalConnection });\n\tactualCoreUserModel = getModelForClass(CoreUser, { existingConnection: globalConnection });\n\tactualRoleModel = getModelForClass(Role, { existingConnection: globalConnection });\n\n\t// Initialize discriminator models\n\tactualAreebaCardModel = getDiscriminatorModelForClass(\n\t\tactualCardModel,\n\t\tAreebaCard,\n\t\tCardType.AREEBA,\n\t\t{ existingConnection: globalConnection }\n\t);\n\n\tactualCoreEmailAuthIdentityModel = getDiscriminatorModelForClass(\n\t\tactualCoreAuthIdentityModel,\n\t\tCoreEmailAuthIdentity,\n\t\tCoreAuthIdentityType.EMAIL,\n\t\t{ existingConnection: globalConnection }\n\t);\n\n\tactualCorePhoneAuthIdentityModel = getDiscriminatorModelForClass(\n\t\tactualCoreAuthIdentityModel,\n\t\tCorePhoneAuthIdentity,\n\t\tCoreAuthIdentityType.PHONE,\n\t\t{ existingConnection: globalConnection }\n\t);\n\n\tactualCoreGoogleAuthIdentityModel = getDiscriminatorModelForClass(\n\t\tactualCoreAuthIdentityModel,\n\t\tCoreGoogleAuthIdentity,\n\t\tCoreAuthIdentityType.GOOGLE,\n\t\t{ existingConnection: globalConnection }\n\t);\n\n\tactualCoreAppleAuthIdentityModel = getDiscriminatorModelForClass(\n\t\tactualCoreAuthIdentityModel,\n\t\tCoreAppleAuthIdentity,\n\t\tCoreAuthIdentityType.APPLE,\n\t\t{ existingConnection: globalConnection }\n\t);\n\n\tinitializeRefreshTokenModel(globalConnection);\n\n\tconsole.log('✅ All global models initialized');\n}\n\nexport * from './card.model';\nexport * from './providers/areeba-card.model';\n\nexport const CartModel: ReturnModelType<typeof Cart> = getModelForClass(Cart);\nexport * from './cart.model';\n\nexport const CartParticipantModel: ReturnModelType<typeof CartParticipant> =\n\tgetModelForClass(CartParticipant);\nexport * from './cart-participant.model';\n\nexport const CategoryModel: ReturnModelType<typeof Category> = getModelForClass(Category);\nexport * from './category.model';\n\nexport * from './core-auth-identity.model';\nexport * from './providers/core-apple-auth-identity.model';\nexport * from './providers/core-email-auth-identity.model';\nexport * from './providers/core-google-auth-identity.model';\nexport * from './providers/core-phone-auth-identity.model';\nexport * from './core-user.model';\nexport * from './role.model';\n\nexport const CounterModel: ReturnModelType<typeof Counter> = getModelForClass(Counter);\nexport * from './counter.model';\n\nexport const CouponModel: ReturnModelType<typeof Coupon> = getModelForClass(Coupon);\nexport const CustomCouponModel: ReturnModelType<typeof CustomCoupon> = getDiscriminatorModelForClass(\n\tCouponModel,\n\tCustomCoupon,\n\tCouponType.CUSTOM_COUPON\n);\nexport const GlobalCouponModel: ReturnModelType<typeof GlobalCoupon> = getDiscriminatorModelForClass(\n\tCouponModel,\n\tGlobalCoupon,\n\tCouponType.GLOBAL\n);\nexport const IndividualStoreCouponModel: ReturnModelType<typeof IndividualStoreCoupon> =\n\tgetDiscriminatorModelForClass(CouponModel, IndividualStoreCoupon, CouponType.INDIVIDUAL_STORE);\nexport const IndividualUserCouponModel: ReturnModelType<typeof IndividualUserCoupon> =\n\tgetDiscriminatorModelForClass(CouponModel, IndividualUserCoupon, CouponType.INDIVIDUAL_USER);\nexport const ReferralCodeCouponModel: ReturnModelType<typeof ReferralCodeCoupon> =\n\tgetDiscriminatorModelForClass(CouponModel, ReferralCodeCoupon, CouponType.REFERRAL_CODE);\nexport const ReferralRewardCouponModel: ReturnModelType<typeof ReferralRewardCoupon> =\n\tgetDiscriminatorModelForClass(CouponModel, ReferralRewardCoupon, CouponType.REFERRAL_REWARD);\nexport * from './coupon.model';\nexport * from './providers/custom-coupon.model';\nexport * from './providers/global-coupon.model';\nexport * from './providers/individual-store-coupon.model';\nexport * from './providers/individual-user-coupon.model';\nexport * from './providers/referral-code-coupon.model';\nexport * from './providers/referral-reward-coupon.model';\n\nexport const DealSettingModel: ReturnModelType<typeof DealSetting> = getModelForClass(DealSetting);\nexport * from './deal-setting.model';\n\nexport const DishModel: ReturnModelType<typeof Dish> = getModelForClass(Dish);\nexport * from './dish.model';\n\nexport const FaqModel: ReturnModelType<typeof Faq> = getModelForClass(Faq);\nexport * from './faq.model';\n\nexport const FavouriteModel: ReturnModelType<typeof Favourite> = getModelForClass(Favourite);\nexport * from './favourite.model';\n\nexport const FeaturedSettingModel: ReturnModelType<typeof FeaturedSetting> =\n\tgetModelForClass(FeaturedSetting);\nexport * from './featured-setting.model';\n\nexport const FilterContainerModel: ReturnModelType<typeof FilterContainer> =\n\tgetModelForClass(FilterContainer);\nexport * from './filter-container.model';\n\nexport const FinanceSettlementModel: ReturnModelType<typeof FinanceSettlement> =\n\tgetModelForClass(FinanceSettlement);\nexport * from './finance-settlement.model';\n\nexport const GalleryModel: ReturnModelType<typeof Gallery> = getModelForClass(Gallery);\nexport * from './gallery.model';\n\nexport const LineItemModel: ReturnModelType<typeof LineItem> = getModelForClass(LineItem);\nexport * from './line-item.model';\n\nexport const ListContainerModel: ReturnModelType<typeof ListContainer> = getModelForClass(ListContainer);\nexport * from './list-container.model';\n\nexport const LoyaltyPointCategoryModel: ReturnModelType<typeof LoyaltyPointCategory> =\n\tgetModelForClass(LoyaltyPointCategory);\nexport * from './loyalty-point-category.model';\n\nexport const LoyaltyPointSettingModel: ReturnModelType<typeof LoyaltyPointSetting> =\n\tgetModelForClass(LoyaltyPointSetting);\nexport * from './loyalty-point-setting.model';\n\nexport const MarketingModel: ReturnModelType<typeof Marketing> = getModelForClass(Marketing);\nexport const Buy1Get1MarketingModel: ReturnModelType<typeof Buy1Get1Marketing> =\n\tgetDiscriminatorModelForClass(MarketingModel, Buy1Get1Marketing, MarketingType.BUY1GET1);\nexport const DiscountMarketingModel: ReturnModelType<typeof DiscountMarketing> =\n\tgetDiscriminatorModelForClass(MarketingModel, DiscountMarketing, MarketingType.DISCOUNT);\nexport const FeaturedMarketingModel: ReturnModelType<typeof FeaturedMarketing> =\n\tgetDiscriminatorModelForClass(MarketingModel, FeaturedMarketing, MarketingType.FEATURED);\nexport const FreeDeliveryMarketingModel: ReturnModelType<typeof FreeDeliveryMarketing> =\n\tgetDiscriminatorModelForClass(MarketingModel, FreeDeliveryMarketing, MarketingType.FREE_DELIVERY);\nexport const LoyaltyPointMarketingModel: ReturnModelType<typeof LoyaltyPointMarketing> =\n\tgetDiscriminatorModelForClass(MarketingModel, LoyaltyPointMarketing, MarketingType.LOYALTY_POINT);\nexport const PunchMarketingModel: ReturnModelType<typeof PunchMarketing> = getDiscriminatorModelForClass(\n\tMarketingModel,\n\tPunchMarketing,\n\tMarketingType.PUNCH_MARKETING\n);\nexport * from './marketing.model';\nexport * from './providers/buy1-get1-marketing.model';\nexport * from './providers/discount-marketing.model';\nexport * from './providers/featured-marketing.model';\nexport * from './providers/free-delivery-marketing.model';\nexport * from './providers/loyalty-point-marketing.model';\nexport * from './providers/punch-marketing.model';\n\nexport const MealPlanModel: ReturnModelType<typeof MealPlan> = getModelForClass(MealPlan);\nexport * from './meal-plan.model';\n\nexport const NotificationModel: ReturnModelType<typeof Notification> = getModelForClass(Notification);\nexport * from './notification.model';\n\nexport const NutritionModel: ReturnModelType<typeof Nutrition> = getModelForClass(Nutrition);\nexport * from './nutrition.model';\n\nexport const OrderModel: ReturnModelType<typeof Order> = getModelForClass(Order);\nexport const RegularOrderModel: ReturnModelType<typeof RegularOrder> = getDiscriminatorModelForClass(\n\tOrderModel,\n\tRegularOrder,\n\tOrderType.REGULAR\n);\nexport const CourierOrderModel: ReturnModelType<typeof CourierOrder> = getDiscriminatorModelForClass(\n\tOrderModel,\n\tCourierOrder,\n\tOrderType.COURIER\n);\nexport * from './order.model';\nexport * from './providers/regular-order.model';\nexport * from './providers/courier-order.model';\n\nexport const OrderDeliveryModel: ReturnModelType<typeof OrderDelivery> = getModelForClass(OrderDelivery);\nexport * from './order-delivery.model';\n\nexport const ParentModel: ReturnModelType<typeof Parent> = getModelForClass(Parent);\nexport * from './parent.model';\n\nexport const PayoutModel: ReturnModelType<typeof Payout> = getModelForClass(Payout);\nexport const ShopPayoutModel: ReturnModelType<typeof ShopPayout> = getDiscriminatorModelForClass(\n\tPayoutModel,\n\tShopPayout,\n\tPayoutType.SHOP\n);\nexport const RiderPayoutModel: ReturnModelType<typeof RiderPayout> = getDiscriminatorModelForClass(\n\tPayoutModel,\n\tRiderPayout,\n\tPayoutType.RIDER\n);\nexport * from './payout.model';\nexport * from './providers/shop-payout.model';\nexport * from './providers/rider-payout.model';\n\nexport const ProductMarketingModel: ReturnModelType<typeof ProductMarketing> =\n\tgetModelForClass(ProductMarketing);\nexport * from './product-marketing.model';\n\nexport const ProductModel: ReturnModelType<typeof Product> = getModelForClass(Product);\nexport * from './product.model';\n\nexport const PunchMarketingHistoryModel: ReturnModelType<typeof PunchMarketingHistory> =\n\tgetModelForClass(PunchMarketingHistory);\nexport * from './punch-marketing-history.model';\n\nexport const RatingSettingModel: ReturnModelType<typeof RatingSetting> = getModelForClass(RatingSetting);\nexport * from './rating-setting.model';\n\nexport const ReferralSettingModel: ReturnModelType<typeof ReferralSetting> =\n\tgetModelForClass(ReferralSetting);\nexport * from './referral-setting.model';\n\nexport const RequestAreaModel: ReturnModelType<typeof RequestArea> = getModelForClass(RequestArea);\nexport * from './request-area.model';\n\nexport const RiderReviewModel: ReturnModelType<typeof RiderReview> = getModelForClass(RiderReview);\nexport * from './rider-review.model';\n\nexport const RiderTimeoutModel: ReturnModelType<typeof RiderTimeout> = getModelForClass(RiderTimeout);\nexport * from './rider-timeout.model';\n\nexport const RiderTrackingModel: ReturnModelType<typeof RiderTracking> = getModelForClass(RiderTracking);\nexport * from './rider-tracking.model';\n\nexport const RiderModel: ReturnModelType<typeof Rider> = getModelForClass(Rider);\nexport * from './rider.model';\n\nexport const SettingModel: ReturnModelType<typeof Setting> = getModelForClass(Setting);\nexport * from './setting.model';\n\nexport const ShopAccessControlModel: ReturnModelType<typeof ShopAccessControl> =\n\tgetModelForClass(ShopAccessControl);\nexport * from './shop-access-control.model';\n\nexport const ShopCategoryModel: ReturnModelType<typeof ShopCategory> = getModelForClass(ShopCategory);\nexport * from './shop-category.model';\n\nexport const ShopMealPlanModel: ReturnModelType<typeof ShopMealPlan> = getModelForClass(ShopMealPlan);\nexport * from './shop-meal-plan.model';\n\nexport const ShopReviewModel: ReturnModelType<typeof ShopReview> = getModelForClass(ShopReview);\nexport * from './shop-review.model';\n\nexport const ShopModel: ReturnModelType<typeof Shop> = getModelForClass(Shop);\nexport * from './shop.model';\n\nexport const SubscriptionSettingModel: ReturnModelType<typeof SubscriptionSetting> =\n\tgetModelForClass(SubscriptionSetting);\nexport * from './subscription-setting.model';\n\nexport const SubscriptionModel: ReturnModelType<typeof Subscription> = getModelForClass(Subscription);\nexport * from './subscription.model';\n\nexport const TagModel: ReturnModelType<typeof Tag> = getModelForClass(Tag);\nexport * from './tag.model';\n\nexport const UserModel: ReturnModelType<typeof User> = getModelForClass(User);\nexport * from './user.model';\n\nexport const ZoneModel: ReturnModelType<typeof Zone> = getModelForClass(Zone);\nexport * from './zone.model';\n\nexport const DefaultChatModel: ReturnModelType<typeof DefaultChat> = getModelForClass(DefaultChat);\nexport * from './default-chat.model';\n\nexport const TermsAndConditionsModel: ReturnModelType<typeof TermsAndConditions> =\n\tgetModelForClass(TermsAndConditions);\nexport * from './terms-and-conditions.model';\n\nexport const SupportReasonModel: ReturnModelType<typeof SupportReason> = getModelForClass(SupportReason);\nexport * from './support-reason.model';\n\nexport const CancellationReasonModel: ReturnModelType<typeof CancellationReason> =\n\tgetModelForClass(CancellationReason);\nexport * from './cancellation-reason.model';\n\nexport * from './embedded/trip-leg.mode';\nexport * from './embedded/rider-assignment-model';\n\nexport const RewardModel: ReturnModelType<typeof Reward> = getModelForClass(Reward);\nexport * from './reward.model';\n\nexport const TicketModel: ReturnModelType<typeof Ticket> = getModelForClass(Ticket);\nexport * from './ticket.model';\n\nexport const MessageModel: ReturnModelType<typeof Message> = getModelForClass(Message);\nexport * from './message.model';\n\nexport const AgentPerformanceModel: ReturnModelType<typeof AgentPerformance> =\n\tgetModelForClass(AgentPerformance);\nexport * from './agent-performance.model';\n\nexport const ChatroomModel: ReturnModelType<typeof Chatroom> = getModelForClass(Chatroom);\nexport * from './chat-room.model';\n\nexport * from './embedded/chat-participant.model';\n\nexport const ServiceParentModel: ReturnModelType<typeof ServiceParent> = getModelForClass(ServiceParent);\nexport * from './service-parent.model';\n\nexport const VendorModel: ReturnModelType<typeof Vendor> = getModelForClass(Vendor);\nexport * from './vendor.model';\n\nexport const VendorAccessControlModel: ReturnModelType<typeof VendorAccessControl> = getModelForClass(VendorAccessControl);\nexport * from './vendor-access-control.model';\n\nexport const ServiceCategoryModel: ReturnModelType<typeof ServiceCategory> = getModelForClass(ServiceCategory);\nexport * from './service-category.model'; \n\nexport const ServicePackageModel: ReturnModelType<typeof ServicePackage> = getModelForClass(ServicePackage);\nexport * from './service-package.model';"]}
@@ -22,6 +22,7 @@ export declare class Rider extends TimeStamps {
22
22
  fcmToken?: string[];
23
23
  lastLogin?: Date;
24
24
  lastOnline?: Date;
25
+ lastActive?: Date;
25
26
  nationalIdDocument?: string;
26
27
  vehicleRegistrationDocument?: string;
27
28
  vehicleType?: string;
@@ -38,6 +39,7 @@ export declare class Rider extends TimeStamps {
38
39
  reviews?: Ref<RiderReview>[];
39
40
  avgRating?: number;
40
41
  shift?: ShiftType;
42
+ fullTimeEmployee: boolean;
41
43
  zone?: Ref<Zone>;
42
44
  riderType?: RiderType;
43
45
  bagSize?: RiderBagSize;
@@ -35,6 +35,7 @@ let Rider = class Rider extends defaultClasses_1.TimeStamps {
35
35
  fcmToken;
36
36
  lastLogin;
37
37
  lastOnline;
38
+ lastActive;
38
39
  nationalIdDocument;
39
40
  vehicleRegistrationDocument;
40
41
  vehicleType;
@@ -51,6 +52,7 @@ let Rider = class Rider extends defaultClasses_1.TimeStamps {
51
52
  reviews;
52
53
  avgRating;
53
54
  shift;
55
+ fullTimeEmployee;
54
56
  zone;
55
57
  riderType;
56
58
  bagSize;
@@ -117,13 +119,17 @@ __decorate([
117
119
  __metadata("design:type", Array)
118
120
  ], Rider.prototype, "fcmToken", void 0);
119
121
  __decorate([
120
- (0, typegoose_1.prop)({ type: Date, default: Date.now }),
122
+ (0, typegoose_1.prop)({ type: Date }),
121
123
  __metadata("design:type", Date)
122
124
  ], Rider.prototype, "lastLogin", void 0);
123
125
  __decorate([
124
- (0, typegoose_1.prop)({ type: Date, default: Date.now }),
126
+ (0, typegoose_1.prop)({ type: Date }),
125
127
  __metadata("design:type", Date)
126
128
  ], Rider.prototype, "lastOnline", void 0);
129
+ __decorate([
130
+ (0, typegoose_1.prop)({ type: Date }),
131
+ __metadata("design:type", Date)
132
+ ], Rider.prototype, "lastActive", void 0);
127
133
  __decorate([
128
134
  (0, typegoose_1.prop)({ type: String }),
129
135
  __metadata("design:type", String)
@@ -188,6 +194,10 @@ __decorate([
188
194
  (0, typegoose_1.prop)({ type: String, enum: enum_1.ShiftType, default: enum_1.ShiftType.DAY }),
189
195
  __metadata("design:type", String)
190
196
  ], Rider.prototype, "shift", void 0);
197
+ __decorate([
198
+ (0, typegoose_1.prop)({ type: Boolean, default: false }),
199
+ __metadata("design:type", Boolean)
200
+ ], Rider.prototype, "fullTimeEmployee", void 0);
191
201
  __decorate([
192
202
  (0, typegoose_1.prop)({ ref: () => zone_model_1.Zone }),
193
203
  __metadata("design:type", Object)
@@ -1 +1 @@
1
- {"version":3,"file":"rider.model.js","sourceRoot":"/","sources":["libraries/mongo/models/rider.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2E;AAE3E,4EAAqE;AACrE,oEAA0D;AAC1D,6DAAmD;AACnD,6CAAoC;AACpC,6CAAoC;AACpC,kDAAsH;AACtH,4EAAkE;AAElE,iEAAkE;AAmB3D,IAAM,KAAK,GAAX,MAAM,KAAM,SAAQ,2BAAU;IAE7B,IAAI,CAAU;IAGd,KAAK,CAAU;IAGf,KAAK,CAAU;IAGf,QAAQ,CAAU;IAGlB,MAAM,CAAU;IAGhB,WAAW,CAAU;IAGrB,QAAQ,CAAY;IAGpB,MAAM,CAAU;IAGhB,MAAM,CAAU;IAGhB,GAAG,CAAQ;IAGX,UAAU,CAAU;IAGpB,UAAU,CAAc;IAGxB,QAAQ,CAAY;IAGpB,SAAS,CAAQ;IAGjB,UAAU,CAAQ;IAGlB,kBAAkB,CAAU;IAG5B,2BAA2B,CAAU;IAGrC,WAAW,CAAU;IAGrB,aAAa,CAAU;IAGvB,OAAO,CAAU;IAGjB,QAAQ,CAAe;IA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,KAAK,WAAW,IAAI;QAC/D,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAyB,CAAC;QACvD,IAAI,MAAM,EAAE,QAAQ,EAAE,CAAC;YACtB,MAAM,CAAC,QAAQ,GAAG,MAAM,IAAA,uBAAY,EAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YACtD,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACxB,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;IAED,IAAA,iBAAK,EAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;IAC/B,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;GAC/D,KAAK,CA8HjB","sourcesContent":["import { index, modelOptions, pre, prop, Ref } from '@typegoose/typegoose';\nimport bcrypt from 'bcryptjs';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { GeoLocation } from './shared/geo-location.model';\nimport { RiderReview } from './rider-review.model';\nimport { Zone } from './zone.model';\nimport { Shop } from './shop.model';\nimport { CreatedBy, Language, LiveStatus, RiderBagSize, RiderType, ShiftType, Status } from '../../../utilities/enum';\nimport { RiderEquipment } from './embedded/rider-equipment.model';\nimport { Query } from 'mongoose';\nimport { hashPassword } from '../../../utilities/common/password';\n\n@pre<Rider>('save', async function (next) {\n\tif (this.isModified('password')) {\n\t\tthis.password = await hashPassword(this.password);\n\t}\n\tnext();\n})\n@pre<Query<any, Rider>>('findOneAndUpdate', async function (next) {\n\tconst update = this.getUpdate() as Record<string, any>;\n\tif (update?.password) {\n\t\tupdate.password = await hashPassword(update.password);\n\t\tthis.setUpdate(update);\n\t}\n\tnext();\n})\n\n@index({ location: '2dsphere' })\n@modelOptions({ schemaOptions: { collection: 'riders', timestamps: true } })\nexport class Rider extends TimeStamps {\n\t@prop({ type: String, required: true })\n\tpublic name!: string;\n\n\t@prop({ type: String })\n\tpublic image?: string;\n\n\t@prop({ type: String, required: true })\n\tpublic email!: string;\n\n\t@prop({ type: String })\n\tpublic password!: string;\n\n\t@prop({ type: String })\n\tpublic gender?: string;\n\n\t@prop({ type: String })\n\tpublic countryCode?: string;\n\n\t@prop({ type: String, enum: Language, default: Language.EN })\n\tpublic language?: Language;\n\n\t@prop({ type: String })\n\tpublic number?: string;\n\n\t@prop({ type: String, enum: Status, default: Status.INACTIVE })\n\tpublic status?: Status;\n\n\t@prop({ type: Date })\n\tpublic dob?: Date;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic totalOrder?: number;\n\n\t@prop({ type: String, enum: LiveStatus, default: LiveStatus.OFFLINE })\n\tpublic liveStatus?: LiveStatus;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic fcmToken?: string[];\n\n\t@prop({ type: Date, default: Date.now })\n\tpublic lastLogin?: Date;\n\n\t@prop({ type: Date, default: Date.now })\n\tpublic lastOnline?: Date;\n\n\t@prop({ type: String })\n\tpublic nationalIdDocument?: string;\n\n\t@prop({ type: String })\n\tpublic vehicleRegistrationDocument?: string;\n\n\t@prop({ type: String })\n\tpublic vehicleType?: string;\n\n\t@prop({ type: String })\n\tpublic vehicleNumber?: string;\n\n\t@prop({ type: String })\n\tpublic address?: string;\n\n\t@prop({ type: GeoLocation })\n\tpublic location?: GeoLocation;\n\n\t@prop({ type: String })\n\tpublic forgetToken?: string;\n\n\t@prop({ type: Date })\n\tpublic forgetExpired?: Date;\n\n\t@prop({ type: Date })\n\tpublic lastLocationUpdateAt?: Date;\n\n\t@prop({ type: String })\n\tpublic contractImage?: string;\n\n\t@prop({ type: String, enum: CreatedBy, default: CreatedBy.ADMIN })\n\tpublic createdBy?: CreatedBy;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isLogin?: boolean;\n\n\t@prop({ type: String })\n\tpublic lastLoginDeviceId?: string;\n\n\t@prop({ type: () => [String], ref: () => RiderReview, default: [] })\n\tpublic reviews?: Ref<RiderReview>[];\n\n\t@prop({ type: Number, default: 0 })\n\tpublic avgRating?: number;\n\n\t@prop({ type: String, enum: ShiftType, default: ShiftType.DAY })\n\tpublic shift?: ShiftType;\n\n\t@prop({ ref: () => Zone })\n\tpublic zone?: Ref<Zone>;\n\n\t@prop({ type: String, enum: RiderType, default: RiderType.LYXA_RIDER })\n\tpublic riderType?: RiderType;\n\n\t@prop({ type: String, enum: RiderBagSize, default: RiderBagSize.REGULAR })\n\tpublic bagSize?: RiderBagSize;\n\n\t@prop({ type: String, ref: () => Shop })\n\tpublic shop?: Ref<Shop>;\n\n\t@prop({ type: String })\n\tpublic riderNationality?: string;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isCashSettlementLimitReached?: boolean;\n\n\t@prop({ type: Date, default: null })\n\tpublic firstActiveAt?: Date | null;\n\n\t@prop({ type: () => [RiderEquipment], default: [] })\n\tpublic riderEquipments?: RiderEquipment[];\n\n\t@prop({ type: String })\n\tpublic insurance?: string;\n\n\t@prop({ type: String })\n\tpublic powerOfAttorney?: string;\n\n\t@prop({ type: String })\n\tpublic proofOfResidence?: string;\n}\n"]}
1
+ {"version":3,"file":"rider.model.js","sourceRoot":"/","sources":["libraries/mongo/models/rider.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2E;AAE3E,4EAAqE;AACrE,oEAA0D;AAC1D,6DAAmD;AACnD,6CAAoC;AACpC,6CAAoC;AACpC,kDAQiC;AACjC,4EAAkE;AAElE,iEAAkE;AAkB3D,IAAM,KAAK,GAAX,MAAM,KAAM,SAAQ,2BAAU;IAE7B,IAAI,CAAU;IAGd,KAAK,CAAU;IAGf,KAAK,CAAU;IAGf,QAAQ,CAAU;IAGlB,MAAM,CAAU;IAGhB,WAAW,CAAU;IAGrB,QAAQ,CAAY;IAGpB,MAAM,CAAU;IAGhB,MAAM,CAAU;IAGhB,GAAG,CAAQ;IAGX,UAAU,CAAU;IAGpB,UAAU,CAAc;IAGxB,QAAQ,CAAY;IAGpB,SAAS,CAAQ;IA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AhBjB,IAAA,eAAG,EAAQ,MAAM,EAAE,KAAK,WAAW,IAAI;QACvC,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YACjC,IAAI,CAAC,QAAQ,GAAG,MAAM,IAAA,uBAAY,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACnD,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;IACD,IAAA,eAAG,EAAoB,kBAAkB,EAAE,KAAK,WAAW,IAAI;QAC/D,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAyB,CAAC;QACvD,IAAI,MAAM,EAAE,QAAQ,EAAE,CAAC;YACtB,MAAM,CAAC,QAAQ,GAAG,MAAM,IAAA,uBAAY,EAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YACtD,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACxB,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;IACD,IAAA,iBAAK,EAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;IAC/B,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;GAC/D,KAAK,CAoIjB","sourcesContent":["import { index, modelOptions, pre, prop, Ref } from '@typegoose/typegoose';\nimport bcrypt from 'bcryptjs';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { GeoLocation } from './shared/geo-location.model';\nimport { RiderReview } from './rider-review.model';\nimport { Zone } from './zone.model';\nimport { Shop } from './shop.model';\nimport {\n\tCreatedBy,\n\tLanguage,\n\tLiveStatus,\n\tRiderBagSize,\n\tRiderType,\n\tShiftType,\n\tStatus,\n} from '../../../utilities/enum';\nimport { RiderEquipment } from './embedded/rider-equipment.model';\nimport { Query } from 'mongoose';\nimport { hashPassword } from '../../../utilities/common/password';\n\n@pre<Rider>('save', async function (next) {\n\tif (this.isModified('password')) {\n\t\tthis.password = await hashPassword(this.password);\n\t}\n\tnext();\n})\n@pre<Query<any, Rider>>('findOneAndUpdate', async function (next) {\n\tconst update = this.getUpdate() as Record<string, any>;\n\tif (update?.password) {\n\t\tupdate.password = await hashPassword(update.password);\n\t\tthis.setUpdate(update);\n\t}\n\tnext();\n})\n@index({ location: '2dsphere' })\n@modelOptions({ schemaOptions: { collection: 'riders', timestamps: true } })\nexport class Rider extends TimeStamps {\n\t@prop({ type: String, required: true })\n\tpublic name!: string;\n\n\t@prop({ type: String })\n\tpublic image?: string;\n\n\t@prop({ type: String, required: true })\n\tpublic email!: string;\n\n\t@prop({ type: String })\n\tpublic password!: string;\n\n\t@prop({ type: String })\n\tpublic gender?: string;\n\n\t@prop({ type: String })\n\tpublic countryCode?: string;\n\n\t@prop({ type: String, enum: Language, default: Language.EN })\n\tpublic language?: Language;\n\n\t@prop({ type: String })\n\tpublic number?: string;\n\n\t@prop({ type: String, enum: Status, default: Status.INACTIVE })\n\tpublic status?: Status;\n\n\t@prop({ type: Date })\n\tpublic dob?: Date;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic totalOrder?: number;\n\n\t@prop({ type: String, enum: LiveStatus, default: LiveStatus.OFFLINE })\n\tpublic liveStatus?: LiveStatus;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic fcmToken?: string[];\n\n\t@prop({ type: Date })\n\tpublic lastLogin?: Date;\n\n\t@prop({ type: Date })\n\tpublic lastOnline?: Date;\n\n\t@prop({ type: Date })\n\tpublic lastActive?: Date;\n\n\t@prop({ type: String })\n\tpublic nationalIdDocument?: string;\n\n\t@prop({ type: String })\n\tpublic vehicleRegistrationDocument?: string;\n\n\t@prop({ type: String })\n\tpublic vehicleType?: string;\n\n\t@prop({ type: String })\n\tpublic vehicleNumber?: string;\n\n\t@prop({ type: String })\n\tpublic address?: string;\n\n\t@prop({ type: GeoLocation })\n\tpublic location?: GeoLocation;\n\n\t@prop({ type: String })\n\tpublic forgetToken?: string;\n\n\t@prop({ type: Date })\n\tpublic forgetExpired?: Date;\n\n\t@prop({ type: Date })\n\tpublic lastLocationUpdateAt?: Date;\n\n\t@prop({ type: String })\n\tpublic contractImage?: string;\n\n\t@prop({ type: String, enum: CreatedBy, default: CreatedBy.ADMIN })\n\tpublic createdBy?: CreatedBy;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isLogin?: boolean;\n\n\t@prop({ type: String })\n\tpublic lastLoginDeviceId?: string;\n\n\t@prop({ type: () => [String], ref: () => RiderReview, default: [] })\n\tpublic reviews?: Ref<RiderReview>[];\n\n\t@prop({ type: Number, default: 0 })\n\tpublic avgRating?: number;\n\n\t@prop({ type: String, enum: ShiftType, default: ShiftType.DAY })\n\tpublic shift?: ShiftType;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic fullTimeEmployee: boolean;\n\n\t@prop({ ref: () => Zone })\n\tpublic zone?: Ref<Zone>;\n\n\t@prop({ type: String, enum: RiderType, default: RiderType.LYXA_RIDER })\n\tpublic riderType?: RiderType;\n\n\t@prop({ type: String, enum: RiderBagSize, default: RiderBagSize.REGULAR })\n\tpublic bagSize?: RiderBagSize;\n\n\t@prop({ type: String, ref: () => Shop })\n\tpublic shop?: Ref<Shop>;\n\n\t@prop({ type: String })\n\tpublic riderNationality?: string;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isCashSettlementLimitReached?: boolean;\n\n\t@prop({ type: Date, default: null })\n\tpublic firstActiveAt?: Date | null;\n\n\t@prop({ type: () => [RiderEquipment], default: [] })\n\tpublic riderEquipments?: RiderEquipment[];\n\n\t@prop({ type: String })\n\tpublic insurance?: string;\n\n\t@prop({ type: String })\n\tpublic powerOfAttorney?: string;\n\n\t@prop({ type: String })\n\tpublic proofOfResidence?: string;\n}\n"]}
@@ -7,6 +7,14 @@ export declare class ServicePackage extends TimeStamps {
7
7
  name: string;
8
8
  vendor: Ref<Vendor>;
9
9
  category: Ref<ServiceCategory>;
10
+ price: number;
11
+ secondaryPrice: number;
12
+ duration: number;
13
+ numberOfProfessionals: number;
14
+ description?: string;
10
15
  image?: string;
16
+ addons?: Ref<ServicePackage>[];
11
17
  status?: Status;
18
+ includeMaterials: boolean;
19
+ materialsCost?: number;
12
20
  }