tango-app-api-trax 3.7.2-multireff-13 → 3.7.2-multireff-15
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tango-app-api-trax",
|
|
3
|
-
"version": "3.7.2-multireff-
|
|
3
|
+
"version": "3.7.2-multireff-15",
|
|
4
4
|
"description": "Trax",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"mongodb": "^6.8.0",
|
|
28
28
|
"nodemon": "^3.1.4",
|
|
29
29
|
"path": "^0.12.7",
|
|
30
|
-
"tango-api-schema": "^2.
|
|
30
|
+
"tango-api-schema": "^2.3.19",
|
|
31
31
|
"tango-app-api-middleware": "^3.1.77",
|
|
32
32
|
"url": "^0.11.4",
|
|
33
33
|
"winston": "^3.13.1",
|
|
@@ -2928,7 +2928,7 @@ export async function checklistv1( req, res ) {
|
|
|
2928
2928
|
|
|
2929
2929
|
const [ checklistResult, taskResult ] = await Promise.allSettled( [
|
|
2930
2930
|
processedchecklist.aggregate( buildPipeline( [ { checkListType: 'custom' } ], { isPlano: 1, planoId: 1, planoType: 1, floorId: 1 } ) ),
|
|
2931
|
-
processedTask.aggregate( taskBuildPipeline( [], { isPlano: 1, planoId: 1, planoType: 1, floorId: 1 } ) ),
|
|
2931
|
+
processedTask.aggregate( taskBuildPipeline( [], { isPlano: 1, planoId: 1, planoType: 1, floorId: 1, refTaskId: 1 } ) ),
|
|
2932
2932
|
] );
|
|
2933
2933
|
|
|
2934
2934
|
const checklistData = checklistResult.status === 'fulfilled' ? checklistResult.value : [];
|
|
@@ -3006,7 +3006,9 @@ export const flagTablesV2 = async ( req, res ) => {
|
|
|
3006
3006
|
} else if ( requestData?.filter === 'detection' ) {
|
|
3007
3007
|
findAndQuery.push( { checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum' ] } } );
|
|
3008
3008
|
} else if ( requestData?.filter === 'runAI' ) {
|
|
3009
|
-
|
|
3009
|
+
if ( req.body.runAIChecklistName ) {
|
|
3010
|
+
findAndQuery.push( { checkListName: { $in: req.body.runAIChecklistName } } );
|
|
3011
|
+
}
|
|
3010
3012
|
}
|
|
3011
3013
|
|
|
3012
3014
|
findQuery.push( { $match: { $and: findAndQuery } } );
|
|
@@ -3186,7 +3188,7 @@ export const flagTablesV2 = async ( req, res ) => {
|
|
|
3186
3188
|
getChecklistPerformanceData[index].flaggedStores = getChecklistPerformanceData[index].flaggedStores + findCheckList.flagCount;
|
|
3187
3189
|
} else {
|
|
3188
3190
|
getChecklistPerformanceData[index].flagCount = findCheckList.flagCount;
|
|
3189
|
-
getChecklistPerformanceData[index].flaggedStores = findCheckList.
|
|
3191
|
+
getChecklistPerformanceData[index].flaggedStores = findCheckList.flagStoreCount;
|
|
3190
3192
|
}
|
|
3191
3193
|
} else {
|
|
3192
3194
|
if ( requestData?.filter == 'all' ) {
|
|
@@ -3222,22 +3224,28 @@ export const flagTablesV2 = async ( req, res ) => {
|
|
|
3222
3224
|
const data = {
|
|
3223
3225
|
'Checklist Name': element.checkListName,
|
|
3224
3226
|
'Coverage': element?.coverage,
|
|
3227
|
+
'No of Questions': element?.runAIQuestionCount,
|
|
3225
3228
|
'Assigned Stores': element?.checkListType === 'custom' ? element?.assignedStores : element?.assignedStoresAi,
|
|
3226
3229
|
'Flagged Stores': element?.flaggedStores,
|
|
3227
3230
|
'Question Flags': element?.customQuestionFlagCount,
|
|
3228
3231
|
...( element.runAIFlag ? { 'Run AI Flag': element.runAIFlag } : {} ),
|
|
3229
3232
|
'Not Submitted Flags': element?.customTimeFlagCount,
|
|
3230
3233
|
'Detection Flags': element?.flagCount,
|
|
3234
|
+
'Flags': element?.flagCount,
|
|
3231
3235
|
'Compliance': element?.complianceRate,
|
|
3232
3236
|
// 'Flag Type': element?.checkListType === 'custom' ? 'Question' : 'Detection',
|
|
3233
3237
|
};
|
|
3234
|
-
if ( requestData?.filter === '
|
|
3238
|
+
if ( requestData?.filter === 'all' ) {
|
|
3239
|
+
delete data['No of Questions'];
|
|
3240
|
+
delete data['Flags'];
|
|
3241
|
+
} else if ( requestData?.filter === 'question' ) {
|
|
3235
3242
|
data['Flags'] = data['Question Flags'];
|
|
3236
3243
|
delete data['Question Flags'];
|
|
3237
3244
|
delete data['Flagged Count'];
|
|
3238
3245
|
delete data['Not Submitted Flags'];
|
|
3239
3246
|
delete data['Detection Flags'];
|
|
3240
3247
|
delete data['Run AI Flag'];
|
|
3248
|
+
delete data['No of Questions'];
|
|
3241
3249
|
} else if ( requestData?.filter === 'time' ) {
|
|
3242
3250
|
data['Flags'] = data['Not Submitted Flags'];
|
|
3243
3251
|
delete data['Question Flags'];
|
|
@@ -3245,7 +3253,16 @@ export const flagTablesV2 = async ( req, res ) => {
|
|
|
3245
3253
|
delete data['Not Submitted Flags'];
|
|
3246
3254
|
delete data['Detection Flags'];
|
|
3247
3255
|
delete data['Run AI Flag'];
|
|
3256
|
+
delete data['No of Questions'];
|
|
3248
3257
|
} else if ( requestData?.filter === 'detection' ) {
|
|
3258
|
+
data['Flags'] = data['Detection Flags'];
|
|
3259
|
+
delete data['Question Flags'];
|
|
3260
|
+
delete data['Flagged Count'];
|
|
3261
|
+
delete data['Not Submitted Flags'];
|
|
3262
|
+
delete data['Run AI Flag'];
|
|
3263
|
+
delete data['Flags'];
|
|
3264
|
+
delete data['No of Questions'];
|
|
3265
|
+
} else if ( requestData?.filter === 'runAI' ) {
|
|
3249
3266
|
data['Flags'] = data['Detection Flags'];
|
|
3250
3267
|
delete data['Question Flags'];
|
|
3251
3268
|
delete data['Flagged Count'];
|