tango-app-api-audit 3.3.0-alpha.15 → 3.3.0-alpha.17

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-audit",
3
- "version": "3.3.0-alpha.15",
3
+ "version": "3.3.0-alpha.17",
4
4
  "description": "audit & audit metrics apis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -2295,6 +2295,7 @@ export async function userMetrics( req, res ) {
2295
2295
  afterCount: 1,
2296
2296
  checkIntime: 1,
2297
2297
  checkOutTime: 1,
2298
+ mappingPerc: 1,
2298
2299
  hours: {
2299
2300
  $cond: {
2300
2301
  if: { $lt: [ '$hours', 10 ] },
@@ -2330,6 +2331,7 @@ export async function userMetrics( req, res ) {
2330
2331
  checkIntime: 1,
2331
2332
  zoneName: 1,
2332
2333
  checkOutTime: 1,
2334
+ mappingPerc: 1,
2333
2335
  workingHours: {
2334
2336
  $concat: [ '$hours', ':', '$minutes', ':', '$seconds' ],
2335
2337
  },
@@ -2370,6 +2372,7 @@ export async function userMetrics( req, res ) {
2370
2372
  totalCompletedFiles: 1,
2371
2373
  beforeCount: 1,
2372
2374
  afterCount: 1,
2375
+ mappingPerc: 1,
2373
2376
  checkIntime: {
2374
2377
  $dateToString: {
2375
2378
  format: '%Y-%m-%d %H:%M:%S',
@@ -2430,6 +2433,7 @@ export async function userMetrics( req, res ) {
2430
2433
  'check Intime': '$checkIntime',
2431
2434
  'check OutTime': '$checkOutTime',
2432
2435
  'working Hours': '$workingHours',
2436
+ 'Mapping Percentage': '$mappingPerc',
2433
2437
  },
2434
2438
  },
2435
2439
  );
@@ -2458,7 +2462,7 @@ export async function pendingSummaryTable( req, res ) {
2458
2462
  let filters =[
2459
2463
  { fileDateISO: { $gte: dateRange.start } },
2460
2464
  { fileDateISO: { $lte: dateRange.end } },
2461
- { auditStatus: { $in: inputData.filterByStatus } },
2465
+ { auditStatus: { $ne: 'completed' } },
2462
2466
 
2463
2467
  ];
2464
2468
 
@@ -2473,6 +2477,10 @@ export async function pendingSummaryTable( req, res ) {
2473
2477
  if ( inputData.filterByAuditType.length > 0 ) {
2474
2478
  filters.push( { auditType: { $in: inputData.filterByAuditType } } );
2475
2479
  }
2480
+
2481
+ if ( inputData.filterByStatus.length > 0 ) {
2482
+ filters.push( { auditStatus: { $in: inputData.filterByStatus } } );
2483
+ }
2476
2484
  const query =[
2477
2485
  {
2478
2486
  $match: {
@@ -2677,8 +2685,8 @@ export async function overAllAuditSummary( req, res ) {
2677
2685
  auditInprogress: { $cond: [ { $and: [ { $in: [ '$status', [ 'inprogress' ] ] }, { $eq: [ '$auditType', 'Audit' ] } ] }, 1, 0 ] },
2678
2686
  reAuditInprogress: { $cond: [ { $and: [ { $in: [ '$status', [ 'inprogress' ] ] }, { $eq: [ '$auditType', 'ReAudit' ] } ] }, 1, 0 ] },
2679
2687
  draft: { $cond: [ { $eq: [ '$status', 'drafted' ] }, 1, 0 ] },
2680
- assigned: { $cond: [ { $eq: [ '$status', 'drafted' ] }, 1, 0 ] },
2681
- exceptNoAssigned: { $cond: [ { $in: [ '$status', [ 'skipped', 'not_assign' ] ] }, 1, 0 ] },
2688
+ assigned: { $cond: [ { $eq: [ '$status', 'assigned' ] }, 1, 0 ] },
2689
+ exceptNoAssigned: { $cond: { if: { $not: { $in: [ '$status', [ 'skipped', 'not_assign' ] ] } }, then: 1, else: 0 } },
2682
2690
  auditCompleted: { $cond: [ { $and: [ { $in: [ '$status', [ 'completed' ] ] }, { $eq: [ '$auditType', 'Audit' ] } ] }, 1, 0 ] },
2683
2691
  reAuditCompleted: { $cond: [ { $and: [ { $in: [ '$status', [ 'completed' ] ] }, { $eq: [ '$auditType', 'ReAudit' ] } ] }, 1, 0 ] },
2684
2692
 
@@ -2706,7 +2714,6 @@ export async function overAllAuditSummary( req, res ) {
2706
2714
  reAuditInprogress: 1,
2707
2715
  draft: 1,
2708
2716
  assigned: 1,
2709
- exceptNoAssigned1: 1,
2710
2717
  exceptNoAssigned: { $subtract: [ temp.auditStores, '$exceptNoAssigned' ] },
2711
2718
  auditCompleted: 1,
2712
2719
  reAuditCompleted: 1,
@@ -3316,14 +3323,14 @@ export async function totalNotAssignedCount( req, res ) {
3316
3323
  $project: {
3317
3324
  inprogressAuditCount: {
3318
3325
  $cond: [
3319
- { $in: [ '$status', [ 'completed', 'not_assign' ] ] }, 1, 0,
3326
+ { $in: [ '$status', [ 'completed', 'not_assign', 'skipped' ] ] }, 1, 0,
3320
3327
  ],
3321
3328
  },
3322
3329
  inprogressZoneCount: { $cond: [
3323
- { $and: [ { $eq: [ '$moduleType', 'zone' ] }, { $in: [ '$status', [ 'completed', 'not_assign' ] ] } ] }, 1, 0,
3330
+ { $and: [ { $eq: [ '$moduleType', 'zone' ] }, { $in: [ '$status', [ 'completed', 'not_assign', 'skipped' ] ] } ] }, 1, 0,
3324
3331
  ] },
3325
3332
  inprogressTrafficCount: { $cond: [
3326
- { $and: [ { $eq: [ '$moduleType', 'traffic' ] }, { $in: [ '$status', [ 'completed', 'not_assign' ] ] } ] }, 1, 0,
3333
+ { $and: [ { $eq: [ '$moduleType', 'traffic' ] }, { $in: [ '$status', [ 'completed', 'not_assign', 'skipped' ] ] } ] }, 1, 0,
3327
3334
  ] },
3328
3335
 
3329
3336
  },