tango-app-api-trax 3.6.1-runai-1 → 3.6.1-runai-2
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
|
@@ -534,7 +534,6 @@ export const flagCardsV1 = async ( req, res ) => {
|
|
|
534
534
|
questionFlag: { count: 0 },
|
|
535
535
|
delayInSubmission: { count: 0 },
|
|
536
536
|
detectionFlag: { count: 0 },
|
|
537
|
-
runAIFlag: { flagCount: 0, list: [] },
|
|
538
537
|
};
|
|
539
538
|
|
|
540
539
|
let requestData = req.body;
|
|
@@ -582,7 +581,6 @@ export const flagCardsV1 = async ( req, res ) => {
|
|
|
582
581
|
'detectionFlag': {
|
|
583
582
|
'count': 0,
|
|
584
583
|
},
|
|
585
|
-
'runAIFlag': { flagCount: 0, list: [] },
|
|
586
584
|
},
|
|
587
585
|
};
|
|
588
586
|
return res.sendSuccess( resVal );
|
|
@@ -619,7 +617,9 @@ export const flagCardsV1 = async ( req, res ) => {
|
|
|
619
617
|
}
|
|
620
618
|
} );
|
|
621
619
|
flagCards.totalFlag += flagCards.detectionFlag.count;
|
|
622
|
-
|
|
620
|
+
if ( resultData?.runAI ) {
|
|
621
|
+
flagCards.runAIFlag = resultData?.runAI;
|
|
622
|
+
}
|
|
623
623
|
}
|
|
624
624
|
|
|
625
625
|
return res.sendSuccess( { flagCards } );
|
|
@@ -2527,7 +2527,7 @@ export const flagChecklistTableV1 = async ( req, res ) => {
|
|
|
2527
2527
|
if ( reqestData?.filter === 'runAI' ) {
|
|
2528
2528
|
resultData.aiFlagData.forEach( ( element ) => {
|
|
2529
2529
|
exportdata.push( {
|
|
2530
|
-
'Date': element
|
|
2530
|
+
'Date': dayjs( element.dateString ).format( 'DD MMM, YYYY' ),
|
|
2531
2531
|
'Store Name': element?.storeName,
|
|
2532
2532
|
'User Email': element?.spocEmail,
|
|
2533
2533
|
'Detections': element?.detections,
|
|
@@ -2562,7 +2562,7 @@ export const flagChecklistTableV1 = async ( req, res ) => {
|
|
|
2562
2562
|
if ( resultData.status_code == '200' ) {
|
|
2563
2563
|
if ( reqestData?.filter === 'runAI' ) {
|
|
2564
2564
|
resultData.aiFlagData = resultData.aiFlagData.map( ( ele ) => {
|
|
2565
|
-
ele = { ...ele, date: ele.dateString, storeSpocEmail: ele?.spocEmail, checklistStatus: 'submit' };
|
|
2565
|
+
ele = { ...ele, date: dayjs( ele.dateString ).format( 'DD MMM, YYYY' ), storeSpocEmail: ele?.spocEmail, checklistStatus: 'submit' };
|
|
2566
2566
|
return ele;
|
|
2567
2567
|
} );
|
|
2568
2568
|
resultData = { customData: resultData.aiFlagData, totalCount: resultData.totalCount };
|
|
@@ -3001,7 +3001,7 @@ export const flagTablesV2 = async ( req, res ) => {
|
|
|
3001
3001
|
} else if ( requestData?.filter === 'detection' ) {
|
|
3002
3002
|
findAndQuery.push( { checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection', 'cleaning', 'scrum' ] } } );
|
|
3003
3003
|
} else if ( requestData?.filter === 'runAI' ) {
|
|
3004
|
-
findAndQuery.push( {
|
|
3004
|
+
findAndQuery.push( { checkListName: { $in: req.body.runAIChecklistName } } );
|
|
3005
3005
|
}
|
|
3006
3006
|
|
|
3007
3007
|
findQuery.push( { $match: { $and: findAndQuery } } );
|