tango-app-api-analysis-traffic 3.8.7-vms.15 → 3.8.7-vms.16
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/package.json
CHANGED
|
@@ -3129,29 +3129,30 @@ export const managerTrafficDensityExport = async ( req, res ) => {
|
|
|
3129
3129
|
}
|
|
3130
3130
|
};
|
|
3131
3131
|
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3132
|
+
|
|
3133
|
+
export const getStoreListv2 = async ( req, res ) => {
|
|
3134
|
+
try {
|
|
3135
|
+
let reqestData = req.body;
|
|
3136
|
+
let getClientData = await getClientConfig( reqestData.clientId );
|
|
3137
|
+
if ( !getClientData ) {
|
|
3138
|
+
return res.sendError( 'Invalid Client Id', 400 );
|
|
3139
|
+
}
|
|
3140
|
+
reqestData.featureConfigs = getClientData.featureConfigs;
|
|
3141
|
+
let LamdaURL = 'https://nmnnlq3ie65bljcvxauhxmsrpa0edhfa.lambda-url.ap-south-1.on.aws/';
|
|
3142
|
+
let resultData = await LamdaServiceCall( LamdaURL, reqestData );
|
|
3143
|
+
if ( resultData ) {
|
|
3144
|
+
if ( resultData.status_code == '200' ) {
|
|
3145
|
+
return res.sendSuccess( resultData );
|
|
3146
|
+
} else {
|
|
3147
|
+
return res.sendError( 'No Content', 204 );
|
|
3148
|
+
}
|
|
3149
|
+
} else {
|
|
3150
|
+
return res.sendError( 'No Content', 204 );
|
|
3151
|
+
}
|
|
3152
|
+
} catch ( error ) {
|
|
3153
|
+
const err = error.message || 'Internal Server Error';
|
|
3154
|
+
logger.error( { error: error, message: req.body, function: 'getStoreListv2' } );
|
|
3155
|
+
return res.sendError( err, 500 );
|
|
3156
|
+
}
|
|
3157
|
+
};
|
|
3158
|
+
|
|
@@ -239,6 +239,17 @@ export const validateCountryHeaderSchemav2 = joi.object( {
|
|
|
239
239
|
export const validateCountryHeaderParamsv2 = {
|
|
240
240
|
body: validateCountryHeaderSchemav2,
|
|
241
241
|
};
|
|
242
|
+
|
|
243
|
+
export const validateGetStoreListSchemav2 = joi.object( {
|
|
244
|
+
clientId: joi.string().required(),
|
|
245
|
+
storeId: joi.array().items( joi.string().required() ).required(),
|
|
246
|
+
downtime: joi.array().items( joi.string().required() ).required(),
|
|
247
|
+
fromDate: joi.string().required(),
|
|
248
|
+
toDate: joi.string().required(),
|
|
249
|
+
} );
|
|
250
|
+
export const validateGetStoreList = {
|
|
251
|
+
body: validateGetStoreListSchemav2,
|
|
252
|
+
};
|
|
242
253
|
export const getMyProductSchema = joi.object( {
|
|
243
254
|
clientId: joi.string().required(),
|
|
244
255
|
storeId: joi.array().optional().empty(),
|
|
@@ -92,6 +92,7 @@ import {
|
|
|
92
92
|
funnelV3,
|
|
93
93
|
getStoreMapDataV3,
|
|
94
94
|
managerTrafficDensityExport,
|
|
95
|
+
getStoreListv2,
|
|
95
96
|
} from '../controllers/tangoTrafficV3.controllers.js';
|
|
96
97
|
analysisTrafficRouter
|
|
97
98
|
.get( '/welcome', welcome )
|
|
@@ -175,5 +176,6 @@ analysisTrafficRouter
|
|
|
175
176
|
.post( '/headerCountry_v2', isAllowedSessionHandler, isAllowedClient, validate( validationDtos.validateCountryHeaderParamsv2 ), getAssinedStore, headerCountryV2 )
|
|
176
177
|
.post( '/checkTodayReportStatus', isAllowedSessionHandler, checkTodayReportStatus )
|
|
177
178
|
.post( '/headerZoneV2', isAllowedSessionHandler, headerZoneV2 )
|
|
178
|
-
.post( '/trafficDensityExport_v2', managerTrafficDensityExport )
|
|
179
|
+
.post( '/trafficDensityExport_v2', managerTrafficDensityExport )
|
|
180
|
+
.post( '/get-store-list-v2', isAllowedSessionHandler, isAllowedClient, validate( validationDtos.validateGetStoreList ), getStoreListv2 );
|
|
179
181
|
export default analysisTrafficRouter;
|