tango-app-api-audit 3.3.0-beta.3 → 3.3.0

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-beta.3",
3
+ "version": "3.3.0",
4
4
  "description": "audit & audit metrics apis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1646,46 +1646,25 @@ export async function userAuditHistory( req, res ) {
1646
1646
  const promises = chunkedMappingData.map( async ( chunk ) => {
1647
1647
  const exportData = [];
1648
1648
  chunk.forEach( ( element ) => {
1649
- if ( element.moduleType == 'zone' ) {
1650
- exportData.push( {
1651
- 'File Date': element.fileDate,
1652
- 'Brand ID': element.clientId,
1653
- 'Brand Name': element.clientName,
1654
- 'Store ID': element.storeId,
1655
- 'Store Name': element.storeName,
1656
- 'Zone Name': element.zoneName,
1657
- 'Audit Type': element.auditType,
1658
- 'Product Type': element.moduleType,
1659
- 'Before Count': element.beforeCount,
1660
- 'After Count': element.afterCount || '',
1661
- 'Accuracy': element.accuracy || '',
1662
- 'Start Time': element.startTime,
1663
- 'End Time': element.endTime || '',
1664
- 'Time Spent': element.timeSpent,
1665
- 'Audit Status': element.auditStatus,
1666
- 'Audited Date': dayjs( element.createdAt ).format( 'YYYY,MMM D' ),
1667
-
1668
- } );
1669
- } else {
1670
- exportData.push( {
1671
- 'File Date': element.fileDate,
1672
- 'Brand ID': element.clientId,
1673
- 'Brand Name': element.clientName,
1674
- 'Store ID': element.storeId,
1675
- 'Store Name': element.storeName,
1676
- 'Audit Type': element.auditType,
1677
- 'Product Type': element.moduleType,
1678
- 'Before Count': element.beforeCount,
1679
- 'After Count': element.afterCount || '',
1680
- 'Accuracy': element.accuracy || '',
1681
- 'Start Time': element.startTime,
1682
- 'End Time': element.endTime || '',
1683
- 'Time Spent': element.timeSpent,
1684
- 'Audit Status': element.auditStatus,
1685
- 'Audited Date': dayjs( element.createdAt ).format( 'YYYY,MMM D' ),
1649
+ exportData.push( {
1650
+ 'File Date': element.fileDate,
1651
+ 'Brand ID': element.clientId,
1652
+ 'Brand Name': element.clientName,
1653
+ 'Store ID': element.storeId,
1654
+ 'Store Name': element.storeName,
1655
+ 'Zone Name': element.moduleType == 'zone'? element.zoneName : '',
1656
+ 'Audit Type': element.auditType,
1657
+ 'Product Type': element.moduleType,
1658
+ 'Before Count': element.beforeCount,
1659
+ 'After Count': element.afterCount || '',
1660
+ 'Accuracy': element.accuracy || '',
1661
+ 'Start Time': element.startTime,
1662
+ 'End Time': element.endTime || '',
1663
+ 'Time Spent': element.timeSpent,
1664
+ 'Audit Status': element.auditStatus,
1665
+ 'Audited Date': dayjs( element.createdAt ).format( 'YYYY,MMM D' ),
1686
1666
 
1687
- } );
1688
- }
1667
+ } );
1689
1668
  } );
1690
1669
  return exportData;
1691
1670
  } );
@@ -2936,7 +2915,7 @@ export async function reTrigger( req, res ) {
2936
2915
  await insertOpenSearchData( openSearch.auditLog, logData );
2937
2916
  }
2938
2917
 
2939
- return res.sendSuccess( { result: 'The File has been Re-Trigger Succesfully' } );
2918
+ return res.sendSuccess( { result: 'The File has been Re-Triggered Succesfully' } );
2940
2919
  } catch ( error ) {
2941
2920
  const err = error.message;
2942
2921
  logger.error( { error: error, message: req.body, function: 'reTrigger' } );