tango-app-api-infra 3.0.24-dev → 3.0.26-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/package.json +2 -2
- package/src/controllers/clientInfra.controller.js +40 -0
- package/src/controllers/infra.controllers.js +6 -1
- package/src/controllers/storeInfra.controlller.js +10 -0
- package/src/controllers/userInfra.controller.js +27 -4
- package/src/routes/clientInfra.routes.js +25 -7
- package/src/routes/infra.routes.js +35 -10
- package/src/routes/storeInfra.routes.js +17 -5
- package/src/routes/userInfra.routes.js +27 -7
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.26-dev",
|
|
4
4
|
"description": "infra",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"mongodb": "^6.4.0",
|
|
24
24
|
"nodemon": "^3.1.0",
|
|
25
25
|
"tango-api-schema": "^2.0.61",
|
|
26
|
-
"tango-app-api-middleware": "^1.0.
|
|
26
|
+
"tango-app-api-middleware": "^1.0.49-dev",
|
|
27
27
|
"winston": "^3.12.0",
|
|
28
28
|
"winston-daily-rotate-file": "^5.0.0"
|
|
29
29
|
},
|
|
@@ -264,6 +264,7 @@ export async function infraIssuesTable( req, res ) {
|
|
|
264
264
|
{
|
|
265
265
|
$project: {
|
|
266
266
|
storeId: '$basicDetails.storeId',
|
|
267
|
+
clientId: '$basicDetails.clientId',
|
|
267
268
|
ticketId: 1,
|
|
268
269
|
storeName: '$basicDetails.storeName',
|
|
269
270
|
status: 1,
|
|
@@ -297,6 +298,7 @@ export async function infraIssuesTable( req, res ) {
|
|
|
297
298
|
{
|
|
298
299
|
$project: {
|
|
299
300
|
storeId: 1,
|
|
301
|
+
clientId: 1,
|
|
300
302
|
storeName: 1,
|
|
301
303
|
createdAt: 1,
|
|
302
304
|
ticketId: 1,
|
|
@@ -311,6 +313,7 @@ export async function infraIssuesTable( req, res ) {
|
|
|
311
313
|
$group: {
|
|
312
314
|
_id: '$ticketId',
|
|
313
315
|
storeId: { $first: '$storeId' },
|
|
316
|
+
clientId: { $first: '$clientId' },
|
|
314
317
|
ticketId: { $first: '$ticketId' },
|
|
315
318
|
storeName: { $first: '$storeName' },
|
|
316
319
|
createdAt: { $first: '$createdAt' },
|
|
@@ -402,8 +405,37 @@ export async function InstallationIssuesTable( req, res ) {
|
|
|
402
405
|
createdAt: 1,
|
|
403
406
|
clientName: '$basicDetails.clientName',
|
|
404
407
|
storeId: '$basicDetails.storeId',
|
|
408
|
+
clientId: '$basicDetails.clientId',
|
|
405
409
|
storeName: '$basicDetails.storeName',
|
|
406
410
|
status: 1,
|
|
411
|
+
primaryIssue: {
|
|
412
|
+
$filter: {
|
|
413
|
+
input: '$ticketActivity',
|
|
414
|
+
as: 'item',
|
|
415
|
+
cond: { $eq: [ '$$item.actionType', 'issueUpdate' ] },
|
|
416
|
+
},
|
|
417
|
+
},
|
|
418
|
+
},
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
$unwind: {
|
|
422
|
+
path: '$primaryIssue', preserveNullAndEmptyArrays: true,
|
|
423
|
+
},
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
$unwind: {
|
|
427
|
+
path: '$primaryIssue.reasons', preserveNullAndEmptyArrays: true,
|
|
428
|
+
},
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
$project: {
|
|
432
|
+
createdAt: 1,
|
|
433
|
+
clientName: 1,
|
|
434
|
+
storeId: 1,
|
|
435
|
+
clientId: 1,
|
|
436
|
+
storeName: 1,
|
|
437
|
+
status: 1,
|
|
438
|
+
primaryIssue: { $ifNull: [ '$primaryIssue.reasons.primaryIssue', '-' ] },
|
|
407
439
|
},
|
|
408
440
|
},
|
|
409
441
|
];
|
|
@@ -419,6 +451,13 @@ export async function InstallationIssuesTable( req, res ) {
|
|
|
419
451
|
},
|
|
420
452
|
} );
|
|
421
453
|
}
|
|
454
|
+
if ( req.body.filterIssue && req.body.filterIssue != '' ) {
|
|
455
|
+
query.push( {
|
|
456
|
+
$match: {
|
|
457
|
+
primaryIssue: req.body.filterIssue,
|
|
458
|
+
},
|
|
459
|
+
} );
|
|
460
|
+
}
|
|
422
461
|
if ( req.body.sortColumName && req.body.sortColumName !== '' && req.body.sortBy ) {
|
|
423
462
|
query.push( {
|
|
424
463
|
$sort: { [req.body.sortColumName]: req.body.sortBy },
|
|
@@ -431,6 +470,7 @@ export async function InstallationIssuesTable( req, res ) {
|
|
|
431
470
|
{ $limit: Number( req.body.limit ) },
|
|
432
471
|
);
|
|
433
472
|
}
|
|
473
|
+
|
|
434
474
|
let storesList = await aggregateTangoTicket( query );
|
|
435
475
|
if ( storesList.length == 0 ) {
|
|
436
476
|
return res.sendError( 'no data', 204 );
|
|
@@ -131,6 +131,9 @@ export async function updateTicketIssue( req, res ) {
|
|
|
131
131
|
if ( req.body.ticketDetails.ticketType === 'refreshticket' ) {
|
|
132
132
|
await updateOneTangoTicket( { ticketId: req.body.ticketId }, { 'ticketDetails.refreshTicketStatus': 'identified' } );
|
|
133
133
|
}
|
|
134
|
+
if ( req.body.issueType === 'installation' ) {
|
|
135
|
+
await updateOneTangoTicket( { ticketId: req.body.ticketId }, { 'ticketDetails.installationStatus': 'installationfailed' } );
|
|
136
|
+
}
|
|
134
137
|
if ( updateTicket ) {
|
|
135
138
|
res.sendSuccess( 'Ticket Updated Successfully' );
|
|
136
139
|
}
|
|
@@ -167,7 +170,7 @@ export async function updateInstallationTicket( req, res ) {
|
|
|
167
170
|
|
|
168
171
|
export async function viewTicket( req, res ) {
|
|
169
172
|
try {
|
|
170
|
-
let ticket = await findOneTangoTicket( { ticketId: req.body.ticketId }, { ticketId: 1, status: 1, ticketDetails: 1, basicDetails: 1, ticketActivity: 1, createdAt: 1, attachments: 1 } );
|
|
173
|
+
let ticket = await findOneTangoTicket( { ticketId: req.body.ticketId }, { ticketId: 1, status: 1, ticketDetails: 1, basicDetails: 1, ticketActivity: 1, createdAt: 1, attachments: 1, cameraList: 1 } );
|
|
171
174
|
if ( ticket.attachments && ticket.attachments.length > 0 ) {
|
|
172
175
|
for ( let index in ticket.attachments ) {
|
|
173
176
|
if ( ticket.attachments.hasOwnProperty( index ) ) {
|
|
@@ -240,6 +243,8 @@ export async function uploadAttachments( req, res ) {
|
|
|
240
243
|
if ( updateTicket ) {
|
|
241
244
|
res.sendSuccess( 'Uploaded successfully' );
|
|
242
245
|
}
|
|
246
|
+
} else {
|
|
247
|
+
|
|
243
248
|
}
|
|
244
249
|
} catch ( error ) {
|
|
245
250
|
logger.error( { error: error, function: 'uploadAttachments' } );
|
|
@@ -11,6 +11,7 @@ export async function storeTicketList( req, res ) {
|
|
|
11
11
|
$match: {
|
|
12
12
|
$and: [
|
|
13
13
|
{ 'basicDetails.storeId': req.body.storeId },
|
|
14
|
+
{ issueType: 'infra' },
|
|
14
15
|
{ createdAt: { $gte: date.start } },
|
|
15
16
|
{ createdAt: { $lte: date.end } },
|
|
16
17
|
],
|
|
@@ -20,6 +21,7 @@ export async function storeTicketList( req, res ) {
|
|
|
20
21
|
$project: {
|
|
21
22
|
storeId: '$basicDetails.storeId',
|
|
22
23
|
status: 1,
|
|
24
|
+
issueDate: '$issueDate',
|
|
23
25
|
Date: { $dateToString: { format: '%d-%m-%Y', date: '$createdAt' } },
|
|
24
26
|
issueClosedDate: 1,
|
|
25
27
|
ticketId: 1,
|
|
@@ -55,6 +57,7 @@ export async function storeTicketList( req, res ) {
|
|
|
55
57
|
issueStatus: 1,
|
|
56
58
|
ticketType: 1,
|
|
57
59
|
comments: 1,
|
|
60
|
+
issueDate: 1,
|
|
58
61
|
primaryIssue: '$primaryIssue.reasons.primaryIssue',
|
|
59
62
|
secondaryIssue: '$primaryIssue.reasons.secondaryIssue',
|
|
60
63
|
},
|
|
@@ -66,6 +69,7 @@ export async function storeTicketList( req, res ) {
|
|
|
66
69
|
Date: { $first: '$Date' },
|
|
67
70
|
issueClosedDate: { $first: '$issueClosedDate' },
|
|
68
71
|
status: { $first: '$status' },
|
|
72
|
+
issueDate: { $first: '$issueDate' },
|
|
69
73
|
ticketId: { $first: '$ticketId' },
|
|
70
74
|
issueStatus: { $first: '$issueStatus' },
|
|
71
75
|
ticketType: { $first: '$ticketType' },
|
|
@@ -74,6 +78,11 @@ export async function storeTicketList( req, res ) {
|
|
|
74
78
|
secondaryIssue: { $last: '$secondaryIssue' },
|
|
75
79
|
},
|
|
76
80
|
},
|
|
81
|
+
{
|
|
82
|
+
$sort: {
|
|
83
|
+
issueDate: -1,
|
|
84
|
+
},
|
|
85
|
+
},
|
|
77
86
|
];
|
|
78
87
|
|
|
79
88
|
if ( req.body.filter && req.body.filter !== '' ) {
|
|
@@ -121,6 +130,7 @@ export async function storeTicketcard( req, res ) {
|
|
|
121
130
|
$and: [
|
|
122
131
|
{ 'basicDetails.storeId': req.body.storeId },
|
|
123
132
|
{ 'ticketDetails.issueStatus': 'identified' },
|
|
133
|
+
{ issueType: 'infra' },
|
|
124
134
|
{ createdAt: { $gte: date.start } },
|
|
125
135
|
{ createdAt: { $lte: date.start } },
|
|
126
136
|
],
|
|
@@ -35,13 +35,13 @@ export async function userTicketList( req, res ) {
|
|
|
35
35
|
let query = [ {
|
|
36
36
|
$match: {
|
|
37
37
|
$and: [
|
|
38
|
-
|
|
38
|
+
|
|
39
39
|
{ issueType: req.body.issueType },
|
|
40
40
|
{ 'ticketDetails.addressingUser': new mongoose.Types.ObjectId( req.body.userId ) },
|
|
41
41
|
],
|
|
42
42
|
},
|
|
43
43
|
} ];
|
|
44
|
-
if ( req.body.status != 'closed' ) {
|
|
44
|
+
if ( req.body.status != 'closed' || req.body.export ) {
|
|
45
45
|
query.push( {
|
|
46
46
|
$match: {
|
|
47
47
|
$and: [
|
|
@@ -57,14 +57,20 @@ export async function userTicketList( req, res ) {
|
|
|
57
57
|
},
|
|
58
58
|
} );
|
|
59
59
|
}
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
if ( req.body.status && req.body.status != '' ) {
|
|
61
|
+
query.push( {
|
|
62
|
+
$match: {
|
|
63
|
+
status: req.body.status,
|
|
64
|
+
},
|
|
65
|
+
} );
|
|
66
|
+
}
|
|
62
67
|
query.push( {
|
|
63
68
|
$project: {
|
|
64
69
|
storeId: '$basicDetails.storeId',
|
|
65
70
|
Date: { $dateToString: { format: '%d-%m-%Y', date: '$issueDate' } },
|
|
66
71
|
ticketId: 1,
|
|
67
72
|
issueType: 1,
|
|
73
|
+
status: 1,
|
|
68
74
|
issueStatus: '$ticketDetails.issueStatus',
|
|
69
75
|
ticketType: '$ticketDetails.ticketType',
|
|
70
76
|
installationStatus: '$ticketDetails.installationStatus',
|
|
@@ -94,6 +100,7 @@ export async function userTicketList( req, res ) {
|
|
|
94
100
|
ticketId: 1,
|
|
95
101
|
issueStatus: 1,
|
|
96
102
|
ticketType: 1,
|
|
103
|
+
status: 1,
|
|
97
104
|
issueType: 1,
|
|
98
105
|
installationStatus: 1,
|
|
99
106
|
infraIssue: '$primaryIssue.reasons.primaryIssue',
|
|
@@ -106,6 +113,7 @@ export async function userTicketList( req, res ) {
|
|
|
106
113
|
Date: { $first: '$Date' },
|
|
107
114
|
ticketId: { $first: '$ticketId' },
|
|
108
115
|
issueType: { $first: '$issueType' },
|
|
116
|
+
status: { $first: '$status' },
|
|
109
117
|
installationStatus: { $first: '$installationStatus' },
|
|
110
118
|
issueStatus: { $first: '$issueStatus' },
|
|
111
119
|
ticketType: { $first: '$ticketType' },
|
|
@@ -143,6 +151,7 @@ export async function userTicketList( req, res ) {
|
|
|
143
151
|
'TICKET ID': element.ticketId,
|
|
144
152
|
'STORE ID': element.storeId,
|
|
145
153
|
'ISSUE': element.issueStatus,
|
|
154
|
+
'STATUS': element.status,
|
|
146
155
|
} );
|
|
147
156
|
} );
|
|
148
157
|
await download( exportdata, res );
|
|
@@ -521,6 +530,20 @@ export async function storeInfraList( req, res ) {
|
|
|
521
530
|
if ( installationcheck ) {
|
|
522
531
|
store.ticketId = installationcheck.ticketId;
|
|
523
532
|
store.status = installationcheck.ticketDetails.installationStatus;
|
|
533
|
+
if ( store.status === 'onboareded' ) {
|
|
534
|
+
store.statusDetail = 'Ready to pair';
|
|
535
|
+
}
|
|
536
|
+
if ( store.status === 'paired' ) {
|
|
537
|
+
store.statusDetail = 'Processing';
|
|
538
|
+
}
|
|
539
|
+
if ( store.status === 'installationfailed' ) {
|
|
540
|
+
if ( installationcheck.ticketActivity.length > 0 ) {
|
|
541
|
+
let issue = installationcheck.ticketActivity.filter( ( a ) => a.actionType === 'issueUpdate' );
|
|
542
|
+
if ( issue.length > 0 && issue[0].reasons.length > 0 ) {
|
|
543
|
+
store.statusDetail = issue[0].reasons[0].primaryIssue;
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
}
|
|
524
547
|
} else {
|
|
525
548
|
let infracheck = await findOneTangoTicket( { 'basicDetails.storeId': store.storeId, 'issueType': 'infra', 'issueDate': new Date( dayjs().format( 'YYYY-MM-DD' ) ), 'status': { $ne: 'closed' } } );
|
|
526
549
|
if ( infracheck ) {
|
|
@@ -1,16 +1,34 @@
|
|
|
1
1
|
|
|
2
2
|
import express from 'express';
|
|
3
|
-
import { isAllowedSessionHandler } from 'tango-app-api-middleware';
|
|
3
|
+
import { isAllowedSessionHandler, authorize } from 'tango-app-api-middleware';
|
|
4
4
|
import { infraCard, installationCard, InstallationIssuesTable, infraIssuesTable, hourWiseDownClients, hourWiseDownstores } from '../controllers/clientInfra.controller.js';
|
|
5
5
|
|
|
6
6
|
export const clientInfraRouter = express.Router();
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
clientInfraRouter.post( '/infraCard', isAllowedSessionHandler,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
clientInfraRouter.post( '/
|
|
14
|
-
|
|
9
|
+
clientInfraRouter.post( '/infraCard', isAllowedSessionHandler, authorize( {
|
|
10
|
+
userType: [ 'client' ], access: [
|
|
11
|
+
{ featureName: 'manage', name: 'tickets', permissions: [ 'isView' ] } ],
|
|
12
|
+
} ), infraCard );
|
|
13
|
+
clientInfraRouter.post( '/infraIssuesTable', isAllowedSessionHandler, authorize( {
|
|
14
|
+
userType: [ 'client' ], access: [
|
|
15
|
+
{ featureName: 'manage', name: 'tickets', permissions: [ 'isView' ] } ],
|
|
16
|
+
} ), infraIssuesTable );
|
|
17
|
+
clientInfraRouter.post( '/installationCard', isAllowedSessionHandler, authorize( {
|
|
18
|
+
userType: [ 'client' ], access: [
|
|
19
|
+
{ featureName: 'manage', name: 'tickets', permissions: [ 'isView' ] } ],
|
|
20
|
+
} ), installationCard );
|
|
21
|
+
clientInfraRouter.post( '/InstallationIssuesTable', isAllowedSessionHandler, authorize( {
|
|
22
|
+
userType: [ 'client' ], access: [
|
|
23
|
+
{ featureName: 'manage', name: 'tickets', permissions: [ 'isView' ] } ],
|
|
24
|
+
} ), InstallationIssuesTable );
|
|
25
|
+
clientInfraRouter.post( '/hourWiseDownClients', isAllowedSessionHandler, authorize( {
|
|
26
|
+
userType: [ 'client' ], access: [
|
|
27
|
+
{ featureName: 'manage', name: 'tickets', permissions: [ 'isView' ] } ],
|
|
28
|
+
} ), hourWiseDownClients );
|
|
29
|
+
clientInfraRouter.post( '/hourWiseDownstores', isAllowedSessionHandler, authorize( {
|
|
30
|
+
userType: [ 'client' ], access: [
|
|
31
|
+
{ featureName: 'manage', name: 'tickets', permissions: [ 'isView' ] } ],
|
|
32
|
+
} ), hourWiseDownstores );
|
|
15
33
|
|
|
16
34
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import express from 'express';
|
|
3
|
-
import { isAllowedSessionHandler } from 'tango-app-api-middleware';
|
|
3
|
+
import { isAllowedSessionHandler, authorize } from 'tango-app-api-middleware';
|
|
4
4
|
import { validateDetails, bulkvalidateDetails, validateTicket, bulkvalidateTicket, ticketExists, infraReasonExists, InfrastepstoResolve, InfraAlert } from '../validations/infra.validation.js';
|
|
5
5
|
import { createTicket, bulkcreateTicket, updateStatus, createReason, PrimaryReasons, secondaryReason, updateTicketIssue, viewTicket, AlertTicketReply, uploadAttachments, updateInstallationTicket } from '../controllers/infra.controllers.js';
|
|
6
6
|
|
|
@@ -9,15 +9,40 @@ export const infraRouter = express.Router();
|
|
|
9
9
|
|
|
10
10
|
infraRouter.post( '/createTicket', validateDetails, validateTicket, createTicket );
|
|
11
11
|
infraRouter.post( '/bulkcreateTicket', bulkvalidateDetails, bulkvalidateTicket, bulkcreateTicket );
|
|
12
|
-
|
|
13
|
-
infraRouter.post( '/updateStatus', isAllowedSessionHandler, ticketExists, updateStatus );
|
|
14
12
|
infraRouter.post( '/createReason', createReason );
|
|
15
|
-
infraRouter.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
infraRouter.
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
infraRouter.post( '/updateStatus', isAllowedSessionHandler, authorize( {
|
|
14
|
+
userType: [ 'client', 'tango' ], access: [
|
|
15
|
+
{ featureName: 'manage', name: 'tickets', permissions: [ 'isEdit' ] } ],
|
|
16
|
+
} ), ticketExists, updateStatus );
|
|
17
|
+
infraRouter.get( '/PrimaryReasons', isAllowedSessionHandler, authorize( {
|
|
18
|
+
userType: [ 'client', 'tango' ], access: [
|
|
19
|
+
{ featureName: 'manage', name: 'tickets', permissions: [ 'isEdit' ] } ],
|
|
20
|
+
} ), PrimaryReasons );
|
|
21
|
+
infraRouter.post( '/secondaryReason', isAllowedSessionHandler, authorize( {
|
|
22
|
+
userType: [ 'client', 'tango' ], access: [
|
|
23
|
+
{ featureName: 'manage', name: 'tickets', permissions: [ 'isEdit' ] },
|
|
24
|
+
{ featureName: 'manage', name: 'stores', permissions: [ 'isEdit' ] },
|
|
25
|
+
],
|
|
26
|
+
} ), secondaryReason );
|
|
27
|
+
infraRouter.post( '/updateTicketIssue', isAllowedSessionHandler, authorize( {
|
|
28
|
+
userType: [ 'client', 'tango' ], access: [
|
|
29
|
+
{ featureName: 'manage', name: 'tickets', permissions: [ 'isEdit' ] } ],
|
|
30
|
+
} ), ticketExists, infraReasonExists, InfrastepstoResolve, InfraAlert, updateTicketIssue );
|
|
31
|
+
infraRouter.post( '/viewTicket', isAllowedSessionHandler, authorize( {
|
|
32
|
+
userType: [ 'client', 'tango' ], access: [
|
|
33
|
+
{ featureName: 'manage', name: 'tickets', permissions: [ 'isView' ] } ],
|
|
34
|
+
} ), ticketExists, viewTicket );
|
|
35
|
+
infraRouter.post( '/AlertTicketReply', isAllowedSessionHandler, authorize( {
|
|
36
|
+
userType: [ 'client', 'tango' ], access: [
|
|
37
|
+
{ featureName: 'manage', name: 'tickets', permissions: [ 'isEdit', 'isView' ] } ],
|
|
38
|
+
} ), ticketExists, AlertTicketReply );
|
|
39
|
+
infraRouter.put( '/uploadAttachments/:ticketId', isAllowedSessionHandler, authorize( {
|
|
40
|
+
userType: [ 'client', 'tango' ], access: [
|
|
41
|
+
{ featureName: 'manage', name: 'tickets', permissions: [ 'isEdit', 'isView' ] } ],
|
|
42
|
+
} ), ticketExists, uploadAttachments );
|
|
43
|
+
infraRouter.post( '/updateInstallationTicket', isAllowedSessionHandler, authorize( {
|
|
44
|
+
userType: [ 'client', 'tango' ], access: [
|
|
45
|
+
{ featureName: 'manage', name: 'tickets', permissions: [ 'isEdit', 'isView' ] } ],
|
|
46
|
+
} ), ticketExists, updateInstallationTicket );
|
|
22
47
|
|
|
23
48
|
|
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
|
|
2
2
|
import express from 'express';
|
|
3
|
-
import { isAllowedSessionHandler } from 'tango-app-api-middleware';
|
|
3
|
+
import { isAllowedSessionHandler, authorize } from 'tango-app-api-middleware';
|
|
4
4
|
import { storeTicketList, storeTicketcard, edgeAppLogTable, viewedgeAppLog } from '../controllers/storeInfra.controlller.js';
|
|
5
5
|
export const storeInfraRouter = express.Router();
|
|
6
6
|
|
|
7
|
-
storeInfraRouter.post( '/storeTicketList', isAllowedSessionHandler,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
storeInfraRouter.post( '/storeTicketList', isAllowedSessionHandler, authorize( {
|
|
8
|
+
userType: [ 'client', 'tango' ], access: [
|
|
9
|
+
{ featureName: 'manage', name: 'tickets', permissions: [ 'isView' ] } ],
|
|
10
|
+
} ), storeTicketList );
|
|
11
|
+
storeInfraRouter.post( '/storeTicketcard', isAllowedSessionHandler, authorize( {
|
|
12
|
+
userType: [ 'client', 'tango' ], access: [
|
|
13
|
+
{ featureName: 'manage', name: 'tickets', permissions: [ 'isView' ] } ],
|
|
14
|
+
} ), storeTicketcard );
|
|
15
|
+
storeInfraRouter.post( '/edgeAppLogTable', isAllowedSessionHandler, authorize( {
|
|
16
|
+
userType: [ 'client', 'tango' ], access: [
|
|
17
|
+
{ featureName: 'manage', name: 'tickets', permissions: [ 'isView' ] } ],
|
|
18
|
+
} ), edgeAppLogTable );
|
|
19
|
+
storeInfraRouter.post( '/viewedgeAppLog', isAllowedSessionHandler, authorize( {
|
|
20
|
+
userType: [ 'client', 'tango' ], access: [
|
|
21
|
+
{ featureName: 'manage', name: 'tickets', permissions: [ 'isView' ] } ],
|
|
22
|
+
} ), viewedgeAppLog );
|
|
11
23
|
|
|
12
24
|
|
|
@@ -1,15 +1,35 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
|
-
import { isAllowedSessionHandler } from 'tango-app-api-middleware';
|
|
2
|
+
import { isAllowedSessionHandler, authorize } from 'tango-app-api-middleware';
|
|
3
3
|
import { userTakeTicket, userTicketList, activeTicketList, basicDetails, workHistory, storeInfraList } from '../controllers/userInfra.controller.js';
|
|
4
4
|
|
|
5
5
|
export const userInfraRouter = express.Router();
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
userInfraRouter.post( '/userTakeTicket', isAllowedSessionHandler,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
userInfraRouter.post( '/
|
|
13
|
-
|
|
8
|
+
userInfraRouter.post( '/userTakeTicket', isAllowedSessionHandler, authorize( {
|
|
9
|
+
userType: [ 'tango' ], access: [
|
|
10
|
+
{ featureName: 'manage', name: 'tickets', permissions: [ 'isEdit', 'isView' ] } ],
|
|
11
|
+
} ), userTakeTicket );
|
|
12
|
+
userInfraRouter.post( '/userTicketList', isAllowedSessionHandler, authorize( {
|
|
13
|
+
userType: [ 'tango' ], access: [
|
|
14
|
+
{ featureName: 'manage', name: 'tickets', permissions: [ 'isView' ] } ],
|
|
15
|
+
} ), userTicketList );
|
|
16
|
+
userInfraRouter.post( '/activeTicketList', isAllowedSessionHandler, authorize( {
|
|
17
|
+
userType: [ 'tango' ], access: [
|
|
18
|
+
{ featureName: 'manage', name: 'tickets', permissions: [ 'isView' ] } ],
|
|
19
|
+
} ), activeTicketList );
|
|
20
|
+
userInfraRouter.post( '/basicDetails', isAllowedSessionHandler, authorize( {
|
|
21
|
+
userType: [ 'tango' ], access: [
|
|
22
|
+
{ featureName: 'manage', name: 'tickets', permissions: [ 'isView' ] } ],
|
|
23
|
+
} ), basicDetails );
|
|
24
|
+
userInfraRouter.post( '/workHistory', isAllowedSessionHandler, authorize( {
|
|
25
|
+
userType: [ 'tango' ], access: [
|
|
26
|
+
{ featureName: 'manage', name: 'tickets', permissions: [ 'isView' ] } ],
|
|
27
|
+
} ), workHistory );
|
|
28
|
+
userInfraRouter.post( '/storeInfraList', isAllowedSessionHandler, authorize( {
|
|
29
|
+
userType: [ 'tango' ], access: [
|
|
30
|
+
{ featureName: 'manage', name: 'tickets', permissions: [ 'isView' ] },
|
|
31
|
+
{ featureName: 'manage', name: 'stores', permissions: [ 'isView' ] },
|
|
32
|
+
],
|
|
33
|
+
} ), storeInfraList );
|
|
14
34
|
|
|
15
35
|
|