tango-app-api-trax 3.7.34 → 3.7.35
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
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tango-app-api-trax",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.35",
|
|
4
4
|
"description": "Trax",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"start": "nodemon --exec \"eslint --fix . && node
|
|
8
|
+
"start": "nodemon --exec \"eslint --fix . && node app.js\""
|
|
9
9
|
},
|
|
10
10
|
"engines": {
|
|
11
11
|
"node": ">=18.10.0"
|
|
@@ -305,7 +305,7 @@ export async function PCLconfigCreation( req, res ) {
|
|
|
305
305
|
},
|
|
306
306
|
} );
|
|
307
307
|
let getSections = await CLquestions.aggregate( sectionQuery );
|
|
308
|
-
if ( getSections.length || [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter' ].includes( getCLconfig.checkListType ) ) {
|
|
308
|
+
if ( getSections.length || [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( getCLconfig.checkListType ) ) {
|
|
309
309
|
if ( getSections.length ) {
|
|
310
310
|
for ( let element3 of getSections ) {
|
|
311
311
|
let collectQuestions = {};
|
|
@@ -628,11 +628,11 @@ export async function PCLconfigCreation( req, res ) {
|
|
|
628
628
|
// }
|
|
629
629
|
}
|
|
630
630
|
} else {
|
|
631
|
-
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter' ].includes( getCLconfig.checkListType ) ) {
|
|
631
|
+
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( getCLconfig.checkListType ) ) {
|
|
632
632
|
let storeNameList = allQuestion.map( ( item ) => item.store_id );
|
|
633
|
-
let storeDetails = await storeService.find( { clientId: getCLconfig.client_id, status: 'active', ...( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter' ].includes( getCLconfig.checkListType ) ) ? { storeId: { $in: storeNameList } } : {} }, { storeId: 1 } );
|
|
633
|
+
let storeDetails = await storeService.find( { clientId: getCLconfig.client_id, status: 'active', ...( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( getCLconfig.checkListType ) ) ? { storeId: { $in: storeNameList } } : {} }, { storeId: 1 } );
|
|
634
634
|
let storeList = storeDetails.map( ( store ) => store.storeId );
|
|
635
|
-
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter' ].includes( getCLconfig.checkListType ) ) {
|
|
635
|
+
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( getCLconfig.checkListType ) ) {
|
|
636
636
|
allQuestion = allQuestion.filter( ( ele ) => storeList.includes( ele?.store_id ) );
|
|
637
637
|
} else {
|
|
638
638
|
allQuestion = storeDetails.map( ( item ) => {
|
|
@@ -666,7 +666,7 @@ export async function PCLconfigCreation( req, res ) {
|
|
|
666
666
|
client_id: getCLconfig.client_id,
|
|
667
667
|
aiStoreList: allQuestion.length ? allQuestion.map( ( store ) => store.store_id ) : [],
|
|
668
668
|
};
|
|
669
|
-
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter' ].includes( getCLconfig.checkListType ) ) {
|
|
669
|
+
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( getCLconfig.checkListType ) ) {
|
|
670
670
|
let processData = {
|
|
671
671
|
aiStoreList: allQuestion.length ? allQuestion.map( ( store ) => {
|
|
672
672
|
return { storeName: store.storeName, storeId: store.store_id, events: store.events };
|
|
@@ -907,7 +907,7 @@ async function insertData( requestData ) {
|
|
|
907
907
|
},
|
|
908
908
|
} );
|
|
909
909
|
let getSections = await CLquestions.aggregate( sectionQuery );
|
|
910
|
-
if ( getSections.length || [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter' ].includes( getCLconfig.checkListType ) ) {
|
|
910
|
+
if ( getSections.length || [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( getCLconfig.checkListType ) ) {
|
|
911
911
|
if ( getSections.length ) {
|
|
912
912
|
for ( let element3 of getSections ) {
|
|
913
913
|
let collectQuestions = {};
|
|
@@ -1202,11 +1202,11 @@ async function insertData( requestData ) {
|
|
|
1202
1202
|
// }
|
|
1203
1203
|
}
|
|
1204
1204
|
} else {
|
|
1205
|
-
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter' ].includes( getCLconfig.checkListType ) ) {
|
|
1205
|
+
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( getCLconfig.checkListType ) ) {
|
|
1206
1206
|
let storeNameList = allQuestion.map( ( item ) => item.store_id );
|
|
1207
|
-
let storeDetails = await storeService.find( { clientId: getCLconfig.client_id, status: 'active', ...( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter' ].includes( getCLconfig.checkListType ) ) ? { storeId: { $in: storeNameList } } : {} }, { storeId: 1 } );
|
|
1207
|
+
let storeDetails = await storeService.find( { clientId: getCLconfig.client_id, status: 'active', ...( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( getCLconfig.checkListType ) ) ? { storeId: { $in: storeNameList } } : {} }, { storeId: 1 } );
|
|
1208
1208
|
let storeList = storeDetails.map( ( store ) => store.storeId );
|
|
1209
|
-
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter' ].includes( getCLconfig.checkListType ) ) {
|
|
1209
|
+
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( getCLconfig.checkListType ) ) {
|
|
1210
1210
|
allQuestion = allQuestion.filter( ( ele ) => storeList.includes( ele?.store_id ) );
|
|
1211
1211
|
} else {
|
|
1212
1212
|
allQuestion = storeDetails.map( ( item ) => {
|
|
@@ -1240,7 +1240,7 @@ async function insertData( requestData ) {
|
|
|
1240
1240
|
client_id: getCLconfig.client_id,
|
|
1241
1241
|
aiStoreList: allQuestion.length ? allQuestion.map( ( store ) => store.store_id ) : [],
|
|
1242
1242
|
};
|
|
1243
|
-
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter' ].includes( getCLconfig.checkListType ) ) {
|
|
1243
|
+
if ( [ 'storeopenandclose', 'mobileusagedetection', 'uniformdetection', 'customerunattended', 'staffleftinthemiddle', 'scrum', 'cleaning', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( getCLconfig.checkListType ) ) {
|
|
1244
1244
|
let processData = {
|
|
1245
1245
|
aiStoreList: allQuestion.length ? allQuestion.map( ( store ) => {
|
|
1246
1246
|
return { storeName: store.storeName, storeId: store.store_id, events: store.events };
|
|
@@ -606,7 +606,7 @@ export const flagCardsV1 = async ( req, res ) => {
|
|
|
606
606
|
{
|
|
607
607
|
client_id: clientId,
|
|
608
608
|
publish: true,
|
|
609
|
-
checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter' ] },
|
|
609
|
+
checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ] },
|
|
610
610
|
},
|
|
611
611
|
{ checkListType: 1 },
|
|
612
612
|
);
|
|
@@ -2738,7 +2738,7 @@ export const checklistDropdownV1 = async ( req, res ) => {
|
|
|
2738
2738
|
$or: [
|
|
2739
2739
|
{ questionFlag: { $gte: 1 } },
|
|
2740
2740
|
{ timeFlag: { $gte: 1 } },
|
|
2741
|
-
{ checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter' ] } },
|
|
2741
|
+
{ checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ] } },
|
|
2742
2742
|
{
|
|
2743
2743
|
runAIQuestionCount: { $gte: 1 },
|
|
2744
2744
|
},
|
|
@@ -2940,7 +2940,7 @@ export const flagComparisonCardsV2 = async ( req, res ) => {
|
|
|
2940
2940
|
{
|
|
2941
2941
|
client_id: requestData.clientId,
|
|
2942
2942
|
publish: true,
|
|
2943
|
-
checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter' ] },
|
|
2943
|
+
checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ] },
|
|
2944
2944
|
},
|
|
2945
2945
|
{ checkListType: 1 },
|
|
2946
2946
|
);
|
|
@@ -3042,7 +3042,7 @@ export const flagTablesV2 = async ( req, res ) => {
|
|
|
3042
3042
|
}
|
|
3043
3043
|
|
|
3044
3044
|
if ( requestData?.filter === 'all' ) {
|
|
3045
|
-
findAndQuery.push( { $or: [ { checkListType: { $in: [ 'custom', 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter' ] } } ] } );
|
|
3045
|
+
findAndQuery.push( { $or: [ { checkListType: { $in: [ 'custom', 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ] } } ] } );
|
|
3046
3046
|
} else if ( requestData?.filter === 'question' ) {
|
|
3047
3047
|
findAndQuery.push( { checkListType: 'custom' } );
|
|
3048
3048
|
findAndQuery.push( { questionFlag: { $gte: 1 } } );
|
|
@@ -3050,7 +3050,7 @@ export const flagTablesV2 = async ( req, res ) => {
|
|
|
3050
3050
|
findAndQuery.push( { checkListType: 'custom' } );
|
|
3051
3051
|
findAndQuery.push( { timeFlag: { $gte: 1 } } );
|
|
3052
3052
|
} else if ( requestData?.filter === 'detection' ) {
|
|
3053
|
-
findAndQuery.push( { checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter' ] } } );
|
|
3053
|
+
findAndQuery.push( { checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ] } } );
|
|
3054
3054
|
} else if ( requestData?.filter === 'runAI' ) {
|
|
3055
3055
|
if ( req.body.runAIChecklistName ) {
|
|
3056
3056
|
findAndQuery.push( { checkListName: { $in: req.body.runAIChecklistName } } );
|
|
@@ -596,6 +596,7 @@ export const zoneList = async ( req, res ) => {
|
|
|
596
596
|
'Outside Business Hours Queue Tracking',
|
|
597
597
|
'Store Half Shutter Detection',
|
|
598
598
|
'Mobile usage detection',
|
|
599
|
+
'Store TV Compliance',
|
|
599
600
|
];
|
|
600
601
|
|
|
601
602
|
if ( inputBody.checkListName && allowedChecklists.includes( inputBody.checkListName ) ) {
|
|
@@ -4049,7 +4050,7 @@ async function updateOpenSearch( user, data ) {
|
|
|
4049
4050
|
export const aiChecklist = async ( req, res ) => {
|
|
4050
4051
|
try {
|
|
4051
4052
|
let storeDetails = await storeService.count( { clientId: req.query.clientId, status: 'active' } );
|
|
4052
|
-
let aiList = [ 'mobileusagedetection', 'storeopenandclose', 'uniformdetection', 'staffleftinthemiddle', 'customerunattended', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter' ];
|
|
4053
|
+
let aiList = [ 'mobileusagedetection', 'storeopenandclose', 'uniformdetection', 'staffleftinthemiddle', 'customerunattended', 'eyetest', 'remoteoptometrist', 'storehygienemonitoring', 'queuealert', 'cleaning', 'scrum', 'suspiciousactivity', 'boxalert', 'suspiciousfootfall', 'drinking', 'bagdetection', 'inventorycount', 'carsattended', 'numberplateinfo', 'vehicle_check_in', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ];
|
|
4053
4054
|
let checklistDetails = [];
|
|
4054
4055
|
let publishList = [];
|
|
4055
4056
|
let unpublishList = [];
|
|
@@ -4062,7 +4063,7 @@ export const aiChecklist = async ( req, res ) => {
|
|
|
4062
4063
|
checklistDetails = [ ...publishList, ...unpublishList ];
|
|
4063
4064
|
|
|
4064
4065
|
checklistDetails.forEach( ( item ) => {
|
|
4065
|
-
if ( ![ 'mobileusagedetection', 'storeopenandclose', 'cleaning', 'scrum', 'uniformdetection', 'staffleftinthemiddle', 'customerunattended', 'outsidebusinesshoursqueuetracking', 'halfshutter' ].includes( item.checkListType ) ) {
|
|
4066
|
+
if ( ![ 'mobileusagedetection', 'storeopenandclose', 'cleaning', 'scrum', 'uniformdetection', 'staffleftinthemiddle', 'customerunattended', 'outsidebusinesshoursqueuetracking', 'halfshutter', 'tvcompliance' ].includes( item.checkListType ) ) {
|
|
4066
4067
|
item.storeCount = storeDetails;
|
|
4067
4068
|
}
|
|
4068
4069
|
} );
|