tango-app-api-trax 3.2.1-hotfix-5 → 3.2.1-hotfix-6
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
|
@@ -831,7 +831,8 @@ export const flagTablesV1 = async ( req, res ) => {
|
|
|
831
831
|
);
|
|
832
832
|
|
|
833
833
|
if ( requestData?.filter === 'all' ) {
|
|
834
|
-
findAndQuery.push( { $or: [ { questionFlag: { $gte: 1 } }, { timeFlag: { $gte: 1 } }, { checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection' ] } } ] } );
|
|
834
|
+
// findAndQuery.push( { $or: [ { questionFlag: { $gte: 1 } }, { timeFlag: { $gte: 1 } }, { checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection' ] } } ] } );
|
|
835
|
+
findAndQuery.push( { $or: [ { checkListType: { $in: [ 'custom', 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection' ] } } ] } );
|
|
835
836
|
} else if ( requestData?.filter === 'question' ) {
|
|
836
837
|
findAndQuery.push( { checkListType: 'custom' } );
|
|
837
838
|
findAndQuery.push( { questionFlag: { $gte: 1 } } );
|
|
@@ -879,25 +880,40 @@ export const flagTablesV1 = async ( req, res ) => {
|
|
|
879
880
|
checkListType: { $last: '$checkListType' },
|
|
880
881
|
storeCount: { $sum: 1 },
|
|
881
882
|
storeCountAi: { $max: '$storeCount' },
|
|
882
|
-
flaggedStores: {
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
883
|
+
// flaggedStores: {
|
|
884
|
+
// $addToSet: {
|
|
885
|
+
// $cond: [
|
|
886
|
+
// {
|
|
887
|
+
// $or: [
|
|
888
|
+
// { $gt: [ '$timeFlag', 0 ] },
|
|
889
|
+
// { $gt: [ '$questionFlag', 0 ] },
|
|
890
|
+
// { $gt: [ '$mobileDetectionFlag', 0 ] },
|
|
891
|
+
// { $gt: [ '$storeOpenCloseFlag', 0 ] },
|
|
892
|
+
// { $gt: [ '$uniformDetectionFlag', 0 ] },
|
|
893
|
+
// { $gt: [ '$customerUnattended', 0 ] },
|
|
894
|
+
// { $gt: [ '$staffLeftInTheMiddle', 0 ] },
|
|
895
|
+
// ],
|
|
896
|
+
// },
|
|
897
|
+
// '$store_id',
|
|
898
|
+
// '$$REMOVE',
|
|
899
|
+
// ],
|
|
900
|
+
// },
|
|
901
|
+
// },
|
|
902
|
+
flaggedStores: { $sum: { $cond: [
|
|
903
|
+
{
|
|
904
|
+
$or: [
|
|
905
|
+
{ '$gt': [ '$timeFlag', 0 ] },
|
|
906
|
+
{ '$gt': [ '$questionFlag', 0 ] },
|
|
907
|
+
{ '$gt': [ '$mobileDetectionFlag', 0 ] },
|
|
908
|
+
{ '$gt': [ '$storeOpenCloseFlag', 0 ] },
|
|
909
|
+
{ '$gt': [ '$uniformDetectionFlag', 0 ] },
|
|
910
|
+
{ '$gt': [ '$customerUnattended', 0 ] },
|
|
911
|
+
{ '$gt': [ '$staffLeftInTheMiddle', 0 ] },
|
|
898
912
|
],
|
|
899
913
|
},
|
|
900
|
-
|
|
914
|
+
1,
|
|
915
|
+
0,
|
|
916
|
+
] } },
|
|
901
917
|
flagCount: {
|
|
902
918
|
$sum: {
|
|
903
919
|
$add: [ '$questionFlag', '$timeFlag' ],
|
|
@@ -957,7 +973,8 @@ export const flagTablesV1 = async ( req, res ) => {
|
|
|
957
973
|
checkListType: 1,
|
|
958
974
|
flagType: 1,
|
|
959
975
|
uniqueFlaggedStores: 1,
|
|
960
|
-
flaggedStores: { $size: '$flaggedStores' },
|
|
976
|
+
// flaggedStores: { $size: '$flaggedStores' },
|
|
977
|
+
flaggedStores: '$flaggedStores',
|
|
961
978
|
flagCount: 1,
|
|
962
979
|
questionCount: 1,
|
|
963
980
|
correctAnswers: { $subtract: [ '$submittedQuestionCount', '$questionFlag' ] },
|