tango-app-api-trax 3.8.11-nike → 3.8.11
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 +2 -2
- package/src/controllers/download.controller.js +19 -19
- package/src/controllers/gallery.controller.js +0 -1
- package/src/controllers/handlebar-helper.js +0 -1
- package/src/controllers/internalTrax.controller.js +10 -10
- package/src/controllers/mobileTrax.controller.js +25 -0
- package/src/controllers/teaxFlag.controller.js +5 -5
- package/src/controllers/trax.controller.js +2 -2
- package/src/hbs/flag.hbs +248 -248
- package/src/hbs/login-otp.hbs +943 -943
- package/src/utils/visitChecklistPdf.utils.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tango-app-api-trax",
|
|
3
|
-
"version": "3.8.11
|
|
3
|
+
"version": "3.8.11",
|
|
4
4
|
"description": "Trax",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"nodemon": "^3.1.4",
|
|
30
30
|
"path": "^0.12.7",
|
|
31
31
|
"puppeteer": "^24.39.1",
|
|
32
|
-
"tango-api-schema": "^2.5.
|
|
32
|
+
"tango-api-schema": "^2.5.72",
|
|
33
33
|
"tango-app-api-middleware": "^3.5.2",
|
|
34
34
|
"url": "^0.11.4",
|
|
35
35
|
"winston": "^3.13.1",
|
|
@@ -53,31 +53,31 @@ async function getBrandInfo( clientId ) {
|
|
|
53
53
|
return brandInfo;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
async function streamChecklistZip( res, checklistList, brandInfo, zipBaseName ) {
|
|
57
|
+
const zipName = `${sanitizeFilenamePart( zipBaseName, 'visit-checklists' )}_${dayjs().format( 'YYYY-MM-DD_HH-mm' )}.zip`;
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
res.status( 200 );
|
|
60
|
+
res.setHeader( 'Content-Type', 'application/zip' );
|
|
61
|
+
res.setHeader( 'Content-Disposition', `attachment; filename="${zipName.replace( /"/g, '\\"' )}"` );
|
|
62
|
+
res.setHeader( 'Cache-Control', 'private, no-cache' );
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
const archive = archiver( 'zip', { zlib: { level: 9 } } );
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
archive.on( 'error', ( err ) => {
|
|
67
|
+
throw err;
|
|
68
|
+
} );
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
archive.pipe( res );
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
72
|
+
for ( const checklistDetails of checklistList ) {
|
|
73
|
+
const templateData = buildVisitChecklistTemplateData( checklistDetails, brandInfo );
|
|
74
|
+
const pdfBuffer = await generateVisitChecklistPDF( templateData );
|
|
75
|
+
const pdfName = `${sanitizeFilenamePart( checklistDetails.storeName || checklistDetails.store_id || checklistDetails._id, 'store' )}_${sanitizeFilenamePart( checklistDetails.checkListName || 'Visit Checklist' )}.pdf`;
|
|
76
|
+
archive.append( Buffer.isBuffer( pdfBuffer ) ? pdfBuffer : Buffer.from( pdfBuffer ), { name: pdfName } );
|
|
77
|
+
}
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
await archive.finalize();
|
|
80
|
+
}
|
|
81
81
|
|
|
82
82
|
async function createChecklistZipBuffer( checklistList, brandInfo ) {
|
|
83
83
|
const output = new PassThrough();
|
|
@@ -139,7 +139,6 @@ export async function getcustomerunattendedlist( req, res ) {
|
|
|
139
139
|
}
|
|
140
140
|
let url = JSON.parse( process.env.LAMBDAURL );
|
|
141
141
|
let resultData = await LamdaServiceCall( url.customerUnattended, req.body );
|
|
142
|
-
console.log( '🚀 ~ getcustomerunattendedlist ~ url.customerUnattended:', url.customerUnattended );
|
|
143
142
|
if ( resultData ) {
|
|
144
143
|
if ( resultData.status_code == '200' ) {
|
|
145
144
|
return res.sendSuccess( resultData );
|
|
@@ -323,7 +323,7 @@ export async function PCLconfigCreation( req, res ) {
|
|
|
323
323
|
},
|
|
324
324
|
} );
|
|
325
325
|
let getSections = await CLquestions.aggregate( sectionQuery );
|
|
326
|
-
if ( getSections.length || [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert', 'storehygienemonitoring'
|
|
326
|
+
if ( getSections.length || [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert', 'storehygienemonitoring' ].includes( getCLconfig.checkListType ) ) {
|
|
327
327
|
if ( getSections.length ) {
|
|
328
328
|
for ( let element3 of getSections ) {
|
|
329
329
|
let collectQuestions = {};
|
|
@@ -648,11 +648,11 @@ export async function PCLconfigCreation( req, res ) {
|
|
|
648
648
|
// }
|
|
649
649
|
}
|
|
650
650
|
} else {
|
|
651
|
-
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert'
|
|
651
|
+
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert' ].includes( getCLconfig.checkListType ) ) {
|
|
652
652
|
let storeNameList = allQuestion.map( ( item ) => item.store_id );
|
|
653
|
-
let storeDetails = await storeService.find( { clientId: getCLconfig.client_id, status: 'active', ...( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert'
|
|
653
|
+
let storeDetails = await storeService.find( { clientId: getCLconfig.client_id, status: 'active', ...( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert' ].includes( getCLconfig.checkListType ) ) ? { storeId: { $in: storeNameList } } : {} }, { storeId: 1 } );
|
|
654
654
|
let storeList = storeDetails.map( ( store ) => store.storeId );
|
|
655
|
-
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert'
|
|
655
|
+
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert' ].includes( getCLconfig.checkListType ) ) {
|
|
656
656
|
allQuestion = allQuestion.filter( ( ele ) => storeList.includes( ele?.store_id ) );
|
|
657
657
|
} else {
|
|
658
658
|
allQuestion = storeDetails.map( ( item ) => {
|
|
@@ -686,7 +686,7 @@ export async function PCLconfigCreation( req, res ) {
|
|
|
686
686
|
client_id: getCLconfig.client_id,
|
|
687
687
|
aiStoreList: allQuestion.length ? allQuestion.map( ( store ) => store.store_id ) : [],
|
|
688
688
|
};
|
|
689
|
-
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert'
|
|
689
|
+
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert' ].includes( getCLconfig.checkListType ) ) {
|
|
690
690
|
let processData = {
|
|
691
691
|
aiStoreList: allQuestion.length ? allQuestion.map( ( store ) => {
|
|
692
692
|
return { storeName: store.storeName, storeId: store.store_id, events: store.events };
|
|
@@ -927,7 +927,7 @@ async function insertData( requestData ) {
|
|
|
927
927
|
},
|
|
928
928
|
} );
|
|
929
929
|
let getSections = await CLquestions.aggregate( sectionQuery );
|
|
930
|
-
if ( getSections.length || [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert'
|
|
930
|
+
if ( getSections.length || [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert' ].includes( getCLconfig.checkListType ) ) {
|
|
931
931
|
if ( getSections.length ) {
|
|
932
932
|
for ( let element3 of getSections ) {
|
|
933
933
|
let collectQuestions = {};
|
|
@@ -1222,11 +1222,11 @@ async function insertData( requestData ) {
|
|
|
1222
1222
|
// }
|
|
1223
1223
|
}
|
|
1224
1224
|
} else {
|
|
1225
|
-
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert'
|
|
1225
|
+
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert' ].includes( getCLconfig.checkListType ) ) {
|
|
1226
1226
|
let storeNameList = allQuestion.map( ( item ) => item.store_id );
|
|
1227
|
-
let storeDetails = await storeService.find( { clientId: getCLconfig.client_id, status: 'active', ...( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert'
|
|
1227
|
+
let storeDetails = await storeService.find( { clientId: getCLconfig.client_id, status: 'active', ...( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert' ].includes( getCLconfig.checkListType ) ) ? { storeId: { $in: storeNameList } } : {} }, { storeId: 1 } );
|
|
1228
1228
|
let storeList = storeDetails.map( ( store ) => store.storeId );
|
|
1229
|
-
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert'
|
|
1229
|
+
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert' ].includes( getCLconfig.checkListType ) ) {
|
|
1230
1230
|
allQuestion = allQuestion.filter( ( ele ) => storeList.includes( ele?.store_id ) );
|
|
1231
1231
|
} else {
|
|
1232
1232
|
allQuestion = storeDetails.map( ( item ) => {
|
|
@@ -1260,7 +1260,7 @@ async function insertData( requestData ) {
|
|
|
1260
1260
|
client_id: getCLconfig.client_id,
|
|
1261
1261
|
aiStoreList: allQuestion.length ? allQuestion.map( ( store ) => store.store_id ) : [],
|
|
1262
1262
|
};
|
|
1263
|
-
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert'
|
|
1263
|
+
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert' ].includes( getCLconfig.checkListType ) ) {
|
|
1264
1264
|
let processData = {
|
|
1265
1265
|
aiStoreList: allQuestion.length ? allQuestion.map( ( store ) => {
|
|
1266
1266
|
return { storeName: store.storeName, storeId: store.store_id, events: store.events };
|
|
@@ -1250,6 +1250,21 @@ export async function sopMobilechecklistMultiSectionFormatterv1( req, res, next
|
|
|
1250
1250
|
}
|
|
1251
1251
|
}
|
|
1252
1252
|
} else {
|
|
1253
|
+
if ( qaans[k].validationType == 'Capture Multiple Image with description' ) {
|
|
1254
|
+
qaans[k]['validationImage']=[];
|
|
1255
|
+
if ( requestSection[i].validationImage.length ) {
|
|
1256
|
+
for ( let image of requestSection[i].validationImage ) {
|
|
1257
|
+
let validationAnswer = decodeURIComponent( image.split( '?' )[0] );
|
|
1258
|
+
if ( validationAnswer.length ) {
|
|
1259
|
+
let splitImgUrl = validationAnswer.split( '/' );
|
|
1260
|
+
if ( splitImgUrl.length > 1 ) {
|
|
1261
|
+
splitImgUrl.splice( 0, 3 );
|
|
1262
|
+
qaans[k].validationImage.push( splitImgUrl.join( '/' ) || '' );
|
|
1263
|
+
}
|
|
1264
|
+
};
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1253
1268
|
// qaans[k].descriptivetype = qaAnswers[j].descriptivetype || '';
|
|
1254
1269
|
qaans[k].validationAnswer = requestSection[i].validationAnswer || '';
|
|
1255
1270
|
}
|
|
@@ -2325,6 +2340,9 @@ export async function submitTask( req, res ) {
|
|
|
2325
2340
|
insertOpenSearchData( openSearch.traxActivityLog, inserttraxlogs );
|
|
2326
2341
|
if ( submittype === 'submit' ) {
|
|
2327
2342
|
const excludedChecklists = [ 'Store Hygiene Check' ];
|
|
2343
|
+
if ( checklist.checkListName.includes( 'Store Hygiene' ) ) {
|
|
2344
|
+
|
|
2345
|
+
}
|
|
2328
2346
|
if ( !excludedChecklists.includes( checklist.checkListName ) ) {
|
|
2329
2347
|
const query1 = [
|
|
2330
2348
|
{
|
|
@@ -3523,6 +3541,13 @@ export async function questionList( req, res ) {
|
|
|
3523
3541
|
if ( ( userAns.validationType == 'Capture Image' || userAns.validationType == 'Capture Video' ) && userAns.validationAnswer && userAns.validationAnswer != '' ) {
|
|
3524
3542
|
getchecklist[0].questionAnswers[secIndex].questions[questionIndex].userAnswer[userAnsIndex].validationAnswer = await signedUrl( { file_path: decodeURIComponent( userAns.validationAnswer ), Bucket: bucket.sop } );
|
|
3525
3543
|
}
|
|
3544
|
+
if ( userAns.validationType == 'Capture Multiple Image with description' ) {
|
|
3545
|
+
let imageAnswers = userAns.validationImage;
|
|
3546
|
+
userAns.validationImage = [];
|
|
3547
|
+
for ( let image of imageAnswers ) {
|
|
3548
|
+
getchecklist[0].questionAnswers[secIndex].questions[questionIndex].userAnswer[userAnsIndex].validationImage.push( await signedUrl( { file_path: decodeURIComponent( image ), Bucket: bucket.sop } ) );
|
|
3549
|
+
}
|
|
3550
|
+
}
|
|
3526
3551
|
if ( [ 'image', 'descriptiveImage', 'video' ].includes( question.answerType ) && userAns.answer != '' ) {
|
|
3527
3552
|
getchecklist[0].questionAnswers[secIndex].questions[questionIndex].userAnswer[userAnsIndex].answer = await signedUrl( { file_path: decodeURIComponent( userAns.answer ), Bucket: bucket.sop } );
|
|
3528
3553
|
}
|
|
@@ -608,7 +608,7 @@ export const flagCardsV1 = async ( req, res ) => {
|
|
|
608
608
|
{
|
|
609
609
|
client_id: clientId,
|
|
610
610
|
publish: true,
|
|
611
|
-
checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert'
|
|
611
|
+
checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert' ] },
|
|
612
612
|
},
|
|
613
613
|
{ checkListType: 1 },
|
|
614
614
|
);
|
|
@@ -2743,7 +2743,7 @@ export const checklistDropdownV1 = async ( req, res ) => {
|
|
|
2743
2743
|
$or: [
|
|
2744
2744
|
{ questionFlag: { $gte: 1 } },
|
|
2745
2745
|
{ timeFlag: { $gte: 1 } },
|
|
2746
|
-
{ checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert'
|
|
2746
|
+
{ checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert' ] } },
|
|
2747
2747
|
{
|
|
2748
2748
|
runAIQuestionCount: { $gte: 1 },
|
|
2749
2749
|
},
|
|
@@ -2945,7 +2945,7 @@ export const flagComparisonCardsV2 = async ( req, res ) => {
|
|
|
2945
2945
|
{
|
|
2946
2946
|
client_id: requestData.clientId,
|
|
2947
2947
|
publish: true,
|
|
2948
|
-
checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert'
|
|
2948
|
+
checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert' ] },
|
|
2949
2949
|
},
|
|
2950
2950
|
{ checkListType: 1 },
|
|
2951
2951
|
);
|
|
@@ -3047,7 +3047,7 @@ export const flagTablesV2 = async ( req, res ) => {
|
|
|
3047
3047
|
}
|
|
3048
3048
|
|
|
3049
3049
|
if ( requestData?.filter === 'all' ) {
|
|
3050
|
-
findAndQuery.push( { $or: [ { checkListType: { $in: [ 'custom', 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert'
|
|
3050
|
+
findAndQuery.push( { $or: [ { checkListType: { $in: [ 'custom', 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert' ] } } ] } );
|
|
3051
3051
|
} else if ( requestData?.filter === 'question' ) {
|
|
3052
3052
|
findAndQuery.push( { checkListType: 'custom' } );
|
|
3053
3053
|
findAndQuery.push( { questionFlag: { $gte: 1 } } );
|
|
@@ -3055,7 +3055,7 @@ export const flagTablesV2 = async ( req, res ) => {
|
|
|
3055
3055
|
findAndQuery.push( { checkListType: 'custom' } );
|
|
3056
3056
|
findAndQuery.push( { timeFlag: { $gte: 1 } } );
|
|
3057
3057
|
} else if ( requestData?.filter === 'detection' ) {
|
|
3058
|
-
findAndQuery.push( { checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert'
|
|
3058
|
+
findAndQuery.push( { checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert' ] } } );
|
|
3059
3059
|
} else if ( requestData?.filter === 'runAI' ) {
|
|
3060
3060
|
if ( req.body.runAIChecklistName ) {
|
|
3061
3061
|
findAndQuery.push( { checkListName: { $in: req.body.runAIChecklistName } } );
|
|
@@ -4116,7 +4116,7 @@ async function updateOpenSearch( user, data ) {
|
|
|
4116
4116
|
export const aiChecklist = async ( req, res ) => {
|
|
4117
4117
|
try {
|
|
4118
4118
|
let storeDetails = await storeService.count( { clientId: req.query.clientId, status: 'active' } );
|
|
4119
|
-
let aiList = [ 'mobileusagedetection', 'storeopenandclose', 'uniformdetection', 'staffleftinthemiddle', 'customerunattended', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert'
|
|
4119
|
+
let aiList = [ 'mobileusagedetection', 'storeopenandclose', 'uniformdetection', 'staffleftinthemiddle', 'customerunattended', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert' ];
|
|
4120
4120
|
let checklistDetails = [];
|
|
4121
4121
|
let publishList = [];
|
|
4122
4122
|
let unpublishList = [];
|
|
@@ -4129,7 +4129,7 @@ export const aiChecklist = async ( req, res ) => {
|
|
|
4129
4129
|
checklistDetails = [ ...publishList, ...unpublishList ];
|
|
4130
4130
|
|
|
4131
4131
|
checklistDetails.forEach( ( item ) => {
|
|
4132
|
-
if ( ![ 'mobileusagedetection', 'storeopenandclose', 'cleaning', 'scrum', 'uniformdetection', 'staffleftinthemiddle', 'customerunattended', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert'
|
|
4132
|
+
if ( ![ 'mobileusagedetection', 'storeopenandclose', 'cleaning', 'scrum', 'uniformdetection', 'staffleftinthemiddle', 'customerunattended', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance', 'cameratampering', 'queuealert' ].includes( item.checkListType ) ) {
|
|
4133
4133
|
item.storeCount = storeDetails;
|
|
4134
4134
|
}
|
|
4135
4135
|
} );
|