tango-app-api-trax 3.3.1-beta-18 → 3.3.1-beta-20
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
|
@@ -28,8 +28,7 @@ export const overallFlagMetrics = async ( req, res ) => {
|
|
|
28
28
|
{ date_iso: { $gte: new Date( req.body.startDate ) } },
|
|
29
29
|
{ date_iso: { $lte: new Date( req.body.endDate ) } },
|
|
30
30
|
// { store_id: { $in: req.body.stores } },
|
|
31
|
-
{ userEmail: { $in: getUserEmails } },
|
|
32
|
-
{ $or: [ { store_id: { $in: requestData.storeId || '' } }, { store_id: { $eq: '' } } ] },
|
|
31
|
+
{ $or: [ { store_id: { $in: requestData.storeId } }, { store_id: { $eq: '' }, userEmail: { $in: getUserEmails } } ] },
|
|
33
32
|
],
|
|
34
33
|
},
|
|
35
34
|
},
|
|
@@ -277,8 +276,7 @@ export const checklistFlagsTable = async ( req, res ) => {
|
|
|
277
276
|
{ uniformDetectionFlag: { $gt: 0 } },
|
|
278
277
|
] },
|
|
279
278
|
// { store_id: { $in: req.body.stores } },
|
|
280
|
-
{ userEmail: { $in: getUserEmails } },
|
|
281
|
-
{ $or: [ { store_id: { $in: requestData.storeId || '' } }, { store_id: { $eq: '' } } ] },
|
|
279
|
+
{ $or: [ { store_id: { $in: requestData.storeId } }, { store_id: { $eq: '' }, userEmail: { $in: getUserEmails } } ] },
|
|
282
280
|
],
|
|
283
281
|
},
|
|
284
282
|
};
|
|
@@ -555,8 +553,7 @@ export const flagCardsV1 = async ( req, res ) => {
|
|
|
555
553
|
{ aiStoreList: { $in: storeId } },
|
|
556
554
|
],
|
|
557
555
|
date_iso: { $gte: adjustedFromDate, $lte: adjustedToDate },
|
|
558
|
-
userEmail: { $in: getUserEmails },
|
|
559
|
-
$or: [ { store_id: { $in: requestData.storeId || '' } }, { store_id: { $eq: '' } } ],
|
|
556
|
+
$or: [ { store_id: { $in: requestData.storeId } }, { store_id: { $eq: '' }, userEmail: { $in: getUserEmails } } ],
|
|
560
557
|
},
|
|
561
558
|
},
|
|
562
559
|
{
|
|
@@ -698,8 +695,7 @@ export const flagComparisonCardsV1 = async ( req, res ) => {
|
|
|
698
695
|
{ aiStoreList: { $in: requestData.storeId } },
|
|
699
696
|
],
|
|
700
697
|
date_iso: { $gte: fromDate, $lte: toDate },
|
|
701
|
-
userEmail: { $in: getUserEmails },
|
|
702
|
-
$or: [ { store_id: { $in: requestData.storeId || '' } }, { store_id: { $eq: '' } } ],
|
|
698
|
+
$or: [ { store_id: { $in: requestData.storeId } }, { store_id: { $eq: '' }, userEmail: { $in: getUserEmails } } ],
|
|
703
699
|
} },
|
|
704
700
|
{
|
|
705
701
|
$project: {
|
|
@@ -828,8 +824,7 @@ export const flagTablesV1 = async ( req, res ) => {
|
|
|
828
824
|
{ $or: [ { store_id: { $in: requestData.storeId } }, { aiStoreList: { $in: requestData.storeId } } ] },
|
|
829
825
|
{ date_iso: { $gte: fromDate } },
|
|
830
826
|
{ date_iso: { $lte: toDate } },
|
|
831
|
-
{ userEmail: { $in: getUserEmails } },
|
|
832
|
-
{ $or: [ { store_id: { $in: requestData.storeId || '' } }, { store_id: { $eq: '' } } ] },
|
|
827
|
+
{ $or: [ { store_id: { $in: requestData.storeId } }, { store_id: { $eq: '' }, userEmail: { $in: getUserEmails } } ] },
|
|
833
828
|
);
|
|
834
829
|
|
|
835
830
|
if ( requestData?.filter === 'all' ) {
|
|
@@ -1886,8 +1881,7 @@ export const flagChecklistCardsV1 = async ( req, res ) => {
|
|
|
1886
1881
|
{ date_iso: { $lte: dayjs.utc( reqestData.toDate ).endOf( 'day' ).toDate() } },
|
|
1887
1882
|
{ sourceCheckList_id: new mongoose.Types.ObjectId( reqestData.sourceCheckList_id ) },
|
|
1888
1883
|
// { store_id: { $in: reqestData?.storeId } },
|
|
1889
|
-
{ userEmail: { $in: getUserEmails } },
|
|
1890
|
-
{ $or: [ { store_id: { $in: reqestData.storeId || '' } }, { store_id: { $eq: '' } } ] },
|
|
1884
|
+
{ $or: [ { store_id: { $in: requestData.storeId } }, { store_id: { $eq: '' }, userEmail: { $in: getUserEmails } } ] },
|
|
1891
1885
|
],
|
|
1892
1886
|
},
|
|
1893
1887
|
},
|
|
@@ -2111,8 +2105,7 @@ export const flagChecklistComparisonCardsV1 = async ( req, res ) => {
|
|
|
2111
2105
|
{ date_iso: { $lte: rangeOneToDate } },
|
|
2112
2106
|
{ sourceCheckList_id: new mongoose.Types.ObjectId( requestData.sourceCheckList_id ) },
|
|
2113
2107
|
// { store_id: { $in: requestData?.storeId } },
|
|
2114
|
-
{ userEmail: { $in: getUserEmails } },
|
|
2115
|
-
{ $or: [ { store_id: { $in: requestData.storeId || '' } }, { store_id: { $eq: '' } } ] },
|
|
2108
|
+
{ $or: [ { store_id: { $in: requestData.storeId } }, { store_id: { $eq: '' }, userEmail: { $in: getUserEmails } } ] },
|
|
2116
2109
|
],
|
|
2117
2110
|
},
|
|
2118
2111
|
},
|
|
@@ -2405,8 +2398,7 @@ export const flagChecklistTableV1 = async ( req, res ) => {
|
|
|
2405
2398
|
// ],
|
|
2406
2399
|
// },
|
|
2407
2400
|
// { store_id: { $in: reqestData?.storeId } },
|
|
2408
|
-
{ userEmail: { $in: getUserEmails } },
|
|
2409
|
-
{ $or: [ { store_id: { $in: requestData.storeId || '' } }, { store_id: { $eq: '' } } ] },
|
|
2401
|
+
{ $or: [ { store_id: { $in: requestData.storeId } }, { store_id: { $eq: '' }, userEmail: { $in: getUserEmails } } ] },
|
|
2410
2402
|
],
|
|
2411
2403
|
},
|
|
2412
2404
|
};
|
|
@@ -2682,8 +2674,7 @@ export const checklistDropdownV1 = async ( req, res ) => {
|
|
|
2682
2674
|
{ checkListType: { $in: [ 'customerunattended', 'mobileusagedetection', 'staffleftinthemiddle', 'storeopenandclose', 'uniformdetection' ] } },
|
|
2683
2675
|
],
|
|
2684
2676
|
},
|
|
2685
|
-
{ userEmail: { $in: getUserEmails } },
|
|
2686
|
-
{ $or: [ { store_id: { $in: requestData.storeId || '' } }, { store_id: { $eq: '' } } ] },
|
|
2677
|
+
{ $or: [ { store_id: { $in: requestData.storeId } }, { store_id: { $eq: '' }, userEmail: { $in: getUserEmails } } ] },
|
|
2687
2678
|
] } },
|
|
2688
2679
|
{
|
|
2689
2680
|
$project: {
|