tango-app-api-audit 3.4.27 → 3.4.29
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,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tango-app-api-audit",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.29",
|
|
4
4
|
"description": "audit & audit metrics apis",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"start": "nodemon --exec \"eslint --fix . && node
|
|
8
|
+
"start": "nodemon --exec \"eslint --fix . && node index.js\""
|
|
9
9
|
},
|
|
10
10
|
"engines": {
|
|
11
11
|
"node": ">=18.10.0"
|
|
@@ -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',
|
|
@@ -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 =
|
|
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;
|
package/app.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import express from 'express';
|
|
2
|
-
import { auditRouter } from './index.js';
|
|
3
|
-
import dotenv from 'dotenv';
|
|
4
|
-
import { logger } from 'tango-app-api-middleware';
|
|
5
|
-
import { connectdb } from './config/database/database.js';
|
|
6
|
-
import responseMiddleware from './config/response/response.js';
|
|
7
|
-
import errorMiddleware from './config/response/error.js';
|
|
8
|
-
import pkg from 'body-parser';
|
|
9
|
-
import { swaggerConfig } from './config/swagger/swagger.js';
|
|
10
|
-
import swagger from 'swagger-ui-express';
|
|
11
|
-
import { traxAuditRouter } from './src/routes/traxAudit.routes.js';
|
|
12
|
-
import { auditWalletRouter } from './src/routes/auditWallet.routes.js';
|
|
13
|
-
// import externalParameterModel from 'tango-api-schema/schema/externalParameter.model.js';
|
|
14
|
-
|
|
15
|
-
const { json, urlencoded } = pkg;
|
|
16
|
-
const env=dotenv.config();
|
|
17
|
-
|
|
18
|
-
const app = express();
|
|
19
|
-
const PORT = process.env.PORT || 3000;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
app.use( json( { limit: '500mb' } ) );
|
|
23
|
-
app.use(
|
|
24
|
-
urlencoded( {
|
|
25
|
-
extended: true,
|
|
26
|
-
} ),
|
|
27
|
-
);
|
|
28
|
-
app.use( responseMiddleware );
|
|
29
|
-
app.use( errorMiddleware );
|
|
30
|
-
if ( env.error ) {
|
|
31
|
-
logger.error( '.env not found' );
|
|
32
|
-
process.exit( 1 );
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
app.use( '/api-docs', swagger.serve, swagger.setup( swaggerConfig ) );
|
|
37
|
-
app.use( '/v3/audit', auditRouter );
|
|
38
|
-
app.use( '/v3/trax-audit', traxAuditRouter );
|
|
39
|
-
app.use( '/v3/audit-wallet', auditWalletRouter );
|
|
40
|
-
|
|
41
|
-
app.listen( PORT, async () => {
|
|
42
|
-
connectdb();
|
|
43
|
-
logger.info( `server is running on port= ${PORT} ` );
|
|
44
|
-
} );
|
|
45
|
-
|