tango-app-api-infra 3.0.70-dev → 3.0.71-dev
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/index.js
CHANGED
|
@@ -7,9 +7,8 @@ import { storeInfraRouter } from './src/routes/storeInfra.routes.js';
|
|
|
7
7
|
import { clientInfraRouter } from './src/routes/clientInfra.routes.js';
|
|
8
8
|
import { employeeTrainigRouter } from './src/routes/employeetrainig.routes.js';
|
|
9
9
|
import { dataMismatchTicketRouter } from './src/routes/dataMismatch.routes.js';
|
|
10
|
-
import { infraDocs } from './src/docs/infra.docs.js';
|
|
11
10
|
|
|
12
11
|
|
|
13
|
-
export { infraRouter, internalInfraRouter, userInfraRouter, storeInfraRouter, dataMismatchTicketRouter, clientInfraRouter, employeeTrainigRouter
|
|
12
|
+
export { infraRouter, internalInfraRouter, userInfraRouter, storeInfraRouter, dataMismatchTicketRouter, clientInfraRouter, employeeTrainigRouter };
|
|
14
13
|
|
|
15
14
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tango-app-api-infra",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.71-dev",
|
|
4
4
|
"description": "infra",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"joi-to-swagger": "^6.2.0",
|
|
26
26
|
"mongodb": "^6.4.0",
|
|
27
27
|
"nodemon": "^3.1.0",
|
|
28
|
-
"tango-api-schema": "^2.0.
|
|
29
|
-
"tango-app-api-middleware": "^1.0.
|
|
28
|
+
"tango-api-schema": "^2.0.97",
|
|
29
|
+
"tango-app-api-middleware": "^1.0.64-dev",
|
|
30
30
|
"winston": "^3.12.0",
|
|
31
31
|
"winston-daily-rotate-file": "^5.0.0"
|
|
32
32
|
},
|
|
@@ -8,8 +8,21 @@ export async function createTicket( req, res ) {
|
|
|
8
8
|
if ( ticketExist ) {
|
|
9
9
|
return res.sendSuccess( 'MAT Ticket Already Exists for the store' );
|
|
10
10
|
}
|
|
11
|
+
let actionBy = '';
|
|
12
|
+
if ( req.user.userType == 'tango' ) {
|
|
13
|
+
actionBy = 'Tango';
|
|
14
|
+
} else if ( req.user.userType == 'client' ) {
|
|
15
|
+
actionBy = 'User';
|
|
16
|
+
}
|
|
17
|
+
req.body.ticketActivity = [ {
|
|
18
|
+
actionType: 'Created',
|
|
19
|
+
timeStamp: new Date(),
|
|
20
|
+
actionBy: actionBy,
|
|
21
|
+
IdentifiedBy: req.user.userName,
|
|
22
|
+
} ];
|
|
23
|
+
|
|
11
24
|
req.body.ticketDetails = {};
|
|
12
|
-
req.body.
|
|
25
|
+
req.body.dataMismatch = req.body.dataMismatch;
|
|
13
26
|
req.body.issueDate = new Date( req.body.Date );
|
|
14
27
|
req.body.ticketId = 'TE_DM_' + new Date().valueOf();
|
|
15
28
|
let create = await createTangoTicket( req.body );
|
|
@@ -16,7 +16,6 @@ import mongoose from 'mongoose';
|
|
|
16
16
|
export async function createTicket( req, res ) {
|
|
17
17
|
try {
|
|
18
18
|
req.body.issueDate = new Date( req.body.Date );
|
|
19
|
-
req.body.ticketDetails.filesCount = req.body.filesCount;
|
|
20
19
|
if ( req.body.issueType == 'infra' ) {
|
|
21
20
|
req.body.ticketId = 'TE_INF_' + new Date().valueOf();
|
|
22
21
|
req.body.ticketActivity = [ {
|
|
@@ -1380,3 +1379,32 @@ export async function storeFilter( req, res ) {
|
|
|
1380
1379
|
return res.sendError( error, 500 );
|
|
1381
1380
|
}
|
|
1382
1381
|
}
|
|
1382
|
+
|
|
1383
|
+
export async function updateMat( req, res ) {
|
|
1384
|
+
try {
|
|
1385
|
+
if ( req.body.actionType && req.body.actionType != '' ) {
|
|
1386
|
+
let actionBy = '';
|
|
1387
|
+
if ( req.user.userType == 'tango' ) {
|
|
1388
|
+
actionBy = 'Tango';
|
|
1389
|
+
} else if ( req.user.userType == 'client' ) {
|
|
1390
|
+
actionBy = 'User';
|
|
1391
|
+
}
|
|
1392
|
+
req.body.ticketActivity.push( {
|
|
1393
|
+
actionType: req.body.actionType,
|
|
1394
|
+
actionBy: actionBy,
|
|
1395
|
+
timeStamp: new Date(),
|
|
1396
|
+
IdentifiedBy: actionBy == 'Tango' ? actionBy : req.user.userName,
|
|
1397
|
+
attachments: req.body.attachments,
|
|
1398
|
+
} );
|
|
1399
|
+
updateValue = { ticketActivity: req.body.ticketActivity };
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
let updateTicket = await updateOneTangoTicket( { ticketId: req.body.ticketId }, updateValue );
|
|
1403
|
+
if ( updateTicket ) {
|
|
1404
|
+
res.sendSuccess( 'Ticket Updated Successfully' );
|
|
1405
|
+
}
|
|
1406
|
+
} catch ( error ) {
|
|
1407
|
+
logger.error( { error: error, function: 'updateMat' } );
|
|
1408
|
+
return res.sendError( error, 500 );
|
|
1409
|
+
}
|
|
1410
|
+
}
|
package/src/docs/infra.docs.js
CHANGED
|
@@ -4,7 +4,7 @@ import { isAllowedSessionHandler, authorize, validate } from 'tango-app-api-midd
|
|
|
4
4
|
import { validateDetails, bulkvalidateDetails, validateTicket, bulkvalidateTicket, validateTicketstatus, ticketExists, infraReasonExists, InfrastepstoResolve, InfraAlert } from '../validations/infra.validation.js';
|
|
5
5
|
import { createTicket, bulkcreateTicket, updateStatus, createReason, PrimaryReasons, matTable,
|
|
6
6
|
secondaryReason, updateTicketIssue, viewTicket, AlertTicketReply, uploadAttachments, getInfraIssues,
|
|
7
|
-
updateInstallationTicket, emailUserList, saveInfraEmailConfig, invoice, infraTable, storeFilter, assignTicket, installationTable } from '../controllers/infra.controllers.js';
|
|
7
|
+
updateInstallationTicket, updateMat, emailUserList, saveInfraEmailConfig, invoice, infraTable, storeFilter, assignTicket, installationTable } from '../controllers/infra.controllers.js';
|
|
8
8
|
import { getInfraIssueValid } from '../dtos/infra.dtos.js';
|
|
9
9
|
|
|
10
10
|
|
|
@@ -80,3 +80,7 @@ infraRouter.post( '/get-infra-issues', isAllowedSessionHandler, authorize( {
|
|
|
80
80
|
userType: [ 'client', 'tango' ], access: [
|
|
81
81
|
{ featureName: 'manage', name: 'tickets', permissions: [ 'isView' ] } ],
|
|
82
82
|
} ), validate( getInfraIssueValid ), getInfraIssues );
|
|
83
|
+
infraRouter.post( '/updateMat', isAllowedSessionHandler, authorize( {
|
|
84
|
+
userType: [ 'client', 'tango' ], access: [
|
|
85
|
+
{ featureName: 'manage', name: 'tickets', permissions: [ 'isView' ] } ],
|
|
86
|
+
} ), updateMat );
|