tango-app-api-audit 3.4.28 → 3.4.30

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.28",
3
+ "version": "3.4.30",
4
4
  "description": "audit & audit metrics apis",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -334,15 +334,6 @@ export async function auditWalletSummary( req, res ) {
334
334
  $match: {
335
335
  $or: [
336
336
  { 'fileDate': { $regex: inputData.searchValue, $options: 'i' } },
337
- { 'tolFilesCount': { $regex: inputData.searchValue, $options: 'i' } },
338
- { 'totalBeforeCount': { $regex: inputData.searchValue, $options: 'i' } },
339
- { 'totalAfterCount': { $regex: inputData.searchValue, $options: 'i' } },
340
- { 'totalEarn': { $regex: inputData.searchValue, $options: 'i' } },
341
- { 'deductionByMinimumTarget': { $regex: inputData.searchValue, $options: 'i' } },
342
- { 'deductionByMapping': { $regex: inputData.searchValue, $options: 'i' } },
343
- { 'deductionByLateLogin': { $regex: inputData.searchValue, $options: 'i' } },
344
- { 'totalReducedAmount': { $regex: inputData.searchValue, $options: 'i' } },
345
- { 'totalCredit': { $regex: inputData.searchValue, $options: 'i' } },
346
337
  ],
347
338
  },
348
339
  } );
@@ -379,6 +370,7 @@ export async function auditWalletSummary( req, res ) {
379
370
  query.push( {
380
371
  $project: {
381
372
  '_id': 0,
373
+ 'userEmail': 1,
382
374
  'fileDate': '$fileDate',
383
375
  'totalFilesCount': '$totalFilesCount',
384
376
  'totalBeforeCount': '$totalBeforeCount',
@@ -404,7 +396,7 @@ export async function auditWalletSummary( req, res ) {
404
396
 
405
397
 
406
398
  if ( inputData.isExport ) {
407
- await download( count, res );
399
+ await download( ...count, res );
408
400
  return;
409
401
  }
410
402
 
@@ -10,7 +10,7 @@ export const auditWalletRouter = Router();
10
10
  auditWalletRouter.get( '/audit-user-summary', isAllowedSessionHandler, accessVerification( { userType: [ 'tango' ] } ), roleVerification, validate( auditUserSummaryValid ), dateValidation, auditUserSummary );
11
11
 
12
12
  // single user view
13
- auditWalletRouter.get( '/get-audit-user-details', isAllowedSessionHandler, accessVerification( { userType: [ 'tango' ] } ), validate( auditUserDetailsValid ), getAuditUserDetails );
13
+ auditWalletRouter.get( '/get-audit-user-details', isAllowedSessionHandler, accessVerification( { userType: [ 'tango' ] } ), roleVerification, validate( auditUserDetailsValid ), getAuditUserDetails );
14
14
  auditWalletRouter.get( '/consolidated-card', isAllowedSessionHandler, accessVerification( { userType: [ 'tango' ] } ), ValidateConsolidatedCard, validate( consolidatedCardSAValid ), consolidatedCard );
15
15
  auditWalletRouter.get( '/audit-wallet-summary', isAllowedSessionHandler, accessVerification( { userType: [ 'tango' ] } ), ValidateWalletSummary, validate( auditWalletSummaryValid ), auditWalletSummary );
16
16
 
@@ -23,7 +23,8 @@ export async function ValidateConsolidatedCard( req, res, next ) {
23
23
  return next();
24
24
  } else {
25
25
  const yesterday = dayjs( new Date() ).subtract( 1, 'days' );
26
- const yesterdayFT = new Date( dayjs( yesterday ).format( 'YYYY-MM-DD' ) );
26
+ const yesterdayFT = dayjs( yesterday ).format( 'YYYY-MM-DD' );
27
+ logger.info( { yesterdayFT: yesterdayFT } );
27
28
  req.query.userEmail = req.user.email;
28
29
  req.query.fromDate = yesterdayFT;
29
30
  req.query.toDate = yesterdayFT;