tango-app-api-infra 3.0.79-dev → 3.0.80-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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tango-app-api-infra",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.80-dev",
|
|
4
4
|
"description": "infra",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"mongodb": "^6.4.0",
|
|
27
27
|
"nodemon": "^3.1.0",
|
|
28
28
|
"swagger-ui-express": "^5.0.0",
|
|
29
|
-
"tango-api-schema": "^2.0.
|
|
30
|
-
"tango-app-api-middleware": "^1.0.
|
|
29
|
+
"tango-api-schema": "^2.0.101",
|
|
30
|
+
"tango-app-api-middleware": "^1.0.68-dev",
|
|
31
31
|
"winston": "^3.12.0",
|
|
32
32
|
"winston-daily-rotate-file": "^5.0.0"
|
|
33
33
|
},
|
|
@@ -48,16 +48,3 @@ export async function activityLog( req, res ) {
|
|
|
48
48
|
return res.sendError( error, 500 );
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
export async function updateMatStatus( req, res ) {
|
|
54
|
-
try {
|
|
55
|
-
let update = await updateOneTangoTicket( { ticketId: req.body.ticketId }, { 'ticketDetails.matStatus': req.body.matStatus } );
|
|
56
|
-
if ( update ) {
|
|
57
|
-
res.sendSuccess( 'Updated Successfully' );
|
|
58
|
-
}
|
|
59
|
-
} catch ( error ) {
|
|
60
|
-
logger.error( { error: error, function: 'updateMatStatus' } );
|
|
61
|
-
return res.sendError( error, 500 );
|
|
62
|
-
}
|
|
63
|
-
}
|
|
@@ -1444,14 +1444,14 @@ export async function matTable( req, res ) {
|
|
|
1444
1444
|
result.forEach( ( element ) => {
|
|
1445
1445
|
exportdata.push( {
|
|
1446
1446
|
'ticketId': element.ticketId,
|
|
1447
|
-
'
|
|
1447
|
+
'issueDate': dayjs( element.issueDate ).format( 'DD-MM-YYYY' ),
|
|
1448
1448
|
'storeId': element.storeId,
|
|
1449
1449
|
'storeName': element.storeName,
|
|
1450
1450
|
'clientId': element.clientId,
|
|
1451
1451
|
'clientName': element.clientName,
|
|
1452
1452
|
'userName': element.userName,
|
|
1453
1453
|
'userEmail': element.userEmail,
|
|
1454
|
-
'Status': element.
|
|
1454
|
+
'Status': element.installationStatus,
|
|
1455
1455
|
} );
|
|
1456
1456
|
} );
|
|
1457
1457
|
await download( exportdata, res );
|
|
@@ -165,7 +165,6 @@ export async function userTicketList( req, res ) {
|
|
|
165
165
|
issueStatus: '$ticketDetails.issueStatus',
|
|
166
166
|
ticketType: '$ticketDetails.ticketType',
|
|
167
167
|
installationStatus: '$ticketDetails.installationStatus',
|
|
168
|
-
matStatus: '$ticketDetails.matStatus',
|
|
169
168
|
primaryIssue: {
|
|
170
169
|
$filter: {
|
|
171
170
|
input: '$ticketActivity',
|
|
@@ -197,7 +196,6 @@ export async function userTicketList( req, res ) {
|
|
|
197
196
|
status: 1,
|
|
198
197
|
issueType: 1,
|
|
199
198
|
installationStatus: 1,
|
|
200
|
-
matStatus: 1,
|
|
201
199
|
infraIssue: '$primaryIssue.reasons.primaryIssue',
|
|
202
200
|
},
|
|
203
201
|
},
|
|
@@ -212,7 +210,6 @@ export async function userTicketList( req, res ) {
|
|
|
212
210
|
issueType: { $first: '$issueType' },
|
|
213
211
|
status: { $first: '$status' },
|
|
214
212
|
installationStatus: { $first: '$installationStatus' },
|
|
215
|
-
matStatus: { $first: '$matStatus' },
|
|
216
213
|
issueStatus: { $first: '$issueStatus' },
|
|
217
214
|
ticketType: { $first: '$ticketType' },
|
|
218
215
|
infraIssue: { $last: '$infraIssue' },
|
|
@@ -237,7 +234,6 @@ export async function userTicketList( req, res ) {
|
|
|
237
234
|
$or: [
|
|
238
235
|
{ issueStatus: req.body.filter },
|
|
239
236
|
{ infraIssue: req.body.filter },
|
|
240
|
-
{ issueType: req.body.filter },
|
|
241
237
|
],
|
|
242
238
|
},
|
|
243
239
|
} );
|
|
@@ -246,23 +242,13 @@ export async function userTicketList( req, res ) {
|
|
|
246
242
|
if ( req.body.export ) {
|
|
247
243
|
const exportdata = [];
|
|
248
244
|
ticketList.forEach( ( element ) => {
|
|
249
|
-
|
|
245
|
+
exportdata.push( {
|
|
250
246
|
'DATE': element.Date,
|
|
251
247
|
'TICKET ID': element.ticketId,
|
|
252
248
|
'STORE ID': element.storeId,
|
|
253
|
-
'
|
|
249
|
+
'ISSUE': element.issueStatus,
|
|
254
250
|
'STATUS': element.status,
|
|
255
|
-
};
|
|
256
|
-
if ( req.body.issueType ==='infra' ) {
|
|
257
|
-
data = { ...data, ...{ 'ISSUE': element.issueStatus } };
|
|
258
|
-
}
|
|
259
|
-
if ( req.body.issueType ==='installation' ) {
|
|
260
|
-
data = { ...data, ...{ 'ISSUE': element.issueStatus } };
|
|
261
|
-
}
|
|
262
|
-
if ( req.body.issueType ==='dataMismatch' ) {
|
|
263
|
-
data = { ...data, ...{ 'ISSUE TYPE': element.issueType } };
|
|
264
|
-
}
|
|
265
|
-
exportdata.push( data );
|
|
251
|
+
} );
|
|
266
252
|
} );
|
|
267
253
|
await download( exportdata, res );
|
|
268
254
|
return;
|
|
@@ -391,18 +377,6 @@ export async function workHistory( req, res ) {
|
|
|
391
377
|
{ 'issueClosedDate': { $lte: date.end } },
|
|
392
378
|
],
|
|
393
379
|
|
|
394
|
-
},
|
|
395
|
-
},
|
|
396
|
-
);
|
|
397
|
-
} else if ( req.body.dateFilter === 'issueDate' ) {
|
|
398
|
-
query.push(
|
|
399
|
-
{
|
|
400
|
-
$match: {
|
|
401
|
-
$and: [
|
|
402
|
-
{ 'issueDate': { $gte: date.start } },
|
|
403
|
-
{ 'issueDate': { $lte: date.end } },
|
|
404
|
-
],
|
|
405
|
-
|
|
406
380
|
},
|
|
407
381
|
},
|
|
408
382
|
);
|
|
@@ -437,7 +411,6 @@ export async function workHistory( req, res ) {
|
|
|
437
411
|
storeName: '$basicDetails.storeName',
|
|
438
412
|
clientId: '$basicDetails.clientId',
|
|
439
413
|
clientName: '$basicDetails.clientName',
|
|
440
|
-
issueType: 1,
|
|
441
414
|
issueDate: { $dateToString: { format: '%Y-%m-%d', date: '$createdAt' } },
|
|
442
415
|
issueClosedDate: { $dateToString: { format: '%Y-%m-%d', date: '$issueClosedDate' } },
|
|
443
416
|
issueIdentifiedDate: { $dateToString: { format: '%Y-%m-%d', date: '$ticketDetails.issueIdentifiedDate' } },
|
|
@@ -467,7 +440,6 @@ export async function workHistory( req, res ) {
|
|
|
467
440
|
$project: {
|
|
468
441
|
storeId: 1,
|
|
469
442
|
storeName: 1,
|
|
470
|
-
issueType: 1,
|
|
471
443
|
clientId: 1,
|
|
472
444
|
clientName: 1,
|
|
473
445
|
issueDate: 1,
|
|
@@ -480,20 +452,13 @@ export async function workHistory( req, res ) {
|
|
|
480
452
|
infraIssue: { $ifNull: [ '$primaryIssue.reasons.primaryIssue', '' ] },
|
|
481
453
|
},
|
|
482
454
|
} );
|
|
483
|
-
if ( req.body.issueFilter && req.body.issueFilter.length>0
|
|
455
|
+
if ( req.body.issueFilter && req.body.issueFilter.length>0 ) {
|
|
484
456
|
query.push( {
|
|
485
457
|
$match: {
|
|
486
458
|
infraIssue: { $in: req.body.issueFilter },
|
|
487
459
|
},
|
|
488
460
|
} );
|
|
489
461
|
}
|
|
490
|
-
if ( req.body.issueFilter && req.body.issueFilter.length>0&&req.body.issueType==='dataMismatch' ) {
|
|
491
|
-
query.push( {
|
|
492
|
-
$match: {
|
|
493
|
-
issueType: { $in: req.body.issueFilter },
|
|
494
|
-
},
|
|
495
|
-
} );
|
|
496
|
-
}
|
|
497
462
|
if ( req.body.searchValue && req.body.searchValue !== '' ) {
|
|
498
463
|
query.push( {
|
|
499
464
|
$match: {
|
|
@@ -524,24 +489,19 @@ export async function workHistory( req, res ) {
|
|
|
524
489
|
if ( req.body.export ) {
|
|
525
490
|
const exportdata = [];
|
|
526
491
|
result.forEach( ( element ) => {
|
|
527
|
-
|
|
492
|
+
exportdata.push( {
|
|
528
493
|
'CREATED ON': dayjs( element.issueDate ).format( 'DD-MM-YYYY' ),
|
|
529
494
|
'TICKET ID': element.ticketId,
|
|
530
495
|
'STORE ID': element.storeId,
|
|
531
496
|
'STORE NAME': element.storeName,
|
|
532
497
|
'CLIENT ID': element.clientId,
|
|
533
498
|
'CLIENT NAME': element.clientName,
|
|
499
|
+
'ISSUE IDENTIFIED DATE': element.issueIdentifiedDate,
|
|
534
500
|
'CLOSED ON': element.issueClosedDate,
|
|
501
|
+
'ISSUE': element.infraIssue?element.infraIssue:'-',
|
|
535
502
|
'STATUS': element.status,
|
|
536
|
-
};
|
|
537
|
-
exportdata.push( data );
|
|
503
|
+
} );
|
|
538
504
|
} );
|
|
539
|
-
if ( req.body.issueType==='infra'||req.body.issueType==='installation' ) {
|
|
540
|
-
data = { ...data, ...{ 'ISSUE': element.infraIssue?element.infraIssue:'-', 'ISSUE IDENTIFIED DATE': element.issueIdentifiedDate } };
|
|
541
|
-
}
|
|
542
|
-
if ( req.body.issueType==='dataMismatch' ) {
|
|
543
|
-
data = { ...data, ...{ 'issueType': element.issueType?element.issueType:'-' } };
|
|
544
|
-
}
|
|
545
505
|
await download( exportdata, res );
|
|
546
506
|
return;
|
|
547
507
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createTicket, updatecomment, activityLog
|
|
1
|
+
import { createTicket, updatecomment, activityLog } from '../controllers/employeeTraning.controller.js';
|
|
2
2
|
import { ticketExists, validateDetails } from '../validations/infra.validation.js';
|
|
3
3
|
import express from 'express';
|
|
4
4
|
import { isAllowedSessionHandler, authorize } from 'tango-app-api-middleware';
|
|
@@ -15,7 +15,3 @@ employeeTrainigRouter.post( '/activityLog', isAllowedSessionHandler, authorize(
|
|
|
15
15
|
userType: [ 'tango' ], access: [
|
|
16
16
|
{ featureName: 'manage', name: 'tickets', permissions: [ 'isView' ] } ],
|
|
17
17
|
} ), ticketExists, activityLog );
|
|
18
|
-
employeeTrainigRouter.post( '/updateMatStatus', isAllowedSessionHandler, authorize( {
|
|
19
|
-
userType: [ 'tango' ], access: [
|
|
20
|
-
{ featureName: 'manage', name: 'tickets', permissions: [ 'isView' ] } ],
|
|
21
|
-
} ), ticketExists, updateMatStatus );
|
|
@@ -186,7 +186,7 @@ export async function ticketExists( req, res, next ) {
|
|
|
186
186
|
req.body.ticketActivity = Ticket.ticketActivity;
|
|
187
187
|
req.body.status = Ticket.status;
|
|
188
188
|
req.body.issueDate = Ticket.issueDate;
|
|
189
|
-
|
|
189
|
+
|
|
190
190
|
|
|
191
191
|
next();
|
|
192
192
|
} catch ( error ) {
|