@lyxa.ai/core 1.4.322-alpha.1 → 1.4.323
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/libraries/google-location/google-location.service.js +0 -10
- package/dist/libraries/google-location/google-location.service.js.map +1 -1
- package/dist/libraries/llm/providers/openai-provider.js +5 -15
- package/dist/libraries/llm/providers/openai-provider.js.map +1 -1
- package/dist/libraries/mongo/models/index.d.ts +0 -3
- package/dist/libraries/mongo/models/index.js +3 -6
- package/dist/libraries/mongo/models/index.js.map +1 -1
- package/dist/libraries/mongo/models/providers/global-coupon.model.d.ts +0 -2
- package/dist/libraries/mongo/models/providers/global-coupon.model.js +0 -20
- package/dist/libraries/mongo/models/providers/global-coupon.model.js.map +1 -1
- package/dist/libraries/mongo/models/user-shop-history.model.d.ts +1 -6
- package/dist/libraries/mongo/models/user-shop-history.model.js +3 -22
- package/dist/libraries/mongo/models/user-shop-history.model.js.map +1 -1
- package/dist/libraries/mongo/models/user.model.d.ts +1 -2
- package/dist/libraries/mongo/models/user.model.js +1 -6
- package/dist/libraries/mongo/models/user.model.js.map +1 -1
- package/dist/libraries/socket/events/chatroom-message-send.socket.event.d.ts +25 -25
- package/dist/libraries/socket/events/order-actions.socket.event.d.ts +32 -32
- package/dist/libraries/socket/events/rider-location-update.socket.event.d.ts +8 -8
- package/dist/libraries/socket/events/ticket-actions.socket.event.d.ts +8 -8
- package/dist/libraries/socket/events/ticket-assign.socket.event.d.ts +28 -28
- package/dist/types/README.md +1 -1
- package/dist/types/package.json +1 -1
- package/dist/types/utilities/validation/common-validation.d.ts +12 -12
- package/dist/utilities/pagination.d.ts +3 -3
- package/dist/utilities/validation/common-validation.d.ts +72 -72
- package/package.json +1 -1
- package/dist/libraries/mongo/models/user-coupon.model.d.ts +0 -11
- package/dist/libraries/mongo/models/user-coupon.model.js +0 -52
- package/dist/libraries/mongo/models/user-coupon.model.js.map +0 -1
|
@@ -128,16 +128,6 @@ let GoogleLocationService = class GoogleLocationService {
|
|
|
128
128
|
const roundedLng = parseFloat(longitude).toFixed(4);
|
|
129
129
|
const cacheKey = `maps:geocode:${roundedLat}:${roundedLng}`;
|
|
130
130
|
try {
|
|
131
|
-
const cached = await this.redisService.getCachedObject(cacheKey);
|
|
132
|
-
if (cached !== undefined) {
|
|
133
|
-
this.logger.logger.info('Google Reverse Geocode Cache HIT', { cacheKey, roundedLat, roundedLng });
|
|
134
|
-
return cached;
|
|
135
|
-
}
|
|
136
|
-
this.logger.logger.info('Google Reverse Geocode Cache MISS - Calling API', {
|
|
137
|
-
cacheKey,
|
|
138
|
-
latitude,
|
|
139
|
-
longitude,
|
|
140
|
-
});
|
|
141
131
|
const apiKey = await this.secretManager.getKey('GOOGLE_MAPS_API_KEY');
|
|
142
132
|
if (!apiKey) {
|
|
143
133
|
this.logger.logger.error('GOOGLE_MAPS_API_KEY is missing in SecretManager');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"google-location.service.js","sourceRoot":"/","sources":["libraries/google-location/google-location.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mCAAyC;AACzC,qEAAgE;AAChE,wCAAkD;AAClD,oCAAwC;AACxC,sCAAuC;AAWhC,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAEL;IACA;IACA;IACA;IAJ5B,YAC4B,MAA4B,EAC5B,aAAmC,EACnC,YAA0B,EAC1B,MAAkB;QAHlB,WAAM,GAAN,MAAM,CAAsB;QAC5B,kBAAa,GAAb,aAAa,CAAsB;QACnC,iBAAY,GAAZ,YAAY,CAAc;QAC1B,WAAM,GAAN,MAAM,CAAY;IAC3C,CAAC;IAEG,KAAK,CAAC,eAAe,CAAC,KAAiC;QAC7D,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,WAAW,EAAE,GAAG,KAAK,CAAC;QAE3D,IAAI,CAAC,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;YACzB,IAAI,CAAC,MAAM,CAAC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AE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;YAC5E,MAAM,KAAK,CAAC;QACb,CAAC;IACF,CAAC;CACD,CAAA;AAnKY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,gBAAO,GAAE;IAGP,WAAA,IAAA,eAAM,GAAE,CAAA;IACR,WAAA,IAAA,eAAM,GAAE,CAAA;IACR,WAAA,IAAA,eAAM,GAAE,CAAA;IACR,WAAA,IAAA,eAAM,GAAE,CAAA;qCAH0B,6CAAoB;QACb,8BAAoB;QACrB,oBAAY;QAClB,mBAAU;GALlC,qBAAqB,CAmKjC","sourcesContent":["import { Inject, Service } from 'typedi';\nimport { GoogleLocationClient } from './google-location.client';\nimport { SecretManagerService } from '../secrets';\nimport { RedisService } from '../redis';\nimport { LyxaLogger } from '../logger';\nimport {\n\tGoogleAutocompleteInputDTO,\n\tGoogleAutocompleteResponse,\n\tGooglePlaceDetailsInputDTO,\n\tGooglePlaceDetailsResponse,\n\tGoogleReverseGeocodeInputDTO,\n\tGoogleReverseGeocodeResponse,\n} from './google-location.dto';\n\n@Service()\nexport class GoogleLocationService {\n\tconstructor(\n\t\t@Inject() private readonly client: GoogleLocationClient,\n\t\t@Inject() private readonly secretManager: SecretManagerService,\n\t\t@Inject() private readonly redisService: RedisService,\n\t\t@Inject() private readonly logger: LyxaLogger\n\t) {}\n\n\tpublic async getAutocomplete(input: GoogleAutocompleteInputDTO): Promise<GoogleAutocompleteResponse> {\n\t\tconst { searchText, sessionToken, ...otherParams } = input;\n\n\t\tif (!searchText?.trim()) {\n\t\t\tthis.logger.logger.info('Google Autocomplete skipped: empty input provided');\n\t\t\treturn { predictions: [], status: 'OK' };\n\t\t}\n\n\t\tconst queryParams: Record<string, string> = { input: searchText, ...otherParams };\n\t\tif (sessionToken) queryParams.sessiontoken = sessionToken;\n\n\t\tconst querySummary = Object.entries(queryParams)\n\t\t\t.map(([k, v]) => `${k}:${v}`)\n\t\t\t.join('|');\n\t\tconst cacheKey = `maps:autocomplete:${this.redisService.sanitizeKey(querySummary)}`;\n\n\t\ttry {\n\t\t\tconst cached = await this.redisService.getCachedObject<GoogleAutocompleteResponse>(cacheKey);\n\t\t\tif (cached !== undefined) {\n\t\t\t\tthis.logger.logger.info('Google Autocomplete Cache HIT', { cacheKey, input });\n\t\t\t\treturn cached;\n\t\t\t}\n\n\t\t\tthis.logger.logger.info('Google Autocomplete Cache MISS - Calling API', { cacheKey, input });\n\n\t\t\tconst apiKey = await this.secretManager.getKey('GOOGLE_MAPS_API_KEY');\n\t\t\tif (!apiKey) {\n\t\t\t\tthis.logger.logger.error('GOOGLE_MAPS_API_KEY is missing in SecretManager');\n\t\t\t\tthrow new Error('GOOGLE_MAPS_API_KEY is not configured');\n\t\t\t}\n\n\t\t\tconst result = await this.client.callGoogleMapsAPI('place/autocomplete', apiKey, queryParams);\n\n\t\t\tif (result.status === 'OK') {\n\t\t\t\tawait this.redisService.cacheObject(cacheKey, result, 86400);\n\t\t\t\tthis.logger.logger.info('Google Autocomplete response cached successfully', {\n\t\t\t\t\tcacheKey,\n\t\t\t\t\tpredictionCount: result.predictions?.length ?? 0,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis.logger.logger.warn('Google Autocomplete returned non-OK status', {\n\t\t\t\t\tstatus: result.status,\n\t\t\t\t\terrorMessage: result.error_message,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn result as GoogleAutocompleteResponse;\n\t\t} catch (error) {\n\t\t\tthis.logger.logger.error('Google Autocomplete failed', { input, error });\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tpublic async getPlaceDetails(input: GooglePlaceDetailsInputDTO): Promise<GooglePlaceDetailsResponse> {\n\t\tconst { placeId, sessionToken } = input;\n\t\tif (!placeId) {\n\t\t\tthis.logger.logger.error('Google Place Details failed: missing placeId');\n\t\t\tthrow new Error('Missing place_id');\n\t\t}\n\n\t\tconst cacheKey = `maps:details:${placeId}`;\n\n\t\ttry {\n\t\t\tconst cached = await this.redisService.getCachedObject<GooglePlaceDetailsResponse>(cacheKey);\n\t\t\tif (cached !== undefined) {\n\t\t\t\tthis.logger.logger.info('Google Place Details Cache HIT', { cacheKey, placeId });\n\t\t\t\treturn cached;\n\t\t\t}\n\n\t\t\tthis.logger.logger.info('Google Place Details Cache MISS - Calling API', { cacheKey, placeId });\n\n\t\t\tconst apiKey = await this.secretManager.getKey('GOOGLE_MAPS_API_KEY');\n\t\t\tif (!apiKey) {\n\t\t\t\tthis.logger.logger.error('GOOGLE_MAPS_API_KEY is missing in SecretManager');\n\t\t\t\tthrow new Error('GOOGLE_MAPS_API_KEY is not configured');\n\t\t\t}\n\n\t\t\tconst params: Record<string, string> = {\n\t\t\t\tplace_id: placeId,\n\t\t\t\tfields: 'name,formatted_address,geometry,address_component',\n\t\t\t};\n\t\t\tif (sessionToken) params.sessiontoken = sessionToken;\n\n\t\t\tconst result = await this.client.callGoogleMapsAPI('place/details', apiKey, params);\n\n\t\t\tif (result.status === 'OK') {\n\t\t\t\tawait this.redisService.cacheObject(cacheKey, result, 604800);\n\t\t\t\tthis.logger.logger.info('Google Place Details cached successfully', { cacheKey, placeId });\n\t\t\t} else {\n\t\t\t\tthis.logger.logger.warn('Google Place Details returned non-OK status', {\n\t\t\t\t\tstatus: result.status,\n\t\t\t\t\terrorMessage: result.error_message,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn result as GooglePlaceDetailsResponse;\n\t\t} catch (error) {\n\t\t\tthis.logger.logger.error('Google Place Details failed', { input, error });\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tpublic async getReverseGeocode(input: GoogleReverseGeocodeInputDTO): Promise<GoogleReverseGeocodeResponse> {\n\t\tconst { latitude, longitude } = input;\n\t\tif (!latitude || !longitude) {\n\t\t\tthis.logger.logger.error('Google Reverse Geocode failed: missing coordinates', { latitude, longitude });\n\t\t\tthrow new Error('Missing latitude or longitude');\n\t\t}\n\n\t\tconst roundedLat = parseFloat(latitude).toFixed(4);\n\t\tconst roundedLng = parseFloat(longitude).toFixed(4);\n\t\tconst cacheKey = `maps:geocode:${roundedLat}:${roundedLng}`;\n\n\t\ttry {\n\t\t\tconst cached = await this.redisService.getCachedObject<GoogleReverseGeocodeResponse>(cacheKey);\n\t\t\tif (cached !== undefined) {\n\t\t\t\tthis.logger.logger.info('Google Reverse Geocode Cache HIT', { cacheKey, roundedLat, roundedLng });\n\t\t\t\treturn cached;\n\t\t\t}\n\n\t\t\tthis.logger.logger.info('Google Reverse Geocode Cache MISS - Calling API', {\n\t\t\t\tcacheKey,\n\t\t\t\tlatitude,\n\t\t\t\tlongitude,\n\t\t\t});\n\n\t\t\tconst apiKey = await this.secretManager.getKey('GOOGLE_MAPS_API_KEY');\n\t\t\tif (!apiKey) {\n\t\t\t\tthis.logger.logger.error('GOOGLE_MAPS_API_KEY is missing in SecretManager');\n\t\t\t\tthrow new Error('GOOGLE_MAPS_API_KEY is not configured');\n\t\t\t}\n\n\t\t\tconst params = { latlng: `${latitude},${longitude}` };\n\n\t\t\tconst result = await this.client.callGoogleMapsAPI('geocode', apiKey, params);\n\n\t\t\tif (result.status === 'OK') {\n\t\t\t\tawait this.redisService.cacheObject(cacheKey, result, 259200);\n\t\t\t\tthis.logger.logger.info('Google Reverse Geocode cached successfully', {\n\t\t\t\t\tcacheKey,\n\t\t\t\t\tresultsCount: result.results?.length ?? 0,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis.logger.logger.warn('Google Reverse Geocode returned non-OK status', {\n\t\t\t\t\tstatus: result.status,\n\t\t\t\t\terrorMessage: result.error_message,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn result as GoogleReverseGeocodeResponse;\n\t\t} catch (error) {\n\t\t\tthis.logger.logger.error('Google Reverse Geocode failed', { input, error });\n\t\t\tthrow error;\n\t\t}\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"google-location.service.js","sourceRoot":"/","sources":["libraries/google-location/google-location.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mCAA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AAC;QAC/C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,+BAA+B,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;YAC5E,MAAM,KAAK,CAAC;QACb,CAAC;IACF,CAAC;CACD,CAAA;AAvKY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,gBAAO,GAAE;IAGP,WAAA,IAAA,eAAM,GAAE,CAAA;IACR,WAAA,IAAA,eAAM,GAAE,CAAA;IACR,WAAA,IAAA,eAAM,GAAE,CAAA;IACR,WAAA,IAAA,eAAM,GAAE,CAAA;qCAH0B,6CAAoB;QACb,8BAAoB;QACrB,oBAAY;QAClB,mBAAU;GALlC,qBAAqB,CAuKjC","sourcesContent":["import { Inject, Service } from 'typedi';\nimport { GoogleLocationClient } from './google-location.client';\nimport { SecretManagerService } from '../secrets';\nimport { RedisService } from '../redis';\nimport { LyxaLogger } from '../logger';\nimport {\n\tGoogleAutocompleteInputDTO,\n\tGoogleAutocompleteResponse,\n\tGooglePlaceDetailsInputDTO,\n\tGooglePlaceDetailsResponse,\n\tGoogleReverseGeocodeInputDTO,\n\tGoogleReverseGeocodeResponse,\n} from './google-location.dto';\n\n@Service()\nexport class GoogleLocationService {\n\tconstructor(\n\t\t@Inject() private readonly client: GoogleLocationClient,\n\t\t@Inject() private readonly secretManager: SecretManagerService,\n\t\t@Inject() private readonly redisService: RedisService,\n\t\t@Inject() private readonly logger: LyxaLogger\n\t) {}\n\n\tpublic async getAutocomplete(input: GoogleAutocompleteInputDTO): Promise<GoogleAutocompleteResponse> {\n\t\tconst { searchText, sessionToken, ...otherParams } = input;\n\n\t\tif (!searchText?.trim()) {\n\t\t\tthis.logger.logger.info('Google Autocomplete skipped: empty input provided');\n\t\t\treturn { predictions: [], status: 'OK' };\n\t\t}\n\n\t\tconst queryParams: Record<string, string> = { input: searchText, ...otherParams };\n\t\tif (sessionToken) queryParams.sessiontoken = sessionToken;\n\n\t\tconst querySummary = Object.entries(queryParams)\n\t\t\t.map(([k, v]) => `${k}:${v}`)\n\t\t\t.join('|');\n\t\tconst cacheKey = `maps:autocomplete:${this.redisService.sanitizeKey(querySummary)}`;\n\n\t\ttry {\n\t\t\tconst cached = await this.redisService.getCachedObject<GoogleAutocompleteResponse>(cacheKey);\n\t\t\tif (cached !== undefined) {\n\t\t\t\tthis.logger.logger.info('Google Autocomplete Cache HIT', { cacheKey, input });\n\t\t\t\treturn cached;\n\t\t\t}\n\n\t\t\tthis.logger.logger.info('Google Autocomplete Cache MISS - Calling API', { cacheKey, input });\n\n\t\t\tconst apiKey = await this.secretManager.getKey('GOOGLE_MAPS_API_KEY');\n\t\t\tif (!apiKey) {\n\t\t\t\tthis.logger.logger.error('GOOGLE_MAPS_API_KEY is missing in SecretManager');\n\t\t\t\tthrow new Error('GOOGLE_MAPS_API_KEY is not configured');\n\t\t\t}\n\n\t\t\tconst result = await this.client.callGoogleMapsAPI('place/autocomplete', apiKey, queryParams);\n\n\t\t\tif (result.status === 'OK') {\n\t\t\t\tawait this.redisService.cacheObject(cacheKey, result, 86400);\n\t\t\t\tthis.logger.logger.info('Google Autocomplete response cached successfully', {\n\t\t\t\t\tcacheKey,\n\t\t\t\t\tpredictionCount: result.predictions?.length ?? 0,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis.logger.logger.warn('Google Autocomplete returned non-OK status', {\n\t\t\t\t\tstatus: result.status,\n\t\t\t\t\terrorMessage: result.error_message,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn result as GoogleAutocompleteResponse;\n\t\t} catch (error) {\n\t\t\tthis.logger.logger.error('Google Autocomplete failed', { input, error });\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tpublic async getPlaceDetails(input: GooglePlaceDetailsInputDTO): Promise<GooglePlaceDetailsResponse> {\n\t\tconst { placeId, sessionToken } = input;\n\t\tif (!placeId) {\n\t\t\tthis.logger.logger.error('Google Place Details failed: missing placeId');\n\t\t\tthrow new Error('Missing place_id');\n\t\t}\n\n\t\tconst cacheKey = `maps:details:${placeId}`;\n\n\t\ttry {\n\t\t\tconst cached = await this.redisService.getCachedObject<GooglePlaceDetailsResponse>(cacheKey);\n\t\t\tif (cached !== undefined) {\n\t\t\t\tthis.logger.logger.info('Google Place Details Cache HIT', { cacheKey, placeId });\n\t\t\t\treturn cached;\n\t\t\t}\n\n\t\t\tthis.logger.logger.info('Google Place Details Cache MISS - Calling API', { cacheKey, placeId });\n\n\t\t\tconst apiKey = await this.secretManager.getKey('GOOGLE_MAPS_API_KEY');\n\t\t\tif (!apiKey) {\n\t\t\t\tthis.logger.logger.error('GOOGLE_MAPS_API_KEY is missing in SecretManager');\n\t\t\t\tthrow new Error('GOOGLE_MAPS_API_KEY is not configured');\n\t\t\t}\n\n\t\t\tconst params: Record<string, string> = {\n\t\t\t\tplace_id: placeId,\n\t\t\t\tfields: 'name,formatted_address,geometry,address_component',\n\t\t\t};\n\t\t\tif (sessionToken) params.sessiontoken = sessionToken;\n\n\t\t\tconst result = await this.client.callGoogleMapsAPI('place/details', apiKey, params);\n\n\t\t\tif (result.status === 'OK') {\n\t\t\t\tawait this.redisService.cacheObject(cacheKey, result, 604800);\n\t\t\t\tthis.logger.logger.info('Google Place Details cached successfully', { cacheKey, placeId });\n\t\t\t} else {\n\t\t\t\tthis.logger.logger.warn('Google Place Details returned non-OK status', {\n\t\t\t\t\tstatus: result.status,\n\t\t\t\t\terrorMessage: result.error_message,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn result as GooglePlaceDetailsResponse;\n\t\t} catch (error) {\n\t\t\tthis.logger.logger.error('Google Place Details failed', { input, error });\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tpublic async getReverseGeocode(input: GoogleReverseGeocodeInputDTO): Promise<GoogleReverseGeocodeResponse> {\n\t\tconst { latitude, longitude } = input;\n\t\tif (!latitude || !longitude) {\n\t\t\tthis.logger.logger.error('Google Reverse Geocode failed: missing coordinates', { latitude, longitude });\n\t\t\tthrow new Error('Missing latitude or longitude');\n\t\t}\n\n\t\tconst roundedLat = parseFloat(latitude).toFixed(4);\n\t\tconst roundedLng = parseFloat(longitude).toFixed(4);\n\t\tconst cacheKey = `maps:geocode:${roundedLat}:${roundedLng}`;\n\n\t\ttry {\n\t\t\t/*\n\t\t\tRedis Cache logic \n\t\t\t*/\n\n\t\t\t// const cached = await this.redisService.getCachedObject<GoogleReverseGeocodeResponse>(cacheKey);\n\t\t\t// if (cached !== undefined) {\n\t\t\t// \tthis.logger.logger.info('Google Reverse Geocode Cache HIT', { cacheKey, roundedLat, roundedLng });\n\t\t\t// \treturn cached;\n\t\t\t// }\n\n\t\t\t// this.logger.logger.info('Google Reverse Geocode Cache MISS - Calling API', {\n\t\t\t// \tcacheKey,\n\t\t\t// \tlatitude,\n\t\t\t// \tlongitude,\n\t\t\t// });\n\n\t\t\tconst apiKey = await this.secretManager.getKey('GOOGLE_MAPS_API_KEY');\n\t\t\tif (!apiKey) {\n\t\t\t\tthis.logger.logger.error('GOOGLE_MAPS_API_KEY is missing in SecretManager');\n\t\t\t\tthrow new Error('GOOGLE_MAPS_API_KEY is not configured');\n\t\t\t}\n\n\t\t\tconst params = { latlng: `${latitude},${longitude}` };\n\n\t\t\tconst result = await this.client.callGoogleMapsAPI('geocode', apiKey, params);\n\n\t\t\tif (result.status === 'OK') {\n\t\t\t\tawait this.redisService.cacheObject(cacheKey, result, 259200);\n\t\t\t\tthis.logger.logger.info('Google Reverse Geocode cached successfully', {\n\t\t\t\t\tcacheKey,\n\t\t\t\t\tresultsCount: result.results?.length ?? 0,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis.logger.logger.warn('Google Reverse Geocode returned non-OK status', {\n\t\t\t\t\tstatus: result.status,\n\t\t\t\t\terrorMessage: result.error_message,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn result as GoogleReverseGeocodeResponse;\n\t\t} catch (error) {\n\t\t\tthis.logger.logger.error('Google Reverse Geocode failed', { input, error });\n\t\t\tthrow error;\n\t\t}\n\t}\n}\n"]}
|
|
@@ -48,9 +48,9 @@ class OpenAICompletionProvider {
|
|
|
48
48
|
}
|
|
49
49
|
async generateSearchVariantsChunksInBatch(items, model, instructions, options) {
|
|
50
50
|
const finalModel = model ?? this.model;
|
|
51
|
-
const chunkSize = options?.chunkSize ??
|
|
51
|
+
const chunkSize = options?.chunkSize ?? 200;
|
|
52
52
|
const maxArabic = options?.maxArabic ?? 1;
|
|
53
|
-
const maxArabizi = options?.maxArabizi ??
|
|
53
|
+
const maxArabizi = options?.maxArabizi ?? 2;
|
|
54
54
|
const maxTransliteration = options?.maxTransliteration ?? 1;
|
|
55
55
|
const itemsToSend = items.filter(i => !i.skipAutoTranslation);
|
|
56
56
|
const skippedItems = items.filter(i => i.skipAutoTranslation);
|
|
@@ -109,7 +109,6 @@ class OpenAICompletionProvider {
|
|
|
109
109
|
const outputByChunk = await this.readJsonlFile(batch.output_file_id);
|
|
110
110
|
const errorsByChunk = await this.readJsonlFile(batch.error_file_id);
|
|
111
111
|
const resultsById = new Map();
|
|
112
|
-
let chunkParseFailures = 0;
|
|
113
112
|
for (const [chunkId, record] of outputByChunk.entries()) {
|
|
114
113
|
const body = record?.response?.body;
|
|
115
114
|
const outputText = body?.output_text ??
|
|
@@ -141,19 +140,10 @@ class OpenAICompletionProvider {
|
|
|
141
140
|
});
|
|
142
141
|
}
|
|
143
142
|
}
|
|
144
|
-
catch
|
|
145
|
-
|
|
146
|
-
console.error(`generateSearchVariantsChunksInBatch: failed to parse output for ${chunkId}`, {
|
|
147
|
-
error: parseErr,
|
|
148
|
-
outputTextLength: outputText.length,
|
|
149
|
-
outputTextPreview: outputText.slice(0, 2000),
|
|
150
|
-
outputTextTail: outputText.slice(-500),
|
|
151
|
-
});
|
|
143
|
+
catch {
|
|
144
|
+
console.error(`generateSearchVariantsChunksInBatch: failed to parse output for ${chunkId}`, outputText);
|
|
152
145
|
}
|
|
153
146
|
}
|
|
154
|
-
if (chunkParseFailures) {
|
|
155
|
-
console.error(`generateSearchVariantsChunksInBatch: ${chunkParseFailures}/${chunks.length} chunks failed to parse entirely — every item in those chunks will show as missing from LLM output below.`);
|
|
156
|
-
}
|
|
157
147
|
const missingIds = itemsToSend.filter(i => !resultsById.has(i.id)).map(i => i.id);
|
|
158
148
|
if (missingIds.length) {
|
|
159
149
|
console.error(`generateSearchVariantsChunksInBatch: ${missingIds.length}/${itemsToSend.length} items missing from LLM output`, missingIds);
|
|
@@ -162,7 +152,7 @@ class OpenAICompletionProvider {
|
|
|
162
152
|
const r = resultsById.get(id);
|
|
163
153
|
if (!r) {
|
|
164
154
|
console.error(`generateSearchVariantsChunksInBatch: no result for itemId=${id}`);
|
|
165
|
-
return { id, original: text,
|
|
155
|
+
return { id, original: text, processingFailed: true, isEmpty: true };
|
|
166
156
|
}
|
|
167
157
|
return { id, original: text, ...r };
|
|
168
158
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openai-provider.js","sourceRoot":"/","sources":["libraries/llm/providers/openai-provider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAwC;AAGxC,MAAa,wBAAwB;IACnB,MAAM,CAAS;IACf,KAAK,CAAS;IACd,iBAAiB,GAAG,iBAAiB,CAAC;IAEvD,YAAY,MAA0B,EAAE,QAAgB,YAAY;QACnE,IAAI,CAAC,MAAM,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;QACrF,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,IAAI,gBAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;QACrC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,CAAC;IAeD,KAAK,CAAC,mCAAmC,CACxC,KAAsB,EACtB,KAAc,EACd,YAAqB,EACrB,OAOC;QAED,MAAM,UAAU,GAAG,KAAK,IAAI,IAAI,CAAC,KAAK,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GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC7D,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,IAAI,EAAE,CAAC;QAEvC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;YACrD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAChC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QACtC,CAAC;QAED,OAAO,MAAM,CAAC;IACf,CAAC;IAKO,YAAY,CAAC,MAAmC;QACvD,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QAChD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC9D,CAAC;CACD;AA1WD,4DA0WC","sourcesContent":["import OpenAI, { toFile } from 'openai';\nimport { IAICompletionProvider, ItemTextInput, TextVariantResult } from '../interfaces/common-llm-interfaces';\n\nexport class OpenAICompletionProvider implements IAICompletionProvider {\n\tprivate readonly client: OpenAI;\n\tprivate readonly model: string;\n\tprivate readonly ARABIC_CHAR_REGEX = /[\\u0600-\\u06FF]/;\n\n\tconstructor(apiKey: string | undefined, model: string = 'gpt-5-nano') {\n\t\tif (!apiKey) {\n\t\t\tthrow new Error('OPENAI_API_KEY is required to construct OpenAICompletionProvider');\n\t\t}\n\t\tthis.client = new OpenAI({ apiKey });\n\t\tthis.model = model;\n\t}\n\n\t// ── Cost-optimized batch path ────────────────────────────────────\n\t// Implements everything discussed:\n\t// 1. Chunking — groups items (default 25/chunk — kept small so a single\n\t// malformed/truncated model response only takes out a small slice of\n\t// items instead of ~100+ at once) into one line per chunk, so\n\t// `instructions` is billed once per chunk instead of once per item.\n\t// 2. Short output keys — model emits {id, ar, az, tr} instead of\n\t// {id, arabic, arabizi, arabicTransliteration}; mapped back\n\t// to full field names locally, at zero token cost.\n\t// 3. Capped array lengths — schema enforces maxItems (not just a\n\t// prose suggestion), so the model can't drift to longer arrays.\n\t// 4. No echoed fields — model never re-emits id/original text;\n\t// both are re-attached locally from the input you already have.\n\tasync generateSearchVariantsChunksInBatch(\n\t\titems: ItemTextInput[],\n\t\tmodel?: string,\n\t\tinstructions?: string,\n\t\toptions?: {\n\t\t\tchunkSize?: number;\n\t\t\tmaxArabic?: number;\n\t\t\tmaxArabizi?: number;\n\t\t\tmaxTransliteration?: number;\n\t\t\tpollIntervalMs?: number;\n\t\t\tmaxWaitMs?: number;\n\t\t}\n\t): Promise<TextVariantResult[]> {\n\t\tconst finalModel = model ?? this.model;\n\t\t// Kept intentionally small — large chunks (100+) risk the model truncating or\n\t\t// malforming output for the WHOLE chunk, which drops every item in it at once.\n\t\tconst chunkSize = options?.chunkSize ?? 25;\n\t\tconst maxArabic = options?.maxArabic ?? 1;\n\t\t// Reduced from 2 → 1 by default: fewer required strings per item means less total\n\t\t// output per chunk, which lowers the chance of hitting a truncation/formatting issue.\n\t\tconst maxArabizi = options?.maxArabizi ?? 1;\n\t\tconst maxTransliteration = options?.maxTransliteration ?? 1;\n\n\t\t// Items explicitly opted out — never sent to the model, just passed through.\n\t\tconst itemsToSend = items.filter(i => !i.skipAutoTranslation);\n\t\tconst skippedItems = items.filter(i => i.skipAutoTranslation);\n\n\t\tif (skippedItems.length) {\n\t\t\tconsole.log(\n\t\t\t\t`generateSearchVariantsChunksInBatch: skipping ${skippedItems.length}/${items.length} items due to skipAutoTranslation=true`\n\t\t\t);\n\t\t}\n\n\t\t// Nothing left to actually send — short-circuit before touching the OpenAI API at all.\n\t\tif (!itemsToSend.length) {\n\t\t\treturn [];\n\t\t}\n\n\t\ttry {\n\t\t\tconst finalInstructions =\n\t\t\t\tinstructions ?? this.buildOptimizedInstructions({ maxArabic, maxArabizi, maxTransliteration });\n\n\t\t\tconst chunkSchema = this.buildOptimizedChunkSchema({ maxArabic, maxArabizi, maxTransliteration });\n\n\t\t\tconst chunks = this.chunkItems(itemsToSend, chunkSize);\n\n\t\t\tif (chunks.length > 50_000) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Too many chunks (${chunks.length}) for a single batch file — increase chunkSize or split into multiple batch submissions.`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconsole.log(\n\t\t\t\t`generateSearchVariantsChunksInBatch: model=${finalModel} items=${itemsToSend.length} (${skippedItems.length} skipped) chunkSize=${chunkSize} chunks=${chunks.length}`\n\t\t\t);\n\n\t\t\t// 1. Build JSONL — ONE line per chunk, not per item\n\t\t\tconst jsonl = chunks\n\t\t\t\t.map((chunkItems, i) =>\n\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\tcustom_id: `chunk-${i}`,\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\turl: '/v1/responses',\n\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\tmodel: finalModel,\n\t\t\t\t\t\t\tinstructions: finalInstructions,\n\t\t\t\t\t\t\tinput: JSON.stringify(chunkItems.map(({ id, text }) => ({ id: id, text }))),\n\t\t\t\t\t\t\ttext: {\n\t\t\t\t\t\t\t\tformat: {\n\t\t\t\t\t\t\t\t\ttype: 'json_schema',\n\t\t\t\t\t\t\t\t\tname: 'text_variants_batch',\n\t\t\t\t\t\t\t\t\tschema: chunkSchema,\n\t\t\t\t\t\t\t\t\tstrict: true,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t\t.join('\\n');\n\n\t\t\t// 2. Upload input file\n\t\t\tconst inputFile = await this.client.files.create({\n\t\t\t\tfile: await toFile(Buffer.from(jsonl, 'utf-8'), 'batch-input-optimized.jsonl'),\n\t\t\t\tpurpose: 'batch',\n\t\t\t});\n\n\t\t\t// 3. Create batch job\n\t\t\tlet batch = await this.client.batches.create({\n\t\t\t\tinput_file_id: inputFile.id,\n\t\t\t\tendpoint: '/v1/responses',\n\t\t\t\tcompletion_window: '24h',\n\t\t\t});\n\n\t\t\t// 4. Poll until done\n\t\t\tbatch = await this.pollBatch(batch.id, options?.pollIntervalMs, options?.maxWaitMs);\n\n\t\t\tconsole.log({\n\t\t\t\tstatus: batch.status,\n\t\t\t\trequest_counts: batch.request_counts,\n\t\t\t\terrors: batch.errors,\n\t\t\t});\n\n\t\t\tif (batch.status !== 'completed') {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Batch ${batch.id} ended with status \"${batch.status}\" (${batch.request_counts?.failed ?? 0} failed)`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// 5. Parse output\n\t\t\tconst outputByChunk = await this.readJsonlFile(batch.output_file_id);\n\t\t\tconst errorsByChunk = await this.readJsonlFile(batch.error_file_id);\n\n\t\t\t// 6. Flatten chunk results into a per-itemId map\n\t\t\tconst resultsById = new Map<string, Partial<TextVariantResult>>();\n\t\t\tlet chunkParseFailures = 0;\n\n\t\t\tfor (const [chunkId, record] of outputByChunk.entries()) {\n\t\t\t\tconst body = record?.response?.body;\n\t\t\t\tconst outputText =\n\t\t\t\t\tbody?.output_text ??\n\t\t\t\t\tbody?.output\n\t\t\t\t\t\t?.find((o: any) => o.type === 'message')\n\t\t\t\t\t\t?.content?.find((c: any) => c.type === 'output_text')?.text;\n\n\t\t\t\tif (!outputText) {\n\t\t\t\t\tconst err = errorsByChunk.get(chunkId);\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t`generateSearchVariantsChunksInBatch: no output for ${chunkId}`,\n\t\t\t\t\t\terr ?? record?.error\n\t\t\t\t\t);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tconst parsed = JSON.parse(outputText) as {\n\t\t\t\t\t\tresults: Array<{ id: string; ar: string[]; az: string[]; tr: string[] }>;\n\t\t\t\t\t};\n\t\t\t\t\tfor (const r of parsed.results) {\n\t\t\t\t\t\tconst ar = this.sanitizeArabicArray(r.ar);\n\t\t\t\t\t\tconst tr = this.sanitizeArabicArray(r.tr);\n\t\t\t\t\t\tconst az = this.sanitizeLatinArray(r.az);\n\n\t\t\t\t\t\tconst isEmpty = this.isEmptyValue(r.ar) || this.isEmptyValue(r.az) || this.isEmptyValue(r.tr);\n\t\t\t\t\t\tconst isProcessingFailed = (!ar.length && !tr.length) || !az.length;\n\n\t\t\t\t\t\tif (isProcessingFailed) {\n\t\t\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t\t\t`generateSearchVariantsChunksInBatch: marking id=${r.id} as processingFailed — ar=${JSON.stringify(r.ar)} az=${JSON.stringify(r.az)} tr=${JSON.stringify(r.tr)}`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tresultsById.set(r.id, {\n\t\t\t\t\t\t\tarabic: ar,\n\t\t\t\t\t\t\tarabizi: az,\n\t\t\t\t\t\t\tarabicTransliteration: tr,\n\t\t\t\t\t\t\tisProcessingFailed,\n\t\t\t\t\t\t\tisEmpty,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} catch (parseErr) {\n\t\t\t\t\tchunkParseFailures++;\n\t\t\t\t\t// Log a preview + length of the raw output so you can tell WHY it failed —\n\t\t\t\t\t// truncated mid-JSON (hit output length) vs. malformed/extra text vs. something else.\n\t\t\t\t\tconsole.error(`generateSearchVariantsChunksInBatch: failed to parse output for ${chunkId}`, {\n\t\t\t\t\t\terror: parseErr,\n\t\t\t\t\t\toutputTextLength: outputText.length,\n\t\t\t\t\t\toutputTextPreview: outputText.slice(0, 2000),\n\t\t\t\t\t\toutputTextTail: outputText.slice(-500),\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (chunkParseFailures) {\n\t\t\t\tconsole.error(\n\t\t\t\t\t`generateSearchVariantsChunksInBatch: ${chunkParseFailures}/${chunks.length} chunks failed to parse entirely — every item in those chunks will show as missing from LLM output below.`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// 7. Surface items the model silently dropped (only checked against what we actually sent)\n\t\t\tconst missingIds = itemsToSend.filter(i => !resultsById.has(i.id)).map(i => i.id);\n\t\t\tif (missingIds.length) {\n\t\t\t\tconsole.error(\n\t\t\t\t\t`generateSearchVariantsChunksInBatch: ${missingIds.length}/${itemsToSend.length} items missing from LLM output`,\n\t\t\t\t\tmissingIds\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// 8. Merge back with the FULL original item list — skipped items pass through untouched,\n\t\t\t// everything else is looked up in resultsById.\n\t\t\treturn items.map(({ id, text }) => {\n\t\t\t\tconst r = resultsById.get(id);\n\t\t\t\tif (!r) {\n\t\t\t\t\tconsole.error(`generateSearchVariantsChunksInBatch: no result for itemId=${id}`);\n\t\t\t\t\t// NOTE: key must be isProcessingFailed (matches the shape set above and what\n\t\t\t\t\t// hasAnyFailedField/isFieldUsable check downstream) — a prior version of this\n\t\t\t\t\t// fallback used `processingFailed` (wrong key), which meant callers saw\n\t\t\t\t\t// isProcessingFailed=undefined for every dropped item instead of true.\n\t\t\t\t\treturn { id, original: text, isProcessingFailed: true, isEmpty: true };\n\t\t\t\t}\n\t\t\t\treturn { id, original: text, ...r } as TextVariantResult;\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconsole.error('generateSearchVariantsChunksInBatch failed', {\n\t\t\t\terror,\n\t\t\t\titemCount: itemsToSend.length,\n\t\t\t\tmodel: finalModel,\n\t\t\t});\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\t// ── Helpers ──────────────────────────────────────────────────────\n\n\t// Keeps only entries that actually contain Arabic-script characters — used for `ar`/`tr`,\n\t// which must never contain the raw English/Latin text the model was given.\n\tprivate sanitizeArabicArray(values: string[] | undefined): string[] {\n\t\treturn (values ?? []).filter(v => typeof v === 'string' && v.trim() && this.ARABIC_CHAR_REGEX.test(v));\n\t}\n\n\t// Keeps only entries that do NOT contain Arabic-script characters — used for `az`\n\t// (Latin/Arabizi variants), which must never contain Arabic script.\n\tprivate sanitizeLatinArray(values: string[] | undefined): string[] {\n\t\treturn (values ?? []).filter(v => typeof v === 'string' && v.trim() && !this.ARABIC_CHAR_REGEX.test(v));\n\t}\n\n\t// Compact instructions for the optimized path: short-key output format,\n\t// explicit array caps stated in prose (schema also enforces them),\n\t// and an explicit \"no commentary inside values\" rule to stop the model\n\t// padding fields with parenthetical notes.\n\tprivate buildOptimizedInstructions(caps: {\n\t\tmaxArabic: number;\n\t\tmaxArabizi: number;\n\t\tmaxTransliteration: number;\n\t}): string {\n\t\treturn [\n\t\t\t'You generate search-name variants for a food delivery app product/shop name.',\n\t\t\t'You will receive a JSON array of items, each with \"id\" and \"text\".',\n\t\t\t'For EACH item, return an object with:',\n\t\t\t`- id: the exact id provided (unchanged)`,\n\t\t\t`- ar: Arabic translation(s) in Arabic script, max ${caps.maxArabic}.`,\n\t\t\t`- az: Arabizi spelling(s) (Latin script/numerals, e.g. \"zaytoon\"), max ${caps.maxArabizi}.`,\n\t\t\t`- tr: Arabic-script transliteration(s) of the original word (not translated), max ${caps.maxTransliteration}.`,\n\t\t\t'Return one result per input item, same order, no items skipped or merged.',\n\t\t\t'Values must contain only the term itself — no parenthetical notes, no commentary.',\n\t\t\t'Return strict JSON matching the schema. No extra commentary, no extra fields.',\n\t\t].join('\\n');\n\t}\n\n\t// Schema for the OPTIMIZED chunk path: wraps a `results` array (one\n\t// entry per item in the chunk), short keys, and hard maxItems caps.\n\tprivate buildOptimizedChunkSchema(caps: {\n\t\tmaxArabic: number;\n\t\tmaxArabizi: number;\n\t\tmaxTransliteration: number;\n\t}) {\n\t\treturn {\n\t\t\ttype: 'object',\n\t\t\tproperties: {\n\t\t\t\tresults: {\n\t\t\t\t\ttype: 'array',\n\t\t\t\t\titems: {\n\t\t\t\t\t\ttype: 'object',\n\t\t\t\t\t\tproperties: {\n\t\t\t\t\t\t\tid: { type: 'string' },\n\t\t\t\t\t\t\tar: { type: 'array', items: { type: 'string' }, minItems: 1, maxItems: caps.maxArabic },\n\t\t\t\t\t\t\taz: { type: 'array', items: { type: 'string' }, minItems: 1, maxItems: caps.maxArabizi },\n\t\t\t\t\t\t\ttr: {\n\t\t\t\t\t\t\t\ttype: 'array',\n\t\t\t\t\t\t\t\titems: { type: 'string' },\n\t\t\t\t\t\t\t\tminItems: 1,\n\t\t\t\t\t\t\t\tmaxItems: caps.maxTransliteration,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\trequired: ['id', 'ar', 'az', 'tr'],\n\t\t\t\t\t\tadditionalProperties: false,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\trequired: ['results'],\n\t\t\tadditionalProperties: false,\n\t\t};\n\t}\n\n\tprivate chunkItems<T>(items: T[], size: number): T[][] {\n\t\tconst out: T[][] = [];\n\t\tfor (let i = 0; i < items.length; i += size) {\n\t\t\tout.push(items.slice(i, i + size));\n\t\t}\n\t\treturn out;\n\t}\n\n\tprivate async pollBatch(\n\t\tbatchId: string,\n\t\tintervalMs = 5000,\n\t\tmaxWaitMs = 24 * 60 * 60 * 1000\n\t): Promise<OpenAI.Batches.Batch> {\n\t\tconst terminal = new Set(['completed', 'failed', 'expired', 'cancelled']);\n\t\tconst start = Date.now();\n\n\t\twhile (true) {\n\t\t\tconst batch = await this.client.batches.retrieve(batchId);\n\t\t\tconsole.log(\n\t\t\t\t`pollBatch: ${batchId} status=${batch.status} elapsed=${Math.round((Date.now() - start) / 1000)}s`\n\t\t\t);\n\t\t\tif (terminal.has(batch.status)) return batch;\n\n\t\t\tif (Date.now() - start > maxWaitMs) {\n\t\t\t\tthrow new Error(`Batch ${batchId} did not finish within ${maxWaitMs}ms (status: ${batch.status})`);\n\t\t\t}\n\n\t\t\tawait new Promise(resolve => setTimeout(resolve, intervalMs));\n\t\t}\n\t}\n\n\tprivate async readJsonlFile(fileId: string | null | undefined): Promise<Map<string, any>> {\n\t\tconst result = new Map<string, any>();\n\t\tif (!fileId) return result;\n\n\t\tconst fileResponse = await this.client.files.content(fileId);\n\t\tconst text = await fileResponse.text();\n\n\t\tfor (const line of text.split('\\n').filter(Boolean)) {\n\t\t\tconst record = JSON.parse(line);\n\t\t\tresult.set(record.custom_id, record);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t// Checks whether ar/az/tr came back empty in any sense the model might produce:\n\t// missing entirely (null/undefined), an empty array, or an array whose entries\n\t// are just empty/whitespace strings.\n\tprivate isEmptyValue(values: string[] | null | undefined): boolean {\n\t\tif (!values || values.length === 0) return true;\n\t\treturn values.every(v => typeof v !== 'string' || !v.trim());\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"openai-provider.js","sourceRoot":"/","sources":["libraries/llm/providers/openai-provider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAwC;AAGxC,MAAa,wBAAwB;IACnB,MAAM,CAAS;IACf,KAAK,CAAS;IACd,iBAAiB,GAAG,iBAAiB,CAAC;IAEvD,YAAY,MAA0B,EAAE,QAAgB,YAAY;QACnE,IAAI,CAAC,MAAM,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;QACrF,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,IAAI,gBAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;QACrC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,CAAC;IAcD,KAAK,CAAC,mCAAmC,CACxC,KAAsB,EACtB,KAAc,EACd,YAAqB,EACrB,OAOC;QAED,MAAM,UAAU,GAAG,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC;QACvC,MAAM,SAAS,GAAG,OAAO,EAAE,SAAS,IAAI,GAAG,CAAC;QAC5C,MAAM,SAAS,GAAG,OAAO,EAAE,SAAS,IAAI,CAAC,CAAC;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,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC9D,CAAC;CACD;AAtVD,4DAsVC","sourcesContent":["import OpenAI, { toFile } from 'openai';\nimport { IAICompletionProvider, ItemTextInput, TextVariantResult } from '../interfaces/common-llm-interfaces';\n\nexport class OpenAICompletionProvider implements IAICompletionProvider {\n\tprivate readonly client: OpenAI;\n\tprivate readonly model: string;\n\tprivate readonly ARABIC_CHAR_REGEX = /[\\u0600-\\u06FF]/;\n\n\tconstructor(apiKey: string | undefined, model: string = 'gpt-5-nano') {\n\t\tif (!apiKey) {\n\t\t\tthrow new Error('OPENAI_API_KEY is required to construct OpenAICompletionProvider');\n\t\t}\n\t\tthis.client = new OpenAI({ apiKey });\n\t\tthis.model = model;\n\t}\n\n\t// ── Cost-optimized batch path ────────────────────────────────────\n\t// Implements everything discussed:\n\t// 1. Chunking — groups items (default 200/chunk) into one line per\n\t// chunk, so `instructions` is billed once per chunk instead of\n\t// once per item (biggest single cost lever).\n\t// 2. Short output keys — model emits {id, ar, az, tr} instead of\n\t// {id, arabic, arabizi, arabicTransliteration}; mapped back\n\t// to full field names locally, at zero token cost.\n\t// 3. Capped array lengths — schema enforces maxItems (not just a\n\t// prose suggestion), so the model can't drift to longer arrays.\n\t// 4. No echoed fields — model never re-emits id/original text;\n\t// both are re-attached locally from the input you already have.\n\tasync generateSearchVariantsChunksInBatch(\n\t\titems: ItemTextInput[],\n\t\tmodel?: string,\n\t\tinstructions?: string,\n\t\toptions?: {\n\t\t\tchunkSize?: number;\n\t\t\tmaxArabic?: number;\n\t\t\tmaxArabizi?: number;\n\t\t\tmaxTransliteration?: number;\n\t\t\tpollIntervalMs?: number;\n\t\t\tmaxWaitMs?: number;\n\t\t}\n\t): Promise<TextVariantResult[]> {\n\t\tconst finalModel = model ?? this.model;\n\t\tconst chunkSize = options?.chunkSize ?? 200;\n\t\tconst maxArabic = options?.maxArabic ?? 1;\n\t\tconst maxArabizi = options?.maxArabizi ?? 2;\n\t\tconst maxTransliteration = options?.maxTransliteration ?? 1;\n\n\t\t// Items explicitly opted out — never sent to the model, just passed through.\n\t\tconst itemsToSend = items.filter(i => !i.skipAutoTranslation);\n\t\tconst skippedItems = items.filter(i => i.skipAutoTranslation);\n\n\t\tif (skippedItems.length) {\n\t\t\tconsole.log(\n\t\t\t\t`generateSearchVariantsChunksInBatch: skipping ${skippedItems.length}/${items.length} items due to skipAutoTranslation=true`\n\t\t\t);\n\t\t}\n\n\t\t// Nothing left to actually send — short-circuit before touching the OpenAI API at all.\n\t\tif (!itemsToSend.length) {\n\t\t\t// return skippedItems.map(({ id, text }) => ({ id, original: text, skipped: true }));\n\t\t\treturn [];\n\t\t}\n\n\t\ttry {\n\t\t\tconst finalInstructions =\n\t\t\t\tinstructions ?? this.buildOptimizedInstructions({ maxArabic, maxArabizi, maxTransliteration });\n\n\t\t\tconst chunkSchema = this.buildOptimizedChunkSchema({ maxArabic, maxArabizi, maxTransliteration });\n\n\t\t\tconst chunks = this.chunkItems(itemsToSend, chunkSize);\n\n\t\t\tif (chunks.length > 50_000) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Too many chunks (${chunks.length}) for a single batch file — increase chunkSize or split into multiple batch submissions.`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconsole.log(\n\t\t\t\t`generateSearchVariantsChunksInBatch: model=${finalModel} items=${itemsToSend.length} (${skippedItems.length} skipped) chunkSize=${chunkSize} chunks=${chunks.length}`\n\t\t\t);\n\n\t\t\t// 1. Build JSONL — ONE line per chunk, not per item\n\t\t\tconst jsonl = chunks\n\t\t\t\t.map((chunkItems, i) =>\n\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\tcustom_id: `chunk-${i}`,\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\turl: '/v1/responses',\n\t\t\t\t\t\tbody: {\n\t\t\t\t\t\t\tmodel: finalModel,\n\t\t\t\t\t\t\tinstructions: finalInstructions,\n\t\t\t\t\t\t\tinput: JSON.stringify(chunkItems.map(({ id, text }) => ({ id: id, text }))),\n\t\t\t\t\t\t\ttext: {\n\t\t\t\t\t\t\t\tformat: {\n\t\t\t\t\t\t\t\t\ttype: 'json_schema',\n\t\t\t\t\t\t\t\t\tname: 'text_variants_batch',\n\t\t\t\t\t\t\t\t\tschema: chunkSchema,\n\t\t\t\t\t\t\t\t\tstrict: true,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t\t.join('\\n');\n\n\t\t\t// 2. Upload input file\n\t\t\tconst inputFile = await this.client.files.create({\n\t\t\t\tfile: await toFile(Buffer.from(jsonl, 'utf-8'), 'batch-input-optimized.jsonl'),\n\t\t\t\tpurpose: 'batch',\n\t\t\t});\n\n\t\t\t// 3. Create batch job\n\t\t\tlet batch = await this.client.batches.create({\n\t\t\t\tinput_file_id: inputFile.id,\n\t\t\t\tendpoint: '/v1/responses',\n\t\t\t\tcompletion_window: '24h',\n\t\t\t});\n\n\t\t\t// 4. Poll until done\n\t\t\tbatch = await this.pollBatch(batch.id, options?.pollIntervalMs, options?.maxWaitMs);\n\n\t\t\tconsole.log({\n\t\t\t\tstatus: batch.status,\n\t\t\t\trequest_counts: batch.request_counts,\n\t\t\t\terrors: batch.errors,\n\t\t\t});\n\n\t\t\tif (batch.status !== 'completed') {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Batch ${batch.id} ended with status \"${batch.status}\" (${batch.request_counts?.failed ?? 0} failed)`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// 5. Parse output\n\t\t\tconst outputByChunk = await this.readJsonlFile(batch.output_file_id);\n\t\t\tconst errorsByChunk = await this.readJsonlFile(batch.error_file_id);\n\n\t\t\t// 6. Flatten chunk results into a per-itemId map\n\t\t\tconst resultsById = new Map<string, Partial<TextVariantResult>>();\n\n\t\t\tfor (const [chunkId, record] of outputByChunk.entries()) {\n\t\t\t\tconst body = record?.response?.body;\n\t\t\t\tconst outputText =\n\t\t\t\t\tbody?.output_text ??\n\t\t\t\t\tbody?.output\n\t\t\t\t\t\t?.find((o: any) => o.type === 'message')\n\t\t\t\t\t\t?.content?.find((c: any) => c.type === 'output_text')?.text;\n\n\t\t\t\tif (!outputText) {\n\t\t\t\t\tconst err = errorsByChunk.get(chunkId);\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t`generateSearchVariantsChunksInBatch: no output for ${chunkId}`,\n\t\t\t\t\t\terr ?? record?.error\n\t\t\t\t\t);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tconst parsed = JSON.parse(outputText) as {\n\t\t\t\t\t\tresults: Array<{ id: string; ar: string[]; az: string[]; tr: string[] }>;\n\t\t\t\t\t};\n\t\t\t\t\tfor (const r of parsed.results) {\n\t\t\t\t\t\tconst ar = this.sanitizeArabicArray(r.ar);\n\t\t\t\t\t\tconst tr = this.sanitizeArabicArray(r.tr);\n\t\t\t\t\t\tconst az = this.sanitizeLatinArray(r.az);\n\n\t\t\t\t\t\tconst isEmpty = this.isEmptyValue(r.ar) || this.isEmptyValue(r.az) || this.isEmptyValue(r.tr);\n\t\t\t\t\t\tconst isProcessingFailed = (!ar.length && !tr.length) || !az.length;\n\n\t\t\t\t\t\tif (isProcessingFailed) {\n\t\t\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t\t\t`generateSearchVariantsChunksInBatch: marking id=${r.id} as processingFailed — ar=${JSON.stringify(r.ar)} az=${JSON.stringify(r.az)} tr=${JSON.stringify(r.tr)}`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tresultsById.set(r.id, {\n\t\t\t\t\t\t\tarabic: ar,\n\t\t\t\t\t\t\tarabizi: az,\n\t\t\t\t\t\t\tarabicTransliteration: tr,\n\t\t\t\t\t\t\tisProcessingFailed,\n\t\t\t\t\t\t\tisEmpty,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} catch {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t`generateSearchVariantsChunksInBatch: failed to parse output for ${chunkId}`,\n\t\t\t\t\t\toutputText\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// 7. Surface items the model silently dropped (only checked against what we actually sent)\n\t\t\tconst missingIds = itemsToSend.filter(i => !resultsById.has(i.id)).map(i => i.id);\n\t\t\tif (missingIds.length) {\n\t\t\t\tconsole.error(\n\t\t\t\t\t`generateSearchVariantsChunksInBatch: ${missingIds.length}/${itemsToSend.length} items missing from LLM output`,\n\t\t\t\t\tmissingIds\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// 8. Merge back with the FULL original item list — skipped items pass through untouched,\n\t\t\t// everything else is looked up in resultsById.\n\t\t\treturn items.map(({ id, text }) => {\n\t\t\t\tconst r = resultsById.get(id);\n\t\t\t\tif (!r) {\n\t\t\t\t\tconsole.error(`generateSearchVariantsChunksInBatch: no result for itemId=${id}`);\n\t\t\t\t\treturn { id, original: text, processingFailed: true, isEmpty: true };\n\t\t\t\t}\n\t\t\t\treturn { id, original: text, ...r } as TextVariantResult;\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconsole.error('generateSearchVariantsChunksInBatch failed', {\n\t\t\t\terror,\n\t\t\t\titemCount: itemsToSend.length,\n\t\t\t\tmodel: finalModel,\n\t\t\t});\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\t// ── Helpers ──────────────────────────────────────────────────────\n\n\t// Keeps only entries that actually contain Arabic-script characters — used for `ar`/`tr`,\n\t// which must never contain the raw English/Latin text the model was given.\n\tprivate sanitizeArabicArray(values: string[] | undefined): string[] {\n\t\treturn (values ?? []).filter(v => typeof v === 'string' && v.trim() && this.ARABIC_CHAR_REGEX.test(v));\n\t}\n\n\t// Keeps only entries that do NOT contain Arabic-script characters — used for `az`\n\t// (Latin/Arabizi variants), which must never contain Arabic script.\n\tprivate sanitizeLatinArray(values: string[] | undefined): string[] {\n\t\treturn (values ?? []).filter(v => typeof v === 'string' && v.trim() && !this.ARABIC_CHAR_REGEX.test(v));\n\t}\n\n\t// Compact instructions for the optimized path: short-key output format,\n\t// explicit array caps stated in prose (schema also enforces them),\n\t// and an explicit \"no commentary inside values\" rule to stop the model\n\t// padding fields with parenthetical notes.\n\tprivate buildOptimizedInstructions(caps: {\n\t\tmaxArabic: number;\n\t\tmaxArabizi: number;\n\t\tmaxTransliteration: number;\n\t}): string {\n\t\treturn [\n\t\t\t'You generate search-name variants for a food delivery app product/shop name.',\n\t\t\t'You will receive a JSON array of items, each with \"id\" and \"text\".',\n\t\t\t'For EACH item, return an object with:',\n\t\t\t`- id: the exact id provided (unchanged)`,\n\t\t\t`- ar: Arabic translation(s) in Arabic script, max ${caps.maxArabic}.`,\n\t\t\t`- az: Arabizi spelling(s) (Latin script/numerals, e.g. \"zaytoon\"), max ${caps.maxArabizi}.`,\n\t\t\t`- tr: Arabic-script transliteration(s) of the original word (not translated), max ${caps.maxTransliteration}.`,\n\t\t\t'Return one result per input item, same order, no items skipped or merged.',\n\t\t\t'Values must contain only the term itself — no parenthetical notes, no commentary.',\n\t\t\t'Return strict JSON matching the schema. No extra commentary, no extra fields.',\n\t\t].join('\\n');\n\t}\n\n\t// Schema for the OPTIMIZED chunk path: wraps a `results` array (one\n\t// entry per item in the chunk), short keys, and hard maxItems caps.\n\tprivate buildOptimizedChunkSchema(caps: {\n\t\tmaxArabic: number;\n\t\tmaxArabizi: number;\n\t\tmaxTransliteration: number;\n\t}) {\n\t\treturn {\n\t\t\ttype: 'object',\n\t\t\tproperties: {\n\t\t\t\tresults: {\n\t\t\t\t\ttype: 'array',\n\t\t\t\t\titems: {\n\t\t\t\t\t\ttype: 'object',\n\t\t\t\t\t\tproperties: {\n\t\t\t\t\t\t\tid: { type: 'string' },\n\t\t\t\t\t\t\tar: { type: 'array', items: { type: 'string' }, minItems: 1, maxItems: caps.maxArabic },\n\t\t\t\t\t\t\taz: { type: 'array', items: { type: 'string' }, minItems: 1, maxItems: caps.maxArabizi },\n\t\t\t\t\t\t\ttr: {\n\t\t\t\t\t\t\t\ttype: 'array',\n\t\t\t\t\t\t\t\titems: { type: 'string' },\n\t\t\t\t\t\t\t\tminItems: 1,\n\t\t\t\t\t\t\t\tmaxItems: caps.maxTransliteration,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\trequired: ['id', 'ar', 'az', 'tr'],\n\t\t\t\t\t\tadditionalProperties: false,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\trequired: ['results'],\n\t\t\tadditionalProperties: false,\n\t\t};\n\t}\n\n\tprivate chunkItems<T>(items: T[], size: number): T[][] {\n\t\tconst out: T[][] = [];\n\t\tfor (let i = 0; i < items.length; i += size) {\n\t\t\tout.push(items.slice(i, i + size));\n\t\t}\n\t\treturn out;\n\t}\n\n\tprivate async pollBatch(\n\t\tbatchId: string,\n\t\tintervalMs = 5000,\n\t\tmaxWaitMs = 24 * 60 * 60 * 1000\n\t): Promise<OpenAI.Batches.Batch> {\n\t\tconst terminal = new Set(['completed', 'failed', 'expired', 'cancelled']);\n\t\tconst start = Date.now();\n\n\t\twhile (true) {\n\t\t\tconst batch = await this.client.batches.retrieve(batchId);\n\t\t\tconsole.log(\n\t\t\t\t`pollBatch: ${batchId} status=${batch.status} elapsed=${Math.round((Date.now() - start) / 1000)}s`\n\t\t\t);\n\t\t\tif (terminal.has(batch.status)) return batch;\n\n\t\t\tif (Date.now() - start > maxWaitMs) {\n\t\t\t\tthrow new Error(`Batch ${batchId} did not finish within ${maxWaitMs}ms (status: ${batch.status})`);\n\t\t\t}\n\n\t\t\tawait new Promise(resolve => setTimeout(resolve, intervalMs));\n\t\t}\n\t}\n\n\tprivate async readJsonlFile(fileId: string | null | undefined): Promise<Map<string, any>> {\n\t\tconst result = new Map<string, any>();\n\t\tif (!fileId) return result;\n\n\t\tconst fileResponse = await this.client.files.content(fileId);\n\t\tconst text = await fileResponse.text();\n\n\t\tfor (const line of text.split('\\n').filter(Boolean)) {\n\t\t\tconst record = JSON.parse(line);\n\t\t\tresult.set(record.custom_id, record);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t// Checks whether ar/az/tr came back empty in any sense the model might produce:\n\t// missing entirely (null/undefined), an empty array, or an array whose entries\n\t// are just empty/whitespace strings.\n\tprivate isEmptyValue(values: string[] | null | undefined): boolean {\n\t\tif (!values || values.length === 0) return true;\n\t\treturn values.every(v => typeof v !== 'string' || !v.trim());\n\t}\n}\n"]}
|
|
@@ -131,7 +131,6 @@ import { CopyProductJob } from './copy-product-job.model';
|
|
|
131
131
|
import { CopyProductMap } from './copy-product-map.model';
|
|
132
132
|
import { CopyShopCategoryMap } from './copy-shop-category-map.model';
|
|
133
133
|
import { CopyAttributeMap } from './copy-attribute-map.model';
|
|
134
|
-
import { UserCoupon } from './user-coupon.model';
|
|
135
134
|
export declare const ActivityLogModel: ReturnModelType<typeof ActivityLog>;
|
|
136
135
|
export * from './activity-log.model';
|
|
137
136
|
export declare const AdminAccessControlModel: ReturnModelType<typeof AdminAccessControl>;
|
|
@@ -195,8 +194,6 @@ export * from './providers/individual-store-coupon.model';
|
|
|
195
194
|
export * from './providers/individual-user-coupon.model';
|
|
196
195
|
export * from './providers/referral-code-coupon.model';
|
|
197
196
|
export * from './providers/referral-reward-coupon.model';
|
|
198
|
-
export declare const UserCouponModel: ReturnModelType<typeof UserCoupon>;
|
|
199
|
-
export * from './user-coupon.model';
|
|
200
197
|
export declare const DealSettingModel: ReturnModelType<typeof DealSetting>;
|
|
201
198
|
export * from './deal-setting.model';
|
|
202
199
|
export declare const LimitedTimeOfferCampaignModel: ReturnModelType<typeof LimitedTimeOfferCampaign>;
|
|
@@ -14,9 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.NotificationModel = exports.MealPlanModel = exports.SpendToGetMarketingModel = exports.PunchMarketingModel = exports.NewUserDiscountMarketingModel = exports.FreeDeliveryMarketingModel = exports.FeaturedMarketingModel = exports.DiscountMarketingModel = exports.Buy1Get1MarketingModel = exports.MarketingModel = exports.ListContainerModel = exports.LineItemModel = exports.GalleryUploadModel = exports.GalleryModel = exports.FlagModel = exports.FinanceSettlementModel = exports.FilterContainerModel = exports.FeaturedSettingModel = exports.FavouriteModel = exports.DishModel = exports.LimitedTimeOfferParticipantModel = exports.LimitedTimeOfferConfigModel = exports.LimitedTimeOfferCampaignSessionModel = exports.LimitedTimeOfferCampaignModel = exports.DealSettingModel = exports.
|
|
18
|
-
exports.VendorModel = exports.VendorParentModel = exports.ServiceModel = exports.ChatroomModel = exports.AgentPerformanceModel = exports.MessageModel = exports.TicketModel = exports.RewardModel = exports.CancellationReasonModel = exports.SupportReasonModel = exports.TermsAndConditionsModel = exports.DefaultChatModel = exports.DeliveryChargesModel = exports.ZoneModel = exports.UserModel = exports.TagModel = exports.SubscriptionModel = exports.ShopModel = exports.ShopSectionModel = exports.ShopMealPlanModel = exports.ShopCategoryModel = exports.ShopAccessControlModel = exports.SettingModel = exports.RiderModel = exports.RiderTrackingModel = exports.RiderTimeoutModel = exports.ServicePackageReviewModel = exports.VendorReviewModel = exports.RiderReviewModel = exports.ShopReviewModel = exports.ReviewModel = exports.RequestAreaModel = exports.ReferralSettingModel = exports.RatingSettingModel = exports.SpendToGetHistoryModel = exports.PunchMarketingHistoryModel = exports.ProductUploadModel = exports.ProductModel = exports.ProductStockTrackerModel = exports.ProductMarketingModel = exports.VendorPayoutModel = exports.RiderPayoutModel = exports.ShopPayoutModel = exports.PayoutModel = exports.ParentModel = exports.ShopCourierOrderModel = exports.CourierOrderModel = exports.RegularOrderModel = exports.OrderModel =
|
|
19
|
-
exports.UserShopHistoryModel = exports.CopyAttributeMapModel = exports.CopyShopCategoryMapModel = exports.CopyProductMapModel = exports.CopyProductJobModel = exports.ProductBrandModel = exports.TournamentParticipantModel = exports.TournamentModel = exports.BookingCancellationReschedulingRuleModel = exports.IntegrationConfigurationModel = exports.ServiceFlagModel = exports.PaymentConfigurationModel = exports.AppInstanceModel = exports.ZoneExtraTimeModel = exports.LoggerModel = exports.ServicePromotionModel = exports.TicketActionModel = exports.ProfessionalBlockedTimeModel = exports.ServiceBookingModel = exports.ServiceCartModel = exports.ProfessionalModel = exports.ServicePackageModel = exports.ServiceAddonModel = exports.ServiceCategoryModel =
|
|
17
|
+
exports.NutritionModel = exports.NotificationModel = exports.MealPlanModel = exports.SpendToGetMarketingModel = exports.PunchMarketingModel = exports.NewUserDiscountMarketingModel = exports.FreeDeliveryMarketingModel = exports.FeaturedMarketingModel = exports.DiscountMarketingModel = exports.Buy1Get1MarketingModel = exports.MarketingModel = exports.ListContainerModel = exports.LineItemModel = exports.GalleryUploadModel = exports.GalleryModel = exports.FlagModel = exports.FinanceSettlementModel = exports.FilterContainerModel = exports.FeaturedSettingModel = exports.FavouriteModel = exports.DishModel = exports.LimitedTimeOfferParticipantModel = exports.LimitedTimeOfferConfigModel = exports.LimitedTimeOfferCampaignSessionModel = exports.LimitedTimeOfferCampaignModel = exports.DealSettingModel = exports.ReferralRewardCouponModel = exports.ReferralCodeCouponModel = exports.IndividualUserCouponModel = exports.IndividualStoreCouponModel = exports.ShopsCategoriesCouponModel = exports.GlobalCouponModel = exports.CustomCouponModel = exports.BaseCouponModel = exports.CouponModel = exports.CounterModel = exports.CategoryModel = exports.CartParticipantModel = exports.CartModel = exports.UserActionModel = exports.ServiceControlModel = exports.AppAppearanceModel = exports.BrandModel = exports.BOBFinanceModel = exports.BannerModel = exports.AttributeModel = exports.UserAppSectionSettingModel = exports.AdminModel = exports.AdminAccessControlModel = exports.ActivityLogModel = void 0;
|
|
18
|
+
exports.VendorAccessControlModel = exports.VendorModel = exports.VendorParentModel = exports.ServiceModel = exports.ChatroomModel = exports.AgentPerformanceModel = exports.MessageModel = exports.TicketModel = exports.RewardModel = exports.CancellationReasonModel = exports.SupportReasonModel = exports.TermsAndConditionsModel = exports.DefaultChatModel = exports.DeliveryChargesModel = exports.ZoneModel = exports.UserModel = exports.TagModel = exports.SubscriptionModel = exports.ShopModel = exports.ShopSectionModel = exports.ShopMealPlanModel = exports.ShopCategoryModel = exports.ShopAccessControlModel = exports.SettingModel = exports.RiderModel = exports.RiderTrackingModel = exports.RiderTimeoutModel = exports.ServicePackageReviewModel = exports.VendorReviewModel = exports.RiderReviewModel = exports.ShopReviewModel = exports.ReviewModel = exports.RequestAreaModel = exports.ReferralSettingModel = exports.RatingSettingModel = exports.SpendToGetHistoryModel = exports.PunchMarketingHistoryModel = exports.ProductUploadModel = exports.ProductModel = exports.ProductStockTrackerModel = exports.ProductMarketingModel = exports.VendorPayoutModel = exports.RiderPayoutModel = exports.ShopPayoutModel = exports.PayoutModel = exports.ParentModel = exports.ShopCourierOrderModel = exports.CourierOrderModel = exports.RegularOrderModel = exports.OrderModel = void 0;
|
|
19
|
+
exports.UserShopHistoryModel = exports.CopyAttributeMapModel = exports.CopyShopCategoryMapModel = exports.CopyProductMapModel = exports.CopyProductJobModel = exports.ProductBrandModel = exports.TournamentParticipantModel = exports.TournamentModel = exports.BookingCancellationReschedulingRuleModel = exports.IntegrationConfigurationModel = exports.ServiceFlagModel = exports.PaymentConfigurationModel = exports.AppInstanceModel = exports.ZoneExtraTimeModel = exports.LoggerModel = exports.ServicePromotionModel = exports.TicketActionModel = exports.ProfessionalBlockedTimeModel = exports.ServiceBookingModel = exports.ServiceCartModel = exports.ProfessionalModel = exports.ServicePackageModel = exports.ServiceAddonModel = exports.ServiceCategoryModel = void 0;
|
|
20
20
|
exports.getCoreAuthIdentityModel = getCoreAuthIdentityModel;
|
|
21
21
|
exports.getCoreEmailAuthIdentityModel = getCoreEmailAuthIdentityModel;
|
|
22
22
|
exports.getCorePhoneAuthIdentityModel = getCorePhoneAuthIdentityModel;
|
|
@@ -163,7 +163,6 @@ const copy_product_job_model_1 = require("./copy-product-job.model");
|
|
|
163
163
|
const copy_product_map_model_1 = require("./copy-product-map.model");
|
|
164
164
|
const copy_shop_category_map_model_1 = require("./copy-shop-category-map.model");
|
|
165
165
|
const copy_attribute_map_model_1 = require("./copy-attribute-map.model");
|
|
166
|
-
const user_coupon_model_1 = require("./user-coupon.model");
|
|
167
166
|
exports.ActivityLogModel = (0, typegoose_1.getModelForClass)(activity_log_model_1.ActivityLog);
|
|
168
167
|
__exportStar(require("./activity-log.model"), exports);
|
|
169
168
|
exports.AdminAccessControlModel = (0, typegoose_1.getModelForClass)(admin_access_control_model_1.AdminAccessControl);
|
|
@@ -278,8 +277,6 @@ __exportStar(require("./providers/individual-store-coupon.model"), exports);
|
|
|
278
277
|
__exportStar(require("./providers/individual-user-coupon.model"), exports);
|
|
279
278
|
__exportStar(require("./providers/referral-code-coupon.model"), exports);
|
|
280
279
|
__exportStar(require("./providers/referral-reward-coupon.model"), exports);
|
|
281
|
-
exports.UserCouponModel = (0, typegoose_1.getModelForClass)(user_coupon_model_1.UserCoupon);
|
|
282
|
-
__exportStar(require("./user-coupon.model"), exports);
|
|
283
280
|
exports.DealSettingModel = (0, typegoose_1.getModelForClass)(deal_setting_model_1.DealSetting);
|
|
284
281
|
__exportStar(require("./deal-setting.model"), exports);
|
|
285
282
|
exports.LimitedTimeOfferCampaignModel = (0, typegoose_1.getModelForClass)(limited_time_offer_campaign_model_1.LimitedTimeOfferCampaign);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/mongo/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAmMA,4DAIC;AAED,sEAIC;AAED,sEAIC;AAED,wEAIC;AAED,sEAIC;AAED,4CAIC;AAED,oCAGC;AAED,sDAIC;AAGD,wDAuCC;AA6YD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Ac,CAAC,CAAC;AAC5G,2DAAyC;AAC5B,QAAA,wBAAwB,GACpC,IAAA,4BAAgB,EAAC,kDAAmB,CAAC,CAAC;AACvC,iEAA+C;AAClC,QAAA,qBAAqB,GACjC,IAAA,4BAAgB,EAAC,2CAAgB,CAAC,CAAC;AACpC,6DAA2C;AAE9B,QAAA,oBAAoB,GAChC,IAAA,4BAAgB,EAAC,yCAAe,CAAC,CAAC;AACnC,4DAA0C","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 { Attribute } from './attribute.model';\nimport { Banner } from './banner.model';\nimport { BaseCoupon } from './base/base-coupon.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 { Favourite } from './favourite.model';\nimport { FeaturedSetting } from './featured-setting.model';\nimport { FilterContainer } from './filter-container.model';\nimport { LimitedTimeOfferCampaign } from './limited-time-offer-campaign.model';\nimport { LimitedTimeOfferCampaignSession } from './limited-time-offer-campaign-session.model';\nimport { LimitedTimeOfferConfig } from './limited-time-offer-config';\nimport { LimitedTimeOfferParticipant } from './limited-time-offer-participant.model';\nimport { ListContainer } from './list-container.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 { SpendToGetHistory } from './spend-to-get-history.model';\nimport { RatingSetting } from './rating-setting.model';\nimport { ReferralSetting } from './referral-setting.model';\nimport { RequestArea } from './request-area.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 { ShopSection } from './shop-section.model';\nimport { Shop } from './shop.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\tCoreAuthIdentityType,\n\tCounterType,\n\tCouponType,\n\tMarketingType,\n\tOrderType,\n\tPayoutType,\n\tReviewType,\n} from '../../../utilities/enum';\nimport { ServiceAddon } from './service-addon.model';\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 { NewUserDiscountMarketing } from './providers/new-user-discount-marketing.model';\nimport { PunchMarketing } from './providers/punch-marketing.model';\nimport { SpendToGetMarketing } from './providers/spend-to-get-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 { RiderTracking } from './rider-tracking.model';\nimport { Rider } from './rider.model';\nimport { RiderTimeout } from './rider-timeout.model';\nimport { User } from './user.model';\nimport { UserShopHistory } from './user-shop-history.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 { 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 { VendorParent } from './vendor-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';\nimport { Professional } from './professional.model';\nimport { Service } from './service.model';\nimport { TicketAction } from './ticket-action.model';\nimport { ServiceCart } from './service-cart.model';\nimport { ShopCourierOrder } from './providers/shop-courier.model';\nimport { ServicePromotion } from './service-promotion.model';\nimport { ServiceBooking } from './service-booking.model';\nimport { Flag } from './flag.model';\nimport { Review } from './review.model';\nimport { ShopReview } from './providers/shop-review.model';\nimport { RiderReview } from './providers/rider-review.model';\nimport { VendorReview } from './providers/vendor-review.model';\nimport { assignIdsToDocuments } from '../../../utilities/id-generator';\nimport { GalleryUpload } from './gallery-upload.model';\nimport { ProductUpload } from './product-upload.model';\nimport { ShopsCategoriesCoupon } from './providers/shops-categories-coupon.model';\nimport { ProfessionalBlockedTime } from './professional-blocked-time.model';\nimport { ZoneExtraTime } from './zone-extra-time';\nimport { AppAppearance } from './app-appearance.model';\nimport { ServiceControl } from './service-control.model';\nimport { Log } from './log.model';\nimport { Card } from './card.model';\nimport { ProductStockTracker } from './product-stock-tracker.model';\nimport { PaymentIntent } from './payment-intent.model';\nimport { AppInstance } from './app-instance.model';\nimport { PaymentConfiguration } from './payment-configuration.model';\nimport { ServiceFlag } from './service-flag.model';\nimport { IntegrationConfiguration } from './integration-configuration.model';\nimport { ServicePackageReview } from './providers/service-package-review.model';\nimport { VendorPayout } from './providers/vendor-payout.model';\nimport { BookingCancellationReschedulingRule } from './booking-cancellation-rescheduling-rules.model';\nimport { UserAction } from './user-action.model';\nimport { Tournament } from './tournament.model';\nimport { TournamentParticipant } from './tournament-participant.model';\nimport { DeliveryCharges } from './delivery-charges.model';\nimport { UserAppSectionSetting } from './user-app-section-setting.model';\nimport { ProductBrand } from './product-brand.model';\nimport { CopyProductJob } from './copy-product-job.model';\nimport { CopyProductMap } from './copy-product-map.model';\nimport { CopyShopCategoryMap } from './copy-shop-category-map.model';\nimport { CopyAttributeMap } from './copy-attribute-map.model';\nimport { UserCoupon } from './user-coupon.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\nexport const AppAppearanceModel: ReturnModelType<typeof AppAppearance> = getModelForClass(AppAppearance);\nexport * from './app-appearance.model';\n\nexport const ServiceControlModel: ReturnModelType<typeof ServiceControl> = getModelForClass(ServiceControl);\nexport * from './service-control.model';\n\nexport const UserActionModel: ReturnModelType<typeof UserAction> = getModelForClass(UserAction);\nexport * from './user-action.model';\n\n// Global models - will be set after initGlobalConnection()\nlet actualCoreAuthIdentityModel: ReturnModelType<typeof CoreAuthIdentity> | null = null;\nlet actualCoreUserModel: ReturnModelType<typeof CoreUser> | null = null;\nlet actualCardModel: ReturnModelType<typeof Card> | null = null;\nlet actualPaymentIntentModel: ReturnModelType<typeof PaymentIntent> | null = null;\n\n// Global discriminator models - will be set after initGlobalConnection()\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 getCoreAuthIdentityModel(): ReturnModelType<typeof CoreAuthIdentity> {\n\tif (!actualCoreAuthIdentityModel)\n\t\tthrow new Error('CoreAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreAuthIdentityModel;\n}\n\nexport function getCoreEmailAuthIdentityModel(): ReturnModelType<typeof CoreEmailAuthIdentity> {\n\tif (!actualCoreEmailAuthIdentityModel)\n\t\tthrow new Error('CoreEmailAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreEmailAuthIdentityModel;\n}\n\nexport function getCorePhoneAuthIdentityModel(): ReturnModelType<typeof CorePhoneAuthIdentity> {\n\tif (!actualCorePhoneAuthIdentityModel)\n\t\tthrow new Error('CorePhoneAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCorePhoneAuthIdentityModel;\n}\n\nexport function getCoreGoogleAuthIdentityModel(): ReturnModelType<typeof CoreGoogleAuthIdentity> {\n\tif (!actualCoreGoogleAuthIdentityModel)\n\t\tthrow new Error('CoreGoogleAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreGoogleAuthIdentityModel;\n}\n\nexport function getCoreAppleAuthIdentityModel(): ReturnModelType<typeof CoreAppleAuthIdentity> {\n\tif (!actualCoreAppleAuthIdentityModel)\n\t\tthrow new Error('CoreAppleAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreAppleAuthIdentityModel;\n}\n\nexport function getCoreUserModel(): ReturnModelType<typeof CoreUser> {\n\tif (!actualCoreUserModel)\n\t\tthrow new Error('CoreUser model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreUserModel;\n}\n\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 getPaymentIntentModel(): ReturnModelType<typeof PaymentIntent> {\n\tif (!actualPaymentIntentModel)\n\t\tthrow new Error('Payment Intent model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualPaymentIntentModel;\n}\n\n// Function to initialize all global models (called from initGlobalConnection)\nexport function initializeGlobalModels(globalConnection: any) {\n\t// Initialize base global models\n\tactualCoreAuthIdentityModel = getModelForClass(CoreAuthIdentity, { existingConnection: globalConnection });\n\tactualCoreUserModel = getModelForClass(CoreUser, { existingConnection: globalConnection });\n\tactualCardModel = getModelForClass(Card, { existingConnection: globalConnection });\n\tactualPaymentIntentModel = getModelForClass(PaymentIntent, { existingConnection: globalConnection });\n\n\t// Initialize discriminator models\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 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';\n\nexport const CounterModel: ReturnModelType<typeof Counter> = getModelForClass(Counter);\nexport * from './counter.model';\n\nexport const CouponModel: ReturnModelType<typeof Coupon> = getModelForClass(Coupon);\nexport const BaseCouponModel: ReturnModelType<typeof BaseCoupon> = getModelForClass(BaseCoupon);\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 ShopsCategoriesCouponModel: ReturnModelType<typeof ShopsCategoriesCoupon> =\n\tgetDiscriminatorModelForClass(CouponModel, ShopsCategoriesCoupon, CouponType.SHOPS_CATEGORIES);\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 './base/base-coupon.model';\nexport * from './providers/custom-coupon.model';\nexport * from './providers/global-coupon.model';\nexport * from './providers/shops-categories-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 UserCouponModel: ReturnModelType<typeof UserCoupon> = getModelForClass(UserCoupon);\nexport * from './user-coupon.model';\n\nexport const DealSettingModel: ReturnModelType<typeof DealSetting> = getModelForClass(DealSetting);\nexport * from './deal-setting.model';\n\nexport const LimitedTimeOfferCampaignModel: ReturnModelType<typeof LimitedTimeOfferCampaign> =\n\tgetModelForClass(LimitedTimeOfferCampaign);\nexport * from './limited-time-offer-campaign.model';\n\nexport const LimitedTimeOfferCampaignSessionModel: ReturnModelType<typeof LimitedTimeOfferCampaignSession> =\n\tgetModelForClass(LimitedTimeOfferCampaignSession);\nexport * from './limited-time-offer-campaign-session.model';\n\nexport const LimitedTimeOfferConfigModel: ReturnModelType<typeof LimitedTimeOfferConfig> =\n\tgetModelForClass(LimitedTimeOfferConfig);\nexport * from './limited-time-offer-config';\n\nexport const LimitedTimeOfferParticipantModel: ReturnModelType<typeof LimitedTimeOfferParticipant> =\n\tgetModelForClass(LimitedTimeOfferParticipant);\nexport * from './limited-time-offer-participant.model';\n\nexport const DishModel: ReturnModelType<typeof Dish> = getModelForClass(Dish);\nexport * from './dish.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 FlagModel: ReturnModelType<typeof Flag> = getModelForClass(Flag);\nexport * from './flag.model';\n\nexport const GalleryModel: ReturnModelType<typeof Gallery> = getModelForClass(Gallery);\nexport * from './gallery.model';\n\nexport const GalleryUploadModel: ReturnModelType<typeof GalleryUpload> = getModelForClass(GalleryUpload);\nexport * from './gallery-upload.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 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 NewUserDiscountMarketingModel: ReturnModelType<typeof NewUserDiscountMarketing> =\n\tgetDiscriminatorModelForClass(MarketingModel, NewUserDiscountMarketing, MarketingType.NEW_USER_DISCOUNT);\nexport const PunchMarketingModel: ReturnModelType<typeof PunchMarketing> = getDiscriminatorModelForClass(\n\tMarketingModel,\n\tPunchMarketing,\n\tMarketingType.PUNCH_MARKETING\n);\nexport const SpendToGetMarketingModel: ReturnModelType<typeof SpendToGetMarketing> =\n\tgetDiscriminatorModelForClass(MarketingModel, SpendToGetMarketing, MarketingType.SPEND_TO_GET);\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/new-user-discount-marketing.model';\nexport * from './providers/punch-marketing.model';\nexport * from './providers/spend-to-get-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);\n\nexport const ShopCourierOrderModel: ReturnModelType<typeof ShopCourierOrder> = getDiscriminatorModelForClass(\n\tOrderModel,\n\tShopCourierOrder,\n\tOrderType.SHOP_COURIER\n);\n\nexport * from './order.model';\nexport * from './providers/regular-order.model';\nexport * from './providers/courier-order.model';\nexport * from './providers/shop-courier.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 const VendorPayoutModel: ReturnModelType<typeof VendorPayout> = getDiscriminatorModelForClass(\n\tPayoutModel,\n\tVendorPayout,\n\tPayoutType.VENDOR\n);\nexport * from './payout.model';\nexport * from './providers/shop-payout.model';\nexport * from './providers/rider-payout.model';\nexport * from './providers/vendor-payout.model';\n\nexport const ProductMarketingModel: ReturnModelType<typeof ProductMarketing> =\n\tgetModelForClass(ProductMarketing);\nexport * from './product-marketing.model';\n\nexport const ProductStockTrackerModel: ReturnModelType<typeof ProductStockTracker> =\n\tgetModelForClass(ProductStockTracker);\nexport * from './product-stock-tracker.model';\n\nexport const ProductModel: ReturnModelType<typeof Product> = getModelForClass(Product);\nexport * from './product.model';\nProductModel.schema.pre('insertMany', async function (next, docs: Product[]) {\n\t// Generate all IDs at once (ATOMIC)\n\tawait assignIdsToDocuments(CounterModel, CounterType.ITEM, docs, 'productId');\n\tnext();\n});\n\nexport const ProductUploadModel: ReturnModelType<typeof ProductUpload> = getModelForClass(ProductUpload);\nexport * from './product-upload.model';\n\nexport const PunchMarketingHistoryModel: ReturnModelType<typeof PunchMarketingHistory> =\n\tgetModelForClass(PunchMarketingHistory);\nexport * from './punch-marketing-history.model';\n\nexport const SpendToGetHistoryModel: ReturnModelType<typeof SpendToGetHistory> =\n\tgetModelForClass(SpendToGetHistory);\nexport * from './spend-to-get-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 ReviewModel: ReturnModelType<typeof Review> = getModelForClass(Review);\nexport const ShopReviewModel: ReturnModelType<typeof ShopReview> = getDiscriminatorModelForClass(\n\tReviewModel,\n\tShopReview,\n\tReviewType.SHOP\n);\nexport const RiderReviewModel: ReturnModelType<typeof RiderReview> = getDiscriminatorModelForClass(\n\tReviewModel,\n\tRiderReview,\n\tReviewType.RIDER\n);\nexport const VendorReviewModel: ReturnModelType<typeof VendorReview> = getDiscriminatorModelForClass(\n\tReviewModel,\n\tVendorReview,\n\tReviewType.VENDOR\n);\nexport const ServicePackageReviewModel: ReturnModelType<typeof ServicePackageReview> =\n\tgetDiscriminatorModelForClass(ReviewModel, ServicePackageReview, ReviewType.SERVICE_PACKAGE);\nexport * from './review.model';\nexport * from './providers/shop-review.model';\nexport * from './providers/rider-review.model';\nexport * from './providers/vendor-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 ShopSectionModel: ReturnModelType<typeof ShopSection> = getModelForClass(ShopSection);\nexport * from './shop-section.model';\n\nexport const ShopModel: ReturnModelType<typeof Shop> = getModelForClass(Shop);\nexport * from './shop.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 DeliveryChargesModel: ReturnModelType<typeof DeliveryCharges> =\n\tgetModelForClass(DeliveryCharges);\nexport * from './delivery-charges.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';\nexport * from './embedded/external-ref.model';\n\nexport const ServiceModel: ReturnModelType<typeof Service> = getModelForClass(Service);\nexport * from './service.model';\n\nexport const VendorParentModel: ReturnModelType<typeof VendorParent> = getModelForClass(VendorParent);\nexport * from './vendor-parent.model';\n\nexport const VendorModel: ReturnModelType<typeof Vendor> = getModelForClass(Vendor);\nexport * from './vendor.model';\n\nexport const VendorAccessControlModel: ReturnModelType<typeof VendorAccessControl> =\n\tgetModelForClass(VendorAccessControl);\nexport * from './vendor-access-control.model';\n\nexport const ServiceCategoryModel: ReturnModelType<typeof ServiceCategory> =\n\tgetModelForClass(ServiceCategory);\nexport * from './service-category.model';\n\nexport const ServiceAddonModel: ReturnModelType<typeof ServiceAddon> = getModelForClass(ServiceAddon);\nexport * from './service-addon.model';\n\nexport const ServicePackageModel: ReturnModelType<typeof ServicePackage> = getModelForClass(ServicePackage);\nexport * from './service-package.model';\n\nexport const ProfessionalModel: ReturnModelType<typeof Professional> = getModelForClass(Professional);\nexport * from './professional.model';\n\nexport const ServiceCartModel: ReturnModelType<typeof ServiceCart> = getModelForClass(ServiceCart);\nexport * from './service-cart.model';\n\nexport const ServiceBookingModel: ReturnModelType<typeof ServiceBooking> = getModelForClass(ServiceBooking);\nexport * from './service-booking.model';\n\nexport const ProfessionalBlockedTimeModel: ReturnModelType<typeof ProfessionalBlockedTime> =\n\tgetModelForClass(ProfessionalBlockedTime);\nexport * from './professional-blocked-time.model';\n\nexport const TicketActionModel: ReturnModelType<typeof TicketAction> = getModelForClass(TicketAction);\nexport * from './ticket-action.model';\n\nexport const ServicePromotionModel: ReturnModelType<typeof ServicePromotion> =\n\tgetModelForClass(ServicePromotion);\nexport * from './service-promotion.model';\n\nexport const LoggerModel: ReturnModelType<typeof Log> = getModelForClass(Log);\nexport * from './log.model';\n\nexport const ZoneExtraTimeModel: ReturnModelType<typeof ZoneExtraTime> = getModelForClass(ZoneExtraTime);\nexport * from './zone-extra-time';\n\nexport * from './google-maps-usage.model';\n\nexport const AppInstanceModel: ReturnModelType<typeof AppInstance> = getModelForClass(AppInstance);\nexport * from './app-instance.model';\n\nexport const PaymentConfigurationModel: ReturnModelType<typeof PaymentConfiguration> =\n\tgetModelForClass(PaymentConfiguration);\nexport * from './payment-configuration.model';\n\nexport const ServiceFlagModel: ReturnModelType<typeof ServiceFlag> = getModelForClass(ServiceFlag);\nexport * from './service-flag.model';\n\nexport const IntegrationConfigurationModel: ReturnModelType<typeof IntegrationConfiguration> =\n\tgetModelForClass(IntegrationConfiguration);\nexport * from './integration-configuration.model';\n\nexport function createIntegrationDiscriminator<U extends new (...args: any[]) => IntegrationConfiguration>(\n\tcls: U,\n\tkey: string\n): ReturnModelType<U> {\n\treturn getDiscriminatorModelForClass(IntegrationConfigurationModel, cls, key);\n}\n\nexport const BookingCancellationReschedulingRuleModel: ReturnModelType<\n\ttypeof BookingCancellationReschedulingRule\n> = getModelForClass(BookingCancellationReschedulingRule);\nexport * from './booking-cancellation-rescheduling-rules.model';\n\nexport const TournamentModel: ReturnModelType<typeof Tournament> = getModelForClass(Tournament);\nexport * from './tournament.model';\n\nexport const TournamentParticipantModel: ReturnModelType<typeof TournamentParticipant> =\n\tgetModelForClass(TournamentParticipant);\nexport * from './tournament-participant.model';\n\nexport const ProductBrandModel: ReturnModelType<typeof ProductBrand> = getModelForClass(ProductBrand);\nexport * from './product-brand.model';\n\nexport const CopyProductJobModel: ReturnModelType<typeof CopyProductJob> = getModelForClass(CopyProductJob);\nexport * from './copy-product-job.model';\nexport const CopyProductMapModel: ReturnModelType<typeof CopyProductMap> = getModelForClass(CopyProductMap);\nexport * from './copy-product-map.model';\nexport const CopyShopCategoryMapModel: ReturnModelType<typeof CopyShopCategoryMap> =\n\tgetModelForClass(CopyShopCategoryMap);\nexport * from './copy-shop-category-map.model';\nexport const CopyAttributeMapModel: ReturnModelType<typeof CopyAttributeMap> =\n\tgetModelForClass(CopyAttributeMap);\nexport * from './copy-attribute-map.model';\n\nexport const UserShopHistoryModel: ReturnModelType<typeof UserShopHistory> =\n\tgetModelForClass(UserShopHistory);\nexport * from './user-shop-history.model';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/mongo/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAkMA,4DAIC;AAED,sEAIC;AAED,sEAIC;AAED,wEAIC;AAED,sEAIC;AAED,4CAIC;AAED,oCAGC;AAED,sDAIC;AAGD,wDAuCC;AA0YD,wEAKC;AAxqBD,uEAA6D;AAC7D,qEAA2D;AAC3D,oDAAwG;AACxG,+CAAsC;AACtC,6EAAkE;AAClE,6DAAmD;AACnD,uDAA8C;AAC9C,iDAAwC;AACxC,gEAAsD;AACtD,2DAAiD;AACjD,+CAAsC;AACtC,qDAA4C;AAC5C,mDAA0C;AAC1C,iDAAwC;AACxC,6DAAmD;AACnD,6CAAoC;AACpC,uDAA8C;AAC9C,qEAA2D;AAC3D,qEAA2D;AAC3D,2FAA+E;AAC/E,2GAA8F;AAC9F,2EAAqE;AACrE,iGAAqF;AACrF,iEAAuD;AACvD,uDAA8C;AAC9C,uDAA6C;AAC7C,uDAA8C;AAC9C,iDAAwC;AACxC,uEAA6D;AAC7D,mDAA0C;AAC1C,mFAAwE;AACxE,6EAAiE;AACjE,iEAAuD;AACvD,qEAA2D;AAC3D,6DAAmD;AACnD,mDAA0C;AAC1C,2EAAgE;AAChE,+DAAqD;AACrD,iEAAsD;AACtD,6DAAmD;AACnD,6CAAoC;AACpC,6DAAoD;AACpD,2CAAkC;AAClC,6CAAoC;AACpC,qFAA0E;AAC1E,kDAQiC;AACjC,+DAAqD;AACrD,yEAA+D;AAC/D,mFAAyE;AACzE,mFAAyE;AACzE,6FAAkF;AAClF,yEAA+D;AAC/D,6FAAkF;AAClF,2FAAgF;AAChF,qGAAy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DAAmC;AAEtB,QAAA,0BAA0B,GACtC,IAAA,4BAAgB,EAAC,oDAAqB,CAAC,CAAC;AACzC,iEAA+C;AAElC,QAAA,iBAAiB,GAAyC,IAAA,4BAAgB,EAAC,kCAAY,CAAC,CAAC;AACtG,wDAAsC;AAEzB,QAAA,mBAAmB,GAA2C,IAAA,4BAAgB,EAAC,uCAAc,CAAC,CAAC;AAC5G,2DAAyC;AAC5B,QAAA,mBAAmB,GAA2C,IAAA,4BAAgB,EAAC,uCAAc,CAAC,CAAC;AAC5G,2DAAyC;AAC5B,QAAA,wBAAwB,GACpC,IAAA,4BAAgB,EAAC,kDAAmB,CAAC,CAAC;AACvC,iEAA+C;AAClC,QAAA,qBAAqB,GACjC,IAAA,4BAAgB,EAAC,2CAAgB,CAAC,CAAC;AACpC,6DAA2C;AAE9B,QAAA,oBAAoB,GAChC,IAAA,4BAAgB,EAAC,yCAAe,CAAC,CAAC;AACnC,4DAA0C","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 { Attribute } from './attribute.model';\nimport { Banner } from './banner.model';\nimport { BaseCoupon } from './base/base-coupon.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 { Favourite } from './favourite.model';\nimport { FeaturedSetting } from './featured-setting.model';\nimport { FilterContainer } from './filter-container.model';\nimport { LimitedTimeOfferCampaign } from './limited-time-offer-campaign.model';\nimport { LimitedTimeOfferCampaignSession } from './limited-time-offer-campaign-session.model';\nimport { LimitedTimeOfferConfig } from './limited-time-offer-config';\nimport { LimitedTimeOfferParticipant } from './limited-time-offer-participant.model';\nimport { ListContainer } from './list-container.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 { SpendToGetHistory } from './spend-to-get-history.model';\nimport { RatingSetting } from './rating-setting.model';\nimport { ReferralSetting } from './referral-setting.model';\nimport { RequestArea } from './request-area.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 { ShopSection } from './shop-section.model';\nimport { Shop } from './shop.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\tCoreAuthIdentityType,\n\tCounterType,\n\tCouponType,\n\tMarketingType,\n\tOrderType,\n\tPayoutType,\n\tReviewType,\n} from '../../../utilities/enum';\nimport { ServiceAddon } from './service-addon.model';\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 { NewUserDiscountMarketing } from './providers/new-user-discount-marketing.model';\nimport { PunchMarketing } from './providers/punch-marketing.model';\nimport { SpendToGetMarketing } from './providers/spend-to-get-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 { RiderTracking } from './rider-tracking.model';\nimport { Rider } from './rider.model';\nimport { RiderTimeout } from './rider-timeout.model';\nimport { User } from './user.model';\nimport { UserShopHistory } from './user-shop-history.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 { 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 { VendorParent } from './vendor-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';\nimport { Professional } from './professional.model';\nimport { Service } from './service.model';\nimport { TicketAction } from './ticket-action.model';\nimport { ServiceCart } from './service-cart.model';\nimport { ShopCourierOrder } from './providers/shop-courier.model';\nimport { ServicePromotion } from './service-promotion.model';\nimport { ServiceBooking } from './service-booking.model';\nimport { Flag } from './flag.model';\nimport { Review } from './review.model';\nimport { ShopReview } from './providers/shop-review.model';\nimport { RiderReview } from './providers/rider-review.model';\nimport { VendorReview } from './providers/vendor-review.model';\nimport { assignIdsToDocuments } from '../../../utilities/id-generator';\nimport { GalleryUpload } from './gallery-upload.model';\nimport { ProductUpload } from './product-upload.model';\nimport { ShopsCategoriesCoupon } from './providers/shops-categories-coupon.model';\nimport { ProfessionalBlockedTime } from './professional-blocked-time.model';\nimport { ZoneExtraTime } from './zone-extra-time';\nimport { AppAppearance } from './app-appearance.model';\nimport { ServiceControl } from './service-control.model';\nimport { Log } from './log.model';\nimport { Card } from './card.model';\nimport { ProductStockTracker } from './product-stock-tracker.model';\nimport { PaymentIntent } from './payment-intent.model';\nimport { AppInstance } from './app-instance.model';\nimport { PaymentConfiguration } from './payment-configuration.model';\nimport { ServiceFlag } from './service-flag.model';\nimport { IntegrationConfiguration } from './integration-configuration.model';\nimport { ServicePackageReview } from './providers/service-package-review.model';\nimport { VendorPayout } from './providers/vendor-payout.model';\nimport { BookingCancellationReschedulingRule } from './booking-cancellation-rescheduling-rules.model';\nimport { UserAction } from './user-action.model';\nimport { Tournament } from './tournament.model';\nimport { TournamentParticipant } from './tournament-participant.model';\nimport { DeliveryCharges } from './delivery-charges.model';\nimport { UserAppSectionSetting } from './user-app-section-setting.model';\nimport { ProductBrand } from './product-brand.model';\nimport { CopyProductJob } from './copy-product-job.model';\nimport { CopyProductMap } from './copy-product-map.model';\nimport { CopyShopCategoryMap } from './copy-shop-category-map.model';\nimport { CopyAttributeMap } from './copy-attribute-map.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\nexport const AppAppearanceModel: ReturnModelType<typeof AppAppearance> = getModelForClass(AppAppearance);\nexport * from './app-appearance.model';\n\nexport const ServiceControlModel: ReturnModelType<typeof ServiceControl> = getModelForClass(ServiceControl);\nexport * from './service-control.model';\n\nexport const UserActionModel: ReturnModelType<typeof UserAction> = getModelForClass(UserAction);\nexport * from './user-action.model';\n\n// Global models - will be set after initGlobalConnection()\nlet actualCoreAuthIdentityModel: ReturnModelType<typeof CoreAuthIdentity> | null = null;\nlet actualCoreUserModel: ReturnModelType<typeof CoreUser> | null = null;\nlet actualCardModel: ReturnModelType<typeof Card> | null = null;\nlet actualPaymentIntentModel: ReturnModelType<typeof PaymentIntent> | null = null;\n\n// Global discriminator models - will be set after initGlobalConnection()\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 getCoreAuthIdentityModel(): ReturnModelType<typeof CoreAuthIdentity> {\n\tif (!actualCoreAuthIdentityModel)\n\t\tthrow new Error('CoreAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreAuthIdentityModel;\n}\n\nexport function getCoreEmailAuthIdentityModel(): ReturnModelType<typeof CoreEmailAuthIdentity> {\n\tif (!actualCoreEmailAuthIdentityModel)\n\t\tthrow new Error('CoreEmailAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreEmailAuthIdentityModel;\n}\n\nexport function getCorePhoneAuthIdentityModel(): ReturnModelType<typeof CorePhoneAuthIdentity> {\n\tif (!actualCorePhoneAuthIdentityModel)\n\t\tthrow new Error('CorePhoneAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCorePhoneAuthIdentityModel;\n}\n\nexport function getCoreGoogleAuthIdentityModel(): ReturnModelType<typeof CoreGoogleAuthIdentity> {\n\tif (!actualCoreGoogleAuthIdentityModel)\n\t\tthrow new Error('CoreGoogleAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreGoogleAuthIdentityModel;\n}\n\nexport function getCoreAppleAuthIdentityModel(): ReturnModelType<typeof CoreAppleAuthIdentity> {\n\tif (!actualCoreAppleAuthIdentityModel)\n\t\tthrow new Error('CoreAppleAuthIdentity model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreAppleAuthIdentityModel;\n}\n\nexport function getCoreUserModel(): ReturnModelType<typeof CoreUser> {\n\tif (!actualCoreUserModel)\n\t\tthrow new Error('CoreUser model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualCoreUserModel;\n}\n\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 getPaymentIntentModel(): ReturnModelType<typeof PaymentIntent> {\n\tif (!actualPaymentIntentModel)\n\t\tthrow new Error('Payment Intent model not initialized yet. Call initGlobalConnection() first.');\n\treturn actualPaymentIntentModel;\n}\n\n// Function to initialize all global models (called from initGlobalConnection)\nexport function initializeGlobalModels(globalConnection: any) {\n\t// Initialize base global models\n\tactualCoreAuthIdentityModel = getModelForClass(CoreAuthIdentity, { existingConnection: globalConnection });\n\tactualCoreUserModel = getModelForClass(CoreUser, { existingConnection: globalConnection });\n\tactualCardModel = getModelForClass(Card, { existingConnection: globalConnection });\n\tactualPaymentIntentModel = getModelForClass(PaymentIntent, { existingConnection: globalConnection });\n\n\t// Initialize discriminator models\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 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';\n\nexport const CounterModel: ReturnModelType<typeof Counter> = getModelForClass(Counter);\nexport * from './counter.model';\n\nexport const CouponModel: ReturnModelType<typeof Coupon> = getModelForClass(Coupon);\nexport const BaseCouponModel: ReturnModelType<typeof BaseCoupon> = getModelForClass(BaseCoupon);\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 ShopsCategoriesCouponModel: ReturnModelType<typeof ShopsCategoriesCoupon> =\n\tgetDiscriminatorModelForClass(CouponModel, ShopsCategoriesCoupon, CouponType.SHOPS_CATEGORIES);\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 './base/base-coupon.model';\nexport * from './providers/custom-coupon.model';\nexport * from './providers/global-coupon.model';\nexport * from './providers/shops-categories-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 LimitedTimeOfferCampaignModel: ReturnModelType<typeof LimitedTimeOfferCampaign> =\n\tgetModelForClass(LimitedTimeOfferCampaign);\nexport * from './limited-time-offer-campaign.model';\n\nexport const LimitedTimeOfferCampaignSessionModel: ReturnModelType<typeof LimitedTimeOfferCampaignSession> =\n\tgetModelForClass(LimitedTimeOfferCampaignSession);\nexport * from './limited-time-offer-campaign-session.model';\n\nexport const LimitedTimeOfferConfigModel: ReturnModelType<typeof LimitedTimeOfferConfig> =\n\tgetModelForClass(LimitedTimeOfferConfig);\nexport * from './limited-time-offer-config';\n\nexport const LimitedTimeOfferParticipantModel: ReturnModelType<typeof LimitedTimeOfferParticipant> =\n\tgetModelForClass(LimitedTimeOfferParticipant);\nexport * from './limited-time-offer-participant.model';\n\nexport const DishModel: ReturnModelType<typeof Dish> = getModelForClass(Dish);\nexport * from './dish.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 FlagModel: ReturnModelType<typeof Flag> = getModelForClass(Flag);\nexport * from './flag.model';\n\nexport const GalleryModel: ReturnModelType<typeof Gallery> = getModelForClass(Gallery);\nexport * from './gallery.model';\n\nexport const GalleryUploadModel: ReturnModelType<typeof GalleryUpload> = getModelForClass(GalleryUpload);\nexport * from './gallery-upload.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 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 NewUserDiscountMarketingModel: ReturnModelType<typeof NewUserDiscountMarketing> =\n\tgetDiscriminatorModelForClass(MarketingModel, NewUserDiscountMarketing, MarketingType.NEW_USER_DISCOUNT);\nexport const PunchMarketingModel: ReturnModelType<typeof PunchMarketing> = getDiscriminatorModelForClass(\n\tMarketingModel,\n\tPunchMarketing,\n\tMarketingType.PUNCH_MARKETING\n);\nexport const SpendToGetMarketingModel: ReturnModelType<typeof SpendToGetMarketing> =\n\tgetDiscriminatorModelForClass(MarketingModel, SpendToGetMarketing, MarketingType.SPEND_TO_GET);\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/new-user-discount-marketing.model';\nexport * from './providers/punch-marketing.model';\nexport * from './providers/spend-to-get-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);\n\nexport const ShopCourierOrderModel: ReturnModelType<typeof ShopCourierOrder> = getDiscriminatorModelForClass(\n\tOrderModel,\n\tShopCourierOrder,\n\tOrderType.SHOP_COURIER\n);\n\nexport * from './order.model';\nexport * from './providers/regular-order.model';\nexport * from './providers/courier-order.model';\nexport * from './providers/shop-courier.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 const VendorPayoutModel: ReturnModelType<typeof VendorPayout> = getDiscriminatorModelForClass(\n\tPayoutModel,\n\tVendorPayout,\n\tPayoutType.VENDOR\n);\nexport * from './payout.model';\nexport * from './providers/shop-payout.model';\nexport * from './providers/rider-payout.model';\nexport * from './providers/vendor-payout.model';\n\nexport const ProductMarketingModel: ReturnModelType<typeof ProductMarketing> =\n\tgetModelForClass(ProductMarketing);\nexport * from './product-marketing.model';\n\nexport const ProductStockTrackerModel: ReturnModelType<typeof ProductStockTracker> =\n\tgetModelForClass(ProductStockTracker);\nexport * from './product-stock-tracker.model';\n\nexport const ProductModel: ReturnModelType<typeof Product> = getModelForClass(Product);\nexport * from './product.model';\nProductModel.schema.pre('insertMany', async function (next, docs: Product[]) {\n\t// Generate all IDs at once (ATOMIC)\n\tawait assignIdsToDocuments(CounterModel, CounterType.ITEM, docs, 'productId');\n\tnext();\n});\n\nexport const ProductUploadModel: ReturnModelType<typeof ProductUpload> = getModelForClass(ProductUpload);\nexport * from './product-upload.model';\n\nexport const PunchMarketingHistoryModel: ReturnModelType<typeof PunchMarketingHistory> =\n\tgetModelForClass(PunchMarketingHistory);\nexport * from './punch-marketing-history.model';\n\nexport const SpendToGetHistoryModel: ReturnModelType<typeof SpendToGetHistory> =\n\tgetModelForClass(SpendToGetHistory);\nexport * from './spend-to-get-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 ReviewModel: ReturnModelType<typeof Review> = getModelForClass(Review);\nexport const ShopReviewModel: ReturnModelType<typeof ShopReview> = getDiscriminatorModelForClass(\n\tReviewModel,\n\tShopReview,\n\tReviewType.SHOP\n);\nexport const RiderReviewModel: ReturnModelType<typeof RiderReview> = getDiscriminatorModelForClass(\n\tReviewModel,\n\tRiderReview,\n\tReviewType.RIDER\n);\nexport const VendorReviewModel: ReturnModelType<typeof VendorReview> = getDiscriminatorModelForClass(\n\tReviewModel,\n\tVendorReview,\n\tReviewType.VENDOR\n);\nexport const ServicePackageReviewModel: ReturnModelType<typeof ServicePackageReview> =\n\tgetDiscriminatorModelForClass(ReviewModel, ServicePackageReview, ReviewType.SERVICE_PACKAGE);\nexport * from './review.model';\nexport * from './providers/shop-review.model';\nexport * from './providers/rider-review.model';\nexport * from './providers/vendor-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 ShopSectionModel: ReturnModelType<typeof ShopSection> = getModelForClass(ShopSection);\nexport * from './shop-section.model';\n\nexport const ShopModel: ReturnModelType<typeof Shop> = getModelForClass(Shop);\nexport * from './shop.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 DeliveryChargesModel: ReturnModelType<typeof DeliveryCharges> =\n\tgetModelForClass(DeliveryCharges);\nexport * from './delivery-charges.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';\nexport * from './embedded/external-ref.model';\n\nexport const ServiceModel: ReturnModelType<typeof Service> = getModelForClass(Service);\nexport * from './service.model';\n\nexport const VendorParentModel: ReturnModelType<typeof VendorParent> = getModelForClass(VendorParent);\nexport * from './vendor-parent.model';\n\nexport const VendorModel: ReturnModelType<typeof Vendor> = getModelForClass(Vendor);\nexport * from './vendor.model';\n\nexport const VendorAccessControlModel: ReturnModelType<typeof VendorAccessControl> =\n\tgetModelForClass(VendorAccessControl);\nexport * from './vendor-access-control.model';\n\nexport const ServiceCategoryModel: ReturnModelType<typeof ServiceCategory> =\n\tgetModelForClass(ServiceCategory);\nexport * from './service-category.model';\n\nexport const ServiceAddonModel: ReturnModelType<typeof ServiceAddon> = getModelForClass(ServiceAddon);\nexport * from './service-addon.model';\n\nexport const ServicePackageModel: ReturnModelType<typeof ServicePackage> = getModelForClass(ServicePackage);\nexport * from './service-package.model';\n\nexport const ProfessionalModel: ReturnModelType<typeof Professional> = getModelForClass(Professional);\nexport * from './professional.model';\n\nexport const ServiceCartModel: ReturnModelType<typeof ServiceCart> = getModelForClass(ServiceCart);\nexport * from './service-cart.model';\n\nexport const ServiceBookingModel: ReturnModelType<typeof ServiceBooking> = getModelForClass(ServiceBooking);\nexport * from './service-booking.model';\n\nexport const ProfessionalBlockedTimeModel: ReturnModelType<typeof ProfessionalBlockedTime> =\n\tgetModelForClass(ProfessionalBlockedTime);\nexport * from './professional-blocked-time.model';\n\nexport const TicketActionModel: ReturnModelType<typeof TicketAction> = getModelForClass(TicketAction);\nexport * from './ticket-action.model';\n\nexport const ServicePromotionModel: ReturnModelType<typeof ServicePromotion> =\n\tgetModelForClass(ServicePromotion);\nexport * from './service-promotion.model';\n\nexport const LoggerModel: ReturnModelType<typeof Log> = getModelForClass(Log);\nexport * from './log.model';\n\nexport const ZoneExtraTimeModel: ReturnModelType<typeof ZoneExtraTime> = getModelForClass(ZoneExtraTime);\nexport * from './zone-extra-time';\n\nexport * from './google-maps-usage.model';\n\nexport const AppInstanceModel: ReturnModelType<typeof AppInstance> = getModelForClass(AppInstance);\nexport * from './app-instance.model';\n\nexport const PaymentConfigurationModel: ReturnModelType<typeof PaymentConfiguration> =\n\tgetModelForClass(PaymentConfiguration);\nexport * from './payment-configuration.model';\n\nexport const ServiceFlagModel: ReturnModelType<typeof ServiceFlag> = getModelForClass(ServiceFlag);\nexport * from './service-flag.model';\n\nexport const IntegrationConfigurationModel: ReturnModelType<typeof IntegrationConfiguration> =\n\tgetModelForClass(IntegrationConfiguration);\nexport * from './integration-configuration.model';\n\nexport function createIntegrationDiscriminator<U extends new (...args: any[]) => IntegrationConfiguration>(\n\tcls: U,\n\tkey: string\n): ReturnModelType<U> {\n\treturn getDiscriminatorModelForClass(IntegrationConfigurationModel, cls, key);\n}\n\nexport const BookingCancellationReschedulingRuleModel: ReturnModelType<\n\ttypeof BookingCancellationReschedulingRule\n> = getModelForClass(BookingCancellationReschedulingRule);\nexport * from './booking-cancellation-rescheduling-rules.model';\n\nexport const TournamentModel: ReturnModelType<typeof Tournament> = getModelForClass(Tournament);\nexport * from './tournament.model';\n\nexport const TournamentParticipantModel: ReturnModelType<typeof TournamentParticipant> =\n\tgetModelForClass(TournamentParticipant);\nexport * from './tournament-participant.model';\n\nexport const ProductBrandModel: ReturnModelType<typeof ProductBrand> = getModelForClass(ProductBrand);\nexport * from './product-brand.model';\n\nexport const CopyProductJobModel: ReturnModelType<typeof CopyProductJob> = getModelForClass(CopyProductJob);\nexport * from './copy-product-job.model';\nexport const CopyProductMapModel: ReturnModelType<typeof CopyProductMap> = getModelForClass(CopyProductMap);\nexport * from './copy-product-map.model';\nexport const CopyShopCategoryMapModel: ReturnModelType<typeof CopyShopCategoryMap> =\n\tgetModelForClass(CopyShopCategoryMap);\nexport * from './copy-shop-category-map.model';\nexport const CopyAttributeMapModel: ReturnModelType<typeof CopyAttributeMap> =\n\tgetModelForClass(CopyAttributeMap);\nexport * from './copy-attribute-map.model';\n\nexport const UserShopHistoryModel: ReturnModelType<typeof UserShopHistory> =\n\tgetModelForClass(UserShopHistory);\nexport * from './user-shop-history.model';\n"]}
|
|
@@ -2,6 +2,4 @@ import { CouponType } from '../../../../utilities/enum';
|
|
|
2
2
|
import { BaseCoupon } from '../base/base-coupon.model';
|
|
3
3
|
export declare class GlobalCoupon extends BaseCoupon {
|
|
4
4
|
couponType: CouponType.GLOBAL;
|
|
5
|
-
couponDurationInDaysEnabled?: boolean;
|
|
6
|
-
couponDurationInDays?: number | null;
|
|
7
5
|
}
|