tango-app-api-audit 3.4.58 → 3.4.59
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
|
@@ -1722,6 +1722,8 @@ export async function userAuditHistory( req, res ) {
|
|
|
1722
1722
|
case 'mobile-detection':
|
|
1723
1723
|
case 'scrum':
|
|
1724
1724
|
case 'cleaning':
|
|
1725
|
+
case 'open-time':
|
|
1726
|
+
case 'close-time':
|
|
1725
1727
|
traxAuditDataQuery= {
|
|
1726
1728
|
fileDate: '$fileDate', storeId: '$storeId', moduleType: '$moduleType',
|
|
1727
1729
|
};
|
|
@@ -1988,7 +1990,7 @@ export async function userAuditHistory( req, res ) {
|
|
|
1988
1990
|
},
|
|
1989
1991
|
);
|
|
1990
1992
|
}
|
|
1991
|
-
const count = [ 'mobile-detection', 'uniform-detection', 'hygiene' ].includes( inputData.moduleType )? await aggregateUserEmpDetection( query ) : await aggregateBinaryAudit( query );
|
|
1993
|
+
const count = [ 'mobile-detection', 'uniform-detection', 'hygiene', 'open-time', 'close-time' ].includes( inputData.moduleType )? await aggregateUserEmpDetection( query ) : await aggregateBinaryAudit( query );
|
|
1992
1994
|
if ( count.length == 0 ) {
|
|
1993
1995
|
return res.sendError( 'No Data Found', 204 );
|
|
1994
1996
|
}
|
|
@@ -2040,6 +2042,8 @@ export async function userAuditHistory( req, res ) {
|
|
|
2040
2042
|
temp['Accuracy'] = element.accuracy || '';
|
|
2041
2043
|
break;
|
|
2042
2044
|
case 'mobile-detection':
|
|
2045
|
+
case 'open-time':
|
|
2046
|
+
case 'close-time':
|
|
2043
2047
|
temp['Before Count'] = element.beforeCount;
|
|
2044
2048
|
temp['After Count'] = element.afterCount;
|
|
2045
2049
|
temp['Accuracy'] = element.accuracy || '';
|
|
@@ -2069,7 +2073,7 @@ export async function userAuditHistory( req, res ) {
|
|
|
2069
2073
|
}
|
|
2070
2074
|
|
|
2071
2075
|
|
|
2072
|
-
const result = [ 'mobile-detection', 'uniform-detection', 'hygiene' ].includes( inputData.moduleType )? await aggregateUserEmpDetection( query ) : await aggregateBinaryAudit( query );
|
|
2076
|
+
const result = [ 'mobile-detection', 'uniform-detection', 'hygiene', 'open-time', 'close-time' ].includes( inputData.moduleType )? await aggregateUserEmpDetection( query ) : await aggregateBinaryAudit( query );
|
|
2073
2077
|
|
|
2074
2078
|
return res.sendSuccess( { result: result, count: count.length } );
|
|
2075
2079
|
} catch ( error ) {
|
|
@@ -2104,7 +2108,7 @@ export async function clientMetrics( req, res ) {
|
|
|
2104
2108
|
);
|
|
2105
2109
|
}
|
|
2106
2110
|
let query = [];
|
|
2107
|
-
if ( [ 'mobile-detection', 'uniform-detection', 'hygiene' ].includes( inputData.moduleType ) ) {
|
|
2111
|
+
if ( [ 'mobile-detection', 'uniform-detection', 'hygiene', 'open-time', 'close-time' ].includes( inputData.moduleType ) ) {
|
|
2108
2112
|
query =[
|
|
2109
2113
|
{
|
|
2110
2114
|
$match: {
|
|
@@ -2440,7 +2444,7 @@ export async function storeMetrics( req, res ) {
|
|
|
2440
2444
|
}
|
|
2441
2445
|
|
|
2442
2446
|
if ( inputData.filterByStatus && inputData.filterByStatus?.length > 0 ) {
|
|
2443
|
-
[ 'mobile-detection', 'uniform-detection', 'hygiene' ].includes( inputData.moduleType )? filter.push( { status: { $in: inputData.filterByStatus } } ) : filter.push( { auditStatus: { $in: inputData.filterByStatus } } );
|
|
2447
|
+
[ 'mobile-detection', 'uniform-detection', 'hygiene', 'open-time', 'close-time' ].includes( inputData.moduleType )? filter.push( { status: { $in: inputData.filterByStatus } } ) : filter.push( { auditStatus: { $in: inputData.filterByStatus } } );
|
|
2444
2448
|
}
|
|
2445
2449
|
|
|
2446
2450
|
if ( inputData.filterByAuditType && inputData.filterByAuditType?.length > 0 ) {
|
|
@@ -2911,7 +2915,7 @@ export async function storeMetrics( req, res ) {
|
|
|
2911
2915
|
},
|
|
2912
2916
|
);
|
|
2913
2917
|
}
|
|
2914
|
-
const count = [ 'mobile-detection', 'uniform-detection', 'hygiene' ].includes( inputData.moduleType )?await aggregateStoreEmpDetection( query ) : await aggregateBinaryAudit( binaryQuery );
|
|
2918
|
+
const count = [ 'mobile-detection', 'uniform-detection', 'hygiene', 'open-time', 'close-time' ].includes( inputData.moduleType )?await aggregateStoreEmpDetection( query ) : await aggregateBinaryAudit( binaryQuery );
|
|
2915
2919
|
|
|
2916
2920
|
|
|
2917
2921
|
if ( count.length == 0 ) {
|
|
@@ -2935,7 +2939,7 @@ export async function storeMetrics( req, res ) {
|
|
|
2935
2939
|
$limit: limit,
|
|
2936
2940
|
} );
|
|
2937
2941
|
}
|
|
2938
|
-
const result = [ 'mobile-detection', 'uniform-detection', 'hygiene' ].includes( inputData.moduleType )?await aggregateStoreEmpDetection( query ) : await aggregateBinaryAudit( binaryQuery );
|
|
2942
|
+
const result = [ 'mobile-detection', 'uniform-detection', 'hygiene', 'open-time', 'close-time' ].includes( inputData.moduleType )?await aggregateStoreEmpDetection( query ) : await aggregateBinaryAudit( binaryQuery );
|
|
2939
2943
|
if ( result.length == 0 ) {
|
|
2940
2944
|
return res.sendError( 'No data Found', 204 );
|
|
2941
2945
|
}
|
|
@@ -2981,6 +2985,8 @@ export async function storeMetrics( req, res ) {
|
|
|
2981
2985
|
temp['Accuracy'] = element.accuracy;
|
|
2982
2986
|
break;
|
|
2983
2987
|
case 'uniform-detection':
|
|
2988
|
+
case 'open-time':
|
|
2989
|
+
case 'close-time':
|
|
2984
2990
|
temp['Before Count'] = element.beforeCount;
|
|
2985
2991
|
temp['After Count'] = element.afterCount;
|
|
2986
2992
|
temp['Status'] = toCamelCase( element.status );
|
|
@@ -3261,7 +3267,7 @@ export async function userMetrics( req, res ) {
|
|
|
3261
3267
|
);
|
|
3262
3268
|
}
|
|
3263
3269
|
|
|
3264
|
-
const count = [ 'mobile-detection', 'uniform-detection', 'hygiene' ].includes( inputData.moduleType )?await aggregateUserEmpDetection( query ) : await aggregateBinaryAudit( query );
|
|
3270
|
+
const count = [ 'mobile-detection', 'uniform-detection', 'hygiene', 'open-time', 'close-time' ].includes( inputData.moduleType )?await aggregateUserEmpDetection( query ) : await aggregateBinaryAudit( query );
|
|
3265
3271
|
if ( count.length == 0 ) {
|
|
3266
3272
|
return res.sendError( 'No Data Found', 204 );
|
|
3267
3273
|
}
|
|
@@ -3310,7 +3316,7 @@ export async function userMetrics( req, res ) {
|
|
|
3310
3316
|
}
|
|
3311
3317
|
|
|
3312
3318
|
|
|
3313
|
-
const result = [ 'mobile-detection', 'uniform-detection', 'hygiene' ].includes( inputData.moduleType )?await aggregateUserEmpDetection( query ) : await aggregateBinaryAudit( query );
|
|
3319
|
+
const result = [ 'mobile-detection', 'uniform-detection', 'hygiene', 'open-time', 'close-time' ].includes( inputData.moduleType )?await aggregateUserEmpDetection( query ) : await aggregateBinaryAudit( query );
|
|
3314
3320
|
if ( result.length == 0 ) {
|
|
3315
3321
|
return res.sendError( 'No Data Found', 204 );
|
|
3316
3322
|
}
|
|
@@ -3500,7 +3506,7 @@ export async function pendingSummaryTable( req, res ) {
|
|
|
3500
3506
|
},
|
|
3501
3507
|
);
|
|
3502
3508
|
}
|
|
3503
|
-
const count = [ 'mobile-detection', 'uniform-detection', 'hygiene' ].includes( inputData.moduleType )?await aggregateUserEmpDetection( query ) : await aggregateBinaryAudit( query );
|
|
3509
|
+
const count = [ 'mobile-detection', 'uniform-detection', 'hygiene', 'open-time', 'close-time' ].includes( inputData.moduleType )?await aggregateUserEmpDetection( query ) : await aggregateBinaryAudit( query );
|
|
3504
3510
|
if ( count.length == 0 ) {
|
|
3505
3511
|
return res.sendError( 'No Data Found', 204 );
|
|
3506
3512
|
}
|
|
@@ -3516,7 +3522,7 @@ export async function pendingSummaryTable( req, res ) {
|
|
|
3516
3522
|
} );
|
|
3517
3523
|
}
|
|
3518
3524
|
|
|
3519
|
-
const result = [ 'mobile-detection', 'uniform-detection', 'hygiene' ].includes( inputData.moduleType )?await aggregateUserEmpDetection( query ) : await aggregateBinaryAudit( query );
|
|
3525
|
+
const result = [ 'mobile-detection', 'uniform-detection', 'hygiene', 'open-time', 'close-time' ].includes( inputData.moduleType )?await aggregateUserEmpDetection( query ) : await aggregateBinaryAudit( query );
|
|
3520
3526
|
if ( inputData.isExport ) {
|
|
3521
3527
|
const exportdata = [];
|
|
3522
3528
|
result.forEach( ( element ) => {
|
|
@@ -3546,6 +3552,8 @@ export async function pendingSummaryTable( req, res ) {
|
|
|
3546
3552
|
case 'mobile-detection':
|
|
3547
3553
|
temp['Before Count'] = element.beforeCount;
|
|
3548
3554
|
break;
|
|
3555
|
+
case 'open-time':
|
|
3556
|
+
case 'close-time':
|
|
3549
3557
|
case 'uniform-detection':
|
|
3550
3558
|
temp['Before Count'] = element.beforeCount;
|
|
3551
3559
|
break;
|
|
@@ -3716,7 +3724,7 @@ export async function overAllAuditSummary( req, res ) {
|
|
|
3716
3724
|
},
|
|
3717
3725
|
];
|
|
3718
3726
|
|
|
3719
|
-
const storeAudit = [ 'mobile-detection', 'uniform-detection', 'hygiene' ].includes( inputData.moduleType )?await aggregateStoreEmpDetection( storeAuditQuery ) : await aggregateBinaryAudit( binaryAuditQuery );
|
|
3727
|
+
const storeAudit = [ 'mobile-detection', 'uniform-detection', 'hygiene', 'open-time', 'close-time' ].includes( inputData.moduleType )?await aggregateStoreEmpDetection( storeAuditQuery ) : await aggregateBinaryAudit( binaryAuditQuery );
|
|
3720
3728
|
if ( storeAudit.length > 0 ) {
|
|
3721
3729
|
temp.inprogressStores= storeAudit[0].inprogressStores;
|
|
3722
3730
|
temp.completedStores = storeAudit[0].completedStores;
|
|
@@ -3908,7 +3916,7 @@ export async function summarySplit( req, res ) {
|
|
|
3908
3916
|
},
|
|
3909
3917
|
];
|
|
3910
3918
|
|
|
3911
|
-
const result = [ 'mobile-detection', 'uniform-detection', 'hygiene' ].includes( inputData.moduleType )? await aggregateStoreEmpDetection( query ) : await aggregateBinaryAudit( binaryAuditQuery );
|
|
3919
|
+
const result = [ 'mobile-detection', 'uniform-detection', 'hygiene', 'open-time', 'close-time' ].includes( inputData.moduleType )? await aggregateStoreEmpDetection( query ) : await aggregateBinaryAudit( binaryAuditQuery );
|
|
3912
3920
|
result[0].totalCount = totalCount[0]?.total;
|
|
3913
3921
|
return res.sendSuccess( { result: result.length> 0? result[0]: temp } );
|
|
3914
3922
|
} catch ( error ) {
|
|
@@ -3937,7 +3945,7 @@ export async function overviewTable( req, res ) {
|
|
|
3937
3945
|
}
|
|
3938
3946
|
|
|
3939
3947
|
if ( inputData.filterByStatus.length > 0 ) {
|
|
3940
|
-
[ 'mobile-detection', 'uniform-detection', 'hygiene' ].includes( inputData.moduleType )? filters.push( { status: { $in: inputData.filterByStatus } } ):filters.push( { auditStatus: { $in: inputData.filterByStatus } } );
|
|
3948
|
+
[ 'mobile-detection', 'uniform-detection', 'hygiene', 'open-time', 'close-time' ].includes( inputData.moduleType )? filters.push( { status: { $in: inputData.filterByStatus } } ):filters.push( { auditStatus: { $in: inputData.filterByStatus } } );
|
|
3941
3949
|
}
|
|
3942
3950
|
let traxAuditDataQuery={};
|
|
3943
3951
|
let traxAuditDataFilter = [];
|
|
@@ -3982,6 +3990,8 @@ export async function overviewTable( req, res ) {
|
|
|
3982
3990
|
case 'mobile-detection':
|
|
3983
3991
|
case 'scrum':
|
|
3984
3992
|
case 'cleaning':
|
|
3993
|
+
case 'open-time':
|
|
3994
|
+
case 'close-time':
|
|
3985
3995
|
traxAuditDataQuery= {
|
|
3986
3996
|
fileDate: '$fileDate', storeId: '$storeId', moduleType: '$moduleType',
|
|
3987
3997
|
};
|
|
@@ -4167,7 +4177,7 @@ export async function overviewTable( req, res ) {
|
|
|
4167
4177
|
},
|
|
4168
4178
|
);
|
|
4169
4179
|
}
|
|
4170
|
-
const count = [ 'mobile-detection', 'uniform-detection', 'hygiene' ].includes( inputData.moduleType )? await aggregateStoreEmpDetection( query ) : await aggregateBinaryAudit( query );
|
|
4180
|
+
const count = [ 'mobile-detection', 'uniform-detection', 'hygiene', 'open-time', 'close-time' ].includes( inputData.moduleType )? await aggregateStoreEmpDetection( query ) : await aggregateBinaryAudit( query );
|
|
4171
4181
|
if ( count.length == 0 ) {
|
|
4172
4182
|
return res.sendError( 'No Data Found', 204 );
|
|
4173
4183
|
}
|
|
@@ -4182,7 +4192,7 @@ export async function overviewTable( req, res ) {
|
|
|
4182
4192
|
$limit: limit,
|
|
4183
4193
|
} );
|
|
4184
4194
|
}
|
|
4185
|
-
const result = [ 'mobile-detection', 'uniform-detection', 'hygiene' ].includes( inputData.moduleType )? await aggregateStoreEmpDetection( query ) : await aggregateBinaryAudit( query );
|
|
4195
|
+
const result = [ 'mobile-detection', 'uniform-detection', 'hygiene', 'open-time', 'close-time' ].includes( inputData.moduleType )? await aggregateStoreEmpDetection( query ) : await aggregateBinaryAudit( query );
|
|
4186
4196
|
if ( inputData.isExport ) {
|
|
4187
4197
|
const exportdata = [];
|
|
4188
4198
|
result.forEach( ( element ) => {
|
|
@@ -4220,6 +4230,8 @@ export async function overviewTable( req, res ) {
|
|
|
4220
4230
|
temp['Audit Type'] = element.auditType;
|
|
4221
4231
|
temp['Status'] = toCamelCase( element.status );
|
|
4222
4232
|
break;
|
|
4233
|
+
case 'open-time':
|
|
4234
|
+
case 'close-time':
|
|
4223
4235
|
case 'uniform-detection':
|
|
4224
4236
|
temp['Before Count'] = element.beforeCount;
|
|
4225
4237
|
temp['After Count'] = element.afterCount;
|