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.
|
@@ -289,8 +289,7 @@ export const checklistPerformance = async ( req, res ) => {
|
|
|
289
289
|
{ date_iso: { $gte: fromDate, $lte: toDate } },
|
|
290
290
|
{ client_id: requestData.clientId },
|
|
291
291
|
// { store_id: { $in: requestData.storeId } },
|
|
292
|
-
{ userEmail: { $in: getUserEmails } },
|
|
293
|
-
{ $or: [ { store_id: { $in: requestData.storeId || '' } }, { store_id: { $eq: '' } } ] },
|
|
292
|
+
{ $or: [ { store_id: { $in: requestData.storeId } }, { store_id: { $eq: '' }, userEmail: { $in: getUserEmails } } ] },
|
|
294
293
|
);
|
|
295
294
|
|
|
296
295
|
findQuery.push( { $match: { $and: findAndQuery } } );
|
|
@@ -476,8 +475,7 @@ export const storePerformance = async ( req, res ) => {
|
|
|
476
475
|
{ date_iso: { $lte: toDate } },
|
|
477
476
|
{ checkListType: { $eq: 'custom' } },
|
|
478
477
|
// { store_id: { $in: requestData.storeId } },
|
|
479
|
-
{ userEmail: { $in: getUserEmails } },
|
|
480
|
-
{ $or: [ { store_id: { $in: requestData.storeId || '' } }, { store_id: { $eq: '' } } ] },
|
|
478
|
+
{ $or: [ { store_id: { $in: requestData.storeId } }, { store_id: { $eq: '' }, userEmail: { $in: getUserEmails } } ] },
|
|
481
479
|
);
|
|
482
480
|
|
|
483
481
|
findQuery.push( { $match: { $and: findAndQuery } } );
|
|
@@ -687,8 +685,7 @@ export const userPerformance = async ( req, res ) => {
|
|
|
687
685
|
{ checkListType: { $eq: 'custom' } },
|
|
688
686
|
{ client_id: requestData.clientId },
|
|
689
687
|
// { store_id: { $in: requestData.storeId } },
|
|
690
|
-
{ userEmail: { $in: getUserEmails } },
|
|
691
|
-
{ $or: [ { store_id: { $in: requestData.storeId || '' } }, { store_id: { $eq: '' } } ] },
|
|
688
|
+
{ $or: [ { store_id: { $in: requestData.storeId } }, { store_id: { $eq: '' }, userEmail: { $in: getUserEmails } } ] },
|
|
692
689
|
);
|
|
693
690
|
|
|
694
691
|
findQuery.push( { $match: { $and: findAndQuery } } );
|
|
@@ -991,8 +988,7 @@ export const storeDropdown = async ( req, res ) => {
|
|
|
991
988
|
{ date_iso: { $gte: fromDate } },
|
|
992
989
|
{ date_iso: { $lte: toDate } },
|
|
993
990
|
// { store_id: { $in: requestData.storeId } },
|
|
994
|
-
{ userEmail: { $in: getUserEmails } },
|
|
995
|
-
{ $or: [ { store_id: { $in: requestData.storeId || '' } }, { store_id: { $eq: '' } } ] },
|
|
991
|
+
{ $or: [ { store_id: { $in: requestData.storeId } }, { store_id: { $eq: '' }, userEmail: { $in: getUserEmails } } ] },
|
|
996
992
|
);
|
|
997
993
|
|
|
998
994
|
findQuery.push( { $match: { $and: findAndQuery } } );
|
|
@@ -1115,8 +1111,7 @@ export const userDropdown = async ( req, res ) => {
|
|
|
1115
1111
|
{ date_iso: { $gte: fromDate } },
|
|
1116
1112
|
{ date_iso: { $lte: toDate } },
|
|
1117
1113
|
// { store_id: { $in: requestData.storeId } },
|
|
1118
|
-
{ userEmail: { $in: getUserEmails } },
|
|
1119
|
-
{ $or: [ { store_id: { $in: requestData.storeId || '' } }, { store_id: { $eq: '' } } ] },
|
|
1114
|
+
{ $or: [ { store_id: { $in: requestData.storeId } }, { store_id: { $eq: '' }, userEmail: { $in: getUserEmails } } ] },
|
|
1120
1115
|
);
|
|
1121
1116
|
|
|
1122
1117
|
findQuery.push( { $match: { $and: findAndQuery } } );
|
|
@@ -1220,8 +1215,7 @@ export const checklistInfo = async ( req, res ) => {
|
|
|
1220
1215
|
{ date_iso: { $lte: toDate } },
|
|
1221
1216
|
{ checkListType: { $eq: 'custom' } },
|
|
1222
1217
|
// { store_id: { $in: requestData.storeId } },
|
|
1223
|
-
{ userEmail: { $in: getUserEmails } },
|
|
1224
|
-
{ $or: [ { store_id: { $in: requestData.storeId || '' } }, { store_id: { $eq: '' } } ] },
|
|
1218
|
+
{ $or: [ { store_id: { $in: requestData.storeId } }, { store_id: { $eq: '' }, userEmail: { $in: getUserEmails } } ] },
|
|
1225
1219
|
);
|
|
1226
1220
|
|
|
1227
1221
|
if ( requestData.checklistStatus && requestData.checklistStatus != 'All' ) {
|
|
@@ -1275,6 +1269,7 @@ export const checklistInfo = async ( req, res ) => {
|
|
|
1275
1269
|
findQuery.push( {
|
|
1276
1270
|
$project: {
|
|
1277
1271
|
checkListName: 1,
|
|
1272
|
+
coverage: 1,
|
|
1278
1273
|
createdByName: 1,
|
|
1279
1274
|
userName: 1,
|
|
1280
1275
|
userEmail: 1,
|
|
@@ -1298,6 +1293,7 @@ export const checklistInfo = async ( req, res ) => {
|
|
|
1298
1293
|
findQuery.push( {
|
|
1299
1294
|
$project: {
|
|
1300
1295
|
checkListName: 1,
|
|
1296
|
+
coverage: 1,
|
|
1301
1297
|
checkListChar: { $substr: [ '$checkListName', 0, 2 ] },
|
|
1302
1298
|
createdByName: 1,
|
|
1303
1299
|
userName: 1,
|
|
@@ -1423,8 +1419,7 @@ export const infoCardsOld = async ( req, res ) => {
|
|
|
1423
1419
|
{ date_iso: { $gte: fromDate } },
|
|
1424
1420
|
{ date_iso: { $lte: toDate } },
|
|
1425
1421
|
// { store_id: { $in: requestData.storeId } },
|
|
1426
|
-
{ userEmail: { $in: getUserEmails } },
|
|
1427
|
-
{ $or: [ { store_id: { $in: requestData.storeId || '' } }, { store_id: { $eq: '' } } ] },
|
|
1422
|
+
{ $or: [ { store_id: { $in: requestData.storeId } }, { store_id: { $eq: '' }, userEmail: { $in: getUserEmails } } ] },
|
|
1428
1423
|
);
|
|
1429
1424
|
|
|
1430
1425
|
if ( requestData.groupByType == 'checklist' ) {
|
|
@@ -1714,8 +1709,7 @@ export const flagDetectionCards = async ( req, res ) => {
|
|
|
1714
1709
|
{ date_iso: { $gte: fromDate } },
|
|
1715
1710
|
{ date_iso: { $lte: toDate } },
|
|
1716
1711
|
// { store_id: { $in: requestData.storeId } },
|
|
1717
|
-
{ userEmail: { $in: getUserEmails } },
|
|
1718
|
-
{ $or: [ { store_id: { $in: requestData.storeId || '' } }, { store_id: { $eq: '' } } ] },
|
|
1712
|
+
{ $or: [ { store_id: { $in: requestData.storeId } }, { store_id: { $eq: '' }, userEmail: { $in: getUserEmails } } ] },
|
|
1719
1713
|
);
|
|
1720
1714
|
findQuery.push( { $match: { $and: findAndQuery } } );
|
|
1721
1715
|
|
|
@@ -1879,8 +1873,7 @@ export const flagDetectionTables = async ( req, res ) => {
|
|
|
1879
1873
|
{ date_iso: { $lte: toDate } },
|
|
1880
1874
|
{ checklistStatus: { $eq: 'submit' } },
|
|
1881
1875
|
// { store_id: { $in: requestData.storeId } },
|
|
1882
|
-
{ userEmail: { $in: getUserEmails } },
|
|
1883
|
-
{ $or: [ { store_id: { $in: requestData.storeId || '' } }, { store_id: { $eq: '' } } ] },
|
|
1876
|
+
{ $or: [ { store_id: { $in: requestData.storeId } }, { store_id: { $eq: '' }, userEmail: { $in: getUserEmails } } ] },
|
|
1884
1877
|
);
|
|
1885
1878
|
|
|
1886
1879
|
findQuery.push( { $match: { $and: findAndQuery } } );
|
|
@@ -2226,8 +2219,7 @@ export const overallCardsV1 = async ( req, res ) => {
|
|
|
2226
2219
|
{ date_iso: { $gte: fromDate, $lte: toDate } },
|
|
2227
2220
|
{ client_id: requestData.clientId },
|
|
2228
2221
|
// { store_id: { $in: requestData.storeId } },
|
|
2229
|
-
{ userEmail: { $in: getUserEmails } },
|
|
2230
|
-
{ $or: [ { store_id: { $in: requestData.storeId || '' } }, { store_id: { $eq: '' } } ] },
|
|
2222
|
+
{ $or: [ { store_id: { $in: requestData.storeId } }, { store_id: { $eq: '' }, userEmail: { $in: getUserEmails } } ] },
|
|
2231
2223
|
);
|
|
2232
2224
|
|
|
2233
2225
|
findQuery.push( { $match: { $and: findAndQuery } } );
|
|
@@ -2476,8 +2468,7 @@ export const overallComparisonCardsV1 = async ( req, res ) => {
|
|
|
2476
2468
|
{ date_iso: { $gte: rangeOneFromDate, $lte: rangeOneToDate } },
|
|
2477
2469
|
{ client_id: requestData.clientId },
|
|
2478
2470
|
// { store_id: { $in: requestData.storeId } },
|
|
2479
|
-
{ userEmail: { $in: getUserEmails } },
|
|
2480
|
-
{ $or: [ { store_id: { $in: requestData.storeId || '' } }, { store_id: { $eq: '' } } ] },
|
|
2471
|
+
{ $or: [ { store_id: { $in: requestData.storeId } }, { store_id: { $eq: '' }, userEmail: { $in: getUserEmails } } ] },
|
|
2481
2472
|
);
|
|
2482
2473
|
|
|
2483
2474
|
rangeOneFindQuery.push( { $match: { $and: rangeOneFindAndQuery } } );
|
|
@@ -2575,8 +2566,7 @@ export const overallComparisonCardsV1 = async ( req, res ) => {
|
|
|
2575
2566
|
{ date_iso: { $gte: rangeTwoFromDate, $lte: rangeTwoToDate } },
|
|
2576
2567
|
{ client_id: requestData.clientId },
|
|
2577
2568
|
// { store_id: { $in: requestData.storeId } },
|
|
2578
|
-
{ userEmail: { $in: getUserEmails } },
|
|
2579
|
-
{ $or: [ { store_id: { $in: requestData.storeId || '' } }, { store_id: { $eq: '' } } ] },
|
|
2569
|
+
{ $or: [ { store_id: { $in: requestData.storeId } }, { store_id: { $eq: '' }, userEmail: { $in: getUserEmails } } ] },
|
|
2580
2570
|
);
|
|
2581
2571
|
|
|
2582
2572
|
rangeTwoFindQuery.push( { $match: { $and: rangeTwoFindAndQuery } } );
|
|
@@ -2728,8 +2718,7 @@ export const infoCardsV1 = async ( req, res ) => {
|
|
|
2728
2718
|
{ date_iso: { $lte: toDate } },
|
|
2729
2719
|
{ checkListType: { $eq: 'custom' } },
|
|
2730
2720
|
// { store_id: { $in: requestData.storeId } },
|
|
2731
|
-
{ userEmail: { $in: getUserEmails } },
|
|
2732
|
-
{ $or: [ { store_id: { $in: requestData.storeId || '' } }, { store_id: { $eq: '' } } ] },
|
|
2721
|
+
{ $or: [ { store_id: { $in: requestData.storeId } }, { store_id: { $eq: '' }, userEmail: { $in: getUserEmails } } ] },
|
|
2733
2722
|
);
|
|
2734
2723
|
|
|
2735
2724
|
if ( requestData.groupByType == 'Checklist' ) {
|
|
@@ -3012,8 +3001,7 @@ export const infoComparisonCardsV1 = async ( req, res ) => {
|
|
|
3012
3001
|
{ date_iso: { $lte: rangeOneToDate } },
|
|
3013
3002
|
{ checkListType: { $eq: 'custom' } },
|
|
3014
3003
|
// { store_id: { $in: requestData.storeId } },
|
|
3015
|
-
{ userEmail: { $in: getUserEmails } },
|
|
3016
|
-
{ $or: [ { store_id: { $in: requestData.storeId || '' } }, { store_id: { $eq: '' } } ] },
|
|
3004
|
+
{ $or: [ { store_id: { $in: requestData.storeId } }, { store_id: { $eq: '' }, userEmail: { $in: getUserEmails } } ] },
|
|
3017
3005
|
);
|
|
3018
3006
|
|
|
3019
3007
|
if ( requestData.groupByType == 'Checklist' ) {
|
|
@@ -3132,8 +3120,7 @@ export const infoComparisonCardsV1 = async ( req, res ) => {
|
|
|
3132
3120
|
{ date_iso: { $lte: rangeTwoToDate } },
|
|
3133
3121
|
{ checkListType: { $eq: 'custom' } },
|
|
3134
3122
|
// { store_id: { $in: requestData.storeId } },
|
|
3135
|
-
{ userEmail: { $in: getUserEmails } },
|
|
3136
|
-
{ $or: [ { store_id: { $in: requestData.storeId || '' } }, { store_id: { $eq: '' } } ] },
|
|
3123
|
+
{ $or: [ { store_id: { $in: requestData.storeId } }, { store_id: { $eq: '' }, userEmail: { $in: getUserEmails } } ] },
|
|
3137
3124
|
);
|
|
3138
3125
|
if ( requestData.groupByType == 'Checklist' ) {
|
|
3139
3126
|
rangeTwoFindAndQuery.push( { sourceCheckList_id: new mongoose.Types.ObjectId( requestData.groupByValue ) } );
|
|
@@ -3332,8 +3319,7 @@ export const monthlyGraphV1 = async ( req, res ) => {
|
|
|
3332
3319
|
{ date_iso: { $lte: toDate } },
|
|
3333
3320
|
{ checkListType: { $eq: 'custom' } },
|
|
3334
3321
|
// { store_id: { $in: requestData.storeId } },
|
|
3335
|
-
{ userEmail: { $in: getUserEmails } },
|
|
3336
|
-
{ $or: [ { store_id: { $in: requestData.storeId || '' } }, { store_id: { $eq: '' } } ] },
|
|
3322
|
+
{ $or: [ { store_id: { $in: requestData.storeId } }, { store_id: { $eq: '' }, userEmail: { $in: getUserEmails } } ] },
|
|
3337
3323
|
);
|
|
3338
3324
|
|
|
3339
3325
|
if ( requestData.groupByType == 'Checklist' ) {
|
|
@@ -3573,8 +3559,7 @@ export const checklistDropdown = async ( req, res ) => {
|
|
|
3573
3559
|
{ date_iso: { $gte: fromDate, $lte: toDate } },
|
|
3574
3560
|
{ checkListType: 'custom' },
|
|
3575
3561
|
// { store_id: { $in: requestData.storeId } },
|
|
3576
|
-
{ userEmail: { $in: getUserEmails } },
|
|
3577
|
-
{ $or: [ { store_id: { $in: requestData.storeId || '' } }, { store_id: { $eq: '' } } ] },
|
|
3562
|
+
{ $or: [ { store_id: { $in: requestData.storeId } }, { store_id: { $eq: '' }, userEmail: { $in: getUserEmails } } ] },
|
|
3578
3563
|
] } },
|
|
3579
3564
|
{
|
|
3580
3565
|
$project: {
|
|
@@ -16,6 +16,7 @@ traxRouter
|
|
|
16
16
|
.post( '/validateUser', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), validate( uploadUserValidation ), traxController.validateUser )
|
|
17
17
|
.post( '/validateUserv1', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), validate( uploadUserValidation ), traxController.validateUserv1 )
|
|
18
18
|
.get( '/userDetails/:checklistId', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), validate( duplicateValidation ), traxController.assignedUserDetails )
|
|
19
|
+
.get( '/userDetailsv1/:checklistId', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ), validate( duplicateValidation ), traxController.assignedUserDetailsv1 )
|
|
19
20
|
.post( '/checklistConfigure', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), traxController.updateConfigure )
|
|
20
21
|
.post( '/checklistConfigurev1', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), traxController.updateConfigurev1 )
|
|
21
22
|
.delete( '/deleteChecklist/:checklistId', isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ 'isEdit' ] } ] } ), validate( duplicateValidation ), traxController.deleteChecklist )
|
|
@@ -27,7 +28,7 @@ traxRouter
|
|
|
27
28
|
.post( '/selectAssign', validate( selectAssign ), traxController.selectAssign )
|
|
28
29
|
.post( '/assign', isAllowedSessionHandler, traxController.checklistAssign )
|
|
29
30
|
// .post( '/remove', isAllowedSessionHandler, traxController.removeAssign )
|
|
30
|
-
.post( '/removeAssignList', isAllowedSessionHandler, traxController.deleteAssignList )
|
|
31
|
+
// .post( '/removeAssignList', isAllowedSessionHandler, traxController.deleteAssignList )
|
|
31
32
|
.post( '/assignUpload', isAllowedSessionHandler, traxController.assignChecklistUser );
|
|
32
33
|
|
|
33
34
|
// isAllowedSessionHandler, isAllowedClient, accessVerification( { userType: [ 'tango', 'client' ], access: [ { featureName: 'TangoTrax', name: 'checklist', permissions: [ ] } ] } ),
|