tango-app-api-audit 3.4.3-alpha.13 → 3.4.3-alpha.14

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.4.3-alpha.13",
3
+ "version": "3.4.3-alpha.14",
4
4
  "description": "audit & audit metrics apis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -346,6 +346,7 @@ import { updateOneEmpDetectionOutput } from '../service/empDetectionOutput.servi
346
346
  // img_id: img[3],
347
347
  // selected: false,
348
348
  // dropped: false,
349
+ // singleDetection: false,
349
350
  // count: 1,
350
351
  // mappedid: [ mapimg ],
351
352
  // } );
@@ -1722,7 +1723,7 @@ export async function userAuditHistory( req, res ) {
1722
1723
  'Start Time': element.startTime,
1723
1724
  'End Time': element.endTime || '',
1724
1725
  'Time Spent': element.timeSpent,
1725
- 'Status': element.auditStatus,
1726
+ 'Status': toCamelCase( element.auditStatus ),
1726
1727
  'Audited Date': dayjs( element.createdAt ).format( 'YYYY,MMM D' ),
1727
1728
  'Result': element.answer,
1728
1729
 
@@ -2594,18 +2595,18 @@ export async function storeMetrics( req, res ) {
2594
2595
  case 'left-in-middle':
2595
2596
  temp['Question'] = element.question;
2596
2597
  temp['User Comments'] = element.userComments;
2597
- temp['Status'] = element.auditStatus;
2598
+ temp['Status'] = toCamelCase( element.auditStatus );
2598
2599
  break;
2599
2600
  case 'mobile-detection':
2600
2601
  temp['Before Count'] = element.beforeCount;
2601
2602
  temp['After Count'] = element.afterCount;
2602
- temp['Status'] = element.status;
2603
+ temp['Status'] = toCamelCase( element.status );
2603
2604
  temp['Accuracy'] = element.accuracy;
2604
2605
  break;
2605
2606
  case 'uniform-detection':
2606
2607
  temp['Before Count'] = element.beforeCount;
2607
2608
  temp['After Count'] = element.afterCount;
2608
- temp['Status'] = element.status;
2609
+ temp['Status'] = toCamelCase( element.status );
2609
2610
  temp['Accuracy'] = element.accuracy;
2610
2611
  break;
2611
2612
  }
@@ -3088,7 +3089,7 @@ export async function pendingSummaryTable( req, res ) {
3088
3089
  'Start Time': element.startTime,
3089
3090
  'User Name': element.userName,
3090
3091
  'User Email': element.userEmail,
3091
- 'Status': element.auditStatus,
3092
+ 'Status': toCamelCase( element.auditStatus ),
3092
3093
  };
3093
3094
  switch ( inputData.moduleType ) {
3094
3095
  case 'camera-angle-change':
@@ -3635,32 +3636,32 @@ export async function overviewTable( req, res ) {
3635
3636
  temp['stream Name'] = element.streamName;
3636
3637
  temp['User Comments'] = element.userComments;
3637
3638
  temp['Audit Type'] = element.auditType;
3638
- temp['Status'] = element.auditStatus;
3639
+ temp['Status'] = toCamelCase( element.auditStatus );
3639
3640
  break;
3640
3641
  case 'unattended-customer':
3641
3642
  temp['Customer ID'] = element.tempId;
3642
3643
  temp['Question'] = element.question;
3643
3644
  temp['User Comments'] = element.userComments;
3644
3645
  temp['Audit Type'] = element.auditType;
3645
- temp['Status'] = element.auditStatus;
3646
+ temp['Status'] = toCamelCase( element.auditStatus );
3646
3647
  break;
3647
3648
  case 'left-in-middle':
3648
3649
  temp['Question'] = element.question;
3649
3650
  temp['User Comments'] = element.userComments;
3650
3651
  temp['Audit Type'] = element.auditType;
3651
- temp['Status'] = element.auditStatus;
3652
+ temp['Status'] = toCamelCase( element.auditStatus );
3652
3653
  break;
3653
3654
  case 'mobile-detection':
3654
3655
  temp['Before Count'] = element.beforeCount;
3655
3656
  temp['After Count'] = element.afterCount;
3656
3657
  temp['Audit Type'] = element.auditType;
3657
- temp['Status'] = element.status;
3658
+ temp['Status'] = toCamelCase( element.status );
3658
3659
  break;
3659
3660
  case 'uniform-detection':
3660
3661
  temp['Before Count'] = element.beforeCount;
3661
3662
  temp['After Count'] = element.afterCount;
3662
3663
  temp['Audit Type'] = element.auditType;
3663
- temp['Status'] = element.status;
3664
+ temp['Status'] = toCamelCase( element.status );
3664
3665
  break;
3665
3666
  }
3666
3667
  exportdata.push( temp );
@@ -4005,6 +4006,7 @@ export async function getDetectionAuditFile( req, res ) {
4005
4006
  img_id: img[3],
4006
4007
  selected: false,
4007
4008
  dropped: false,
4009
+ singleDetection: false,
4008
4010
  count: 1,
4009
4011
  mappedid: [ mapimg ],
4010
4012
  } );
@@ -4338,3 +4340,15 @@ export async function reTrigger( req, res ) {
4338
4340
  return res.sendError( err, 500 );
4339
4341
  }
4340
4342
  }
4343
+
4344
+ export function toCamelCase( str ) {
4345
+ logger.info( { str: str } );
4346
+ return str
4347
+ .split( '-' ) // Split the string by spaces
4348
+ .map( ( word, index ) =>
4349
+ // index === 0 ?
4350
+ // word.toLowerCase() : // Lowercase the first word
4351
+ word.charAt( 0 ).toUpperCase() + word.slice( 1 ).toLowerCase(), // Capitalize the first letter of subsequent words
4352
+ )
4353
+ .join( '' ); // Join the words without spaces
4354
+ }