tango-app-api-analysis-zone 3.0.0-alpha.41 → 3.0.0-alpha.43
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
|
@@ -197,24 +197,24 @@ export const zoneHeatmapAvailableDatesV1 = async ( req, res ) => {
|
|
|
197
197
|
try {
|
|
198
198
|
let reqestData = req.body;
|
|
199
199
|
|
|
200
|
-
const date1 = new Date( reqestData.fromDate );
|
|
201
|
-
const date2 = new Date( reqestData.toDate );
|
|
202
|
-
// Get the difference in milliseconds
|
|
203
|
-
const diffInMs = date2 - date1;
|
|
204
|
-
// Convert milliseconds to days
|
|
205
|
-
let diffInDays = parseInt( diffInMs / ( 1000 * 60 * 60 * 24 ) );
|
|
206
|
-
if ( diffInDays <= 7 ) {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
}
|
|
200
|
+
// const date1 = new Date( reqestData.fromDate );
|
|
201
|
+
// const date2 = new Date( reqestData.toDate );
|
|
202
|
+
// // Get the difference in milliseconds
|
|
203
|
+
// const diffInMs = date2 - date1;
|
|
204
|
+
// // Convert milliseconds to days
|
|
205
|
+
// let diffInDays = parseInt( diffInMs / ( 1000 * 60 * 60 * 24 ) );
|
|
206
|
+
// if ( diffInDays <= 7 ) {
|
|
207
|
+
// if ( reqestData.dateType == 'weekly' ) {
|
|
208
|
+
// // subtract 7 days to the date
|
|
209
|
+
// date2.setDate( date2.getDate() - 7 );
|
|
210
|
+
// reqestData.fromDate = date2.toISOString().slice( 0, 10 );
|
|
211
|
+
// }
|
|
212
|
+
// if ( reqestData.dateType == 'monthly' ) {
|
|
213
|
+
// // subtract 31 days to the date
|
|
214
|
+
// date2.setDate( date2.getDate() - 31 );
|
|
215
|
+
// reqestData.fromDate = date2.toISOString().slice( 0, 10 );
|
|
216
|
+
// }
|
|
217
|
+
// }
|
|
218
218
|
|
|
219
219
|
let LamdaURL = 'https://tgtkai5zzq7fhp7ymtsnm3a2lm0czulr.lambda-url.ap-south-1.on.aws/';
|
|
220
220
|
let resultData = await LamdaServiceCall( LamdaURL, reqestData );
|
|
@@ -256,6 +256,7 @@ export const zoneHeatmapDatasV1 = async ( req, res ) => {
|
|
|
256
256
|
export const zoneSegmentationV1 = async ( req, res ) => {
|
|
257
257
|
try {
|
|
258
258
|
let reqestData = req.body;
|
|
259
|
+
let clientId = reqestData.clientId;
|
|
259
260
|
let LamdaURL = 'https://7ijmuxyqsv7rdz6pkz6fhk6ka40cipbh.lambda-url.ap-south-1.on.aws/';
|
|
260
261
|
let resultData = await LamdaServiceCall( LamdaURL, reqestData );
|
|
261
262
|
if ( resultData ) {
|
|
@@ -264,10 +265,14 @@ export const zoneSegmentationV1 = async ( req, res ) => {
|
|
|
264
265
|
if ( resultData.segmentationAnalysis.length>0 ) {
|
|
265
266
|
const exportdata = [];
|
|
266
267
|
resultData.segmentationAnalysis.forEach( ( element ) => {
|
|
267
|
-
|
|
268
|
+
const exportItem = {
|
|
268
269
|
'Entrance': element.category,
|
|
269
270
|
'Entrance wise footfall': element.value,
|
|
270
|
-
}
|
|
271
|
+
};
|
|
272
|
+
if ( clientId === '463' ) {
|
|
273
|
+
exportItem['Concentration Rate'] = element?.concentrationRate ? element?.concentrationRate + '%' : '--';
|
|
274
|
+
}
|
|
275
|
+
exportdata.push( exportItem );
|
|
271
276
|
} );
|
|
272
277
|
return await download( exportdata, res );
|
|
273
278
|
} else {
|
|
@@ -182,24 +182,24 @@ export const overallStoreConcentrationDatesV2 = async ( req, res ) => {
|
|
|
182
182
|
try {
|
|
183
183
|
let reqestData = req.body;
|
|
184
184
|
|
|
185
|
-
const date1 = new Date( reqestData.fromDate );
|
|
186
|
-
const date2 = new Date( reqestData.toDate );
|
|
185
|
+
// const date1 = new Date( reqestData.fromDate );
|
|
186
|
+
// const date2 = new Date( reqestData.toDate );
|
|
187
187
|
// Get the difference in milliseconds
|
|
188
|
-
const diffInMs = date2 - date1;
|
|
188
|
+
// const diffInMs = date2 - date1;
|
|
189
189
|
// Convert milliseconds to days
|
|
190
|
-
let diffInDays = parseInt( diffInMs / ( 1000 * 60 * 60 * 24 ) );
|
|
191
|
-
if ( diffInDays <= 7 ) {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
}
|
|
190
|
+
// let diffInDays = parseInt( diffInMs / ( 1000 * 60 * 60 * 24 ) );
|
|
191
|
+
// if ( diffInDays <= 7 ) {
|
|
192
|
+
// if ( reqestData.dateType == 'weekly' ) {
|
|
193
|
+
// // subtract 7 days to the date
|
|
194
|
+
// date2.setDate( date2.getDate() - 7 );
|
|
195
|
+
// reqestData.fromDate = date2.toISOString().slice( 0, 10 );
|
|
196
|
+
// }
|
|
197
|
+
// if ( reqestData.dateType == 'monthly' ) {
|
|
198
|
+
// // subtract 31 days to the date
|
|
199
|
+
// date2.setDate( date2.getDate() - 31 );
|
|
200
|
+
// reqestData.fromDate = date2.toISOString().slice( 0, 10 );
|
|
201
|
+
// }
|
|
202
|
+
// }
|
|
203
203
|
|
|
204
204
|
let LamdaURL = 'https://nmjcclomhgdecmoyned3sp6y6q0pemhg.lambda-url.ap-south-1.on.aws/';
|
|
205
205
|
let resultData = await LamdaServiceCall( LamdaURL, reqestData );
|