tango-app-api-infra 3.0.76-dev → 3.0.78-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.78-dev",
|
|
4
4
|
"description": "infra",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -25,9 +25,9 @@
|
|
|
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.100",
|
|
29
28
|
"swagger-ui-express": "^5.0.0",
|
|
30
|
-
"tango-
|
|
29
|
+
"tango-api-schema": "^2.0.101",
|
|
30
|
+
"tango-app-api-middleware": "^1.0.70-test",
|
|
31
31
|
"winston": "^3.12.0",
|
|
32
32
|
"winston-daily-rotate-file": "^5.0.0"
|
|
33
33
|
},
|
|
@@ -777,9 +777,41 @@ export async function getInfraIssues( req, res ) {
|
|
|
777
777
|
},
|
|
778
778
|
},
|
|
779
779
|
];
|
|
780
|
+
|
|
781
|
+
const highCountQuery =[
|
|
782
|
+
{
|
|
783
|
+
$match: {
|
|
784
|
+
$and: [
|
|
785
|
+
{ 'basicDetails.storeId': inputData.storeId },
|
|
786
|
+
{ issueType: { $in: [ 'highcount', 'lowcount' ] } },
|
|
787
|
+
|
|
788
|
+
],
|
|
789
|
+
},
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
$group: {
|
|
793
|
+
_id: null,
|
|
794
|
+
total: { $sum: 1 },
|
|
795
|
+
successRate: { $avg: '$successPercentage' },
|
|
796
|
+
},
|
|
797
|
+
},
|
|
798
|
+
{
|
|
799
|
+
$project: {
|
|
800
|
+
_id: 0,
|
|
801
|
+
total: 1,
|
|
802
|
+
successRate: 1,
|
|
803
|
+
},
|
|
804
|
+
},
|
|
805
|
+
];
|
|
806
|
+
const defaultValue= {
|
|
807
|
+
total: 0,
|
|
808
|
+
successRate: 0,
|
|
809
|
+
};
|
|
810
|
+
const getHighCountTicket = await aggregateTangoTicket( highCountQuery );
|
|
811
|
+
logger.info( { getHighCountTicket: getHighCountTicket } );
|
|
780
812
|
const camera = await aggregateCamera( camQuery );
|
|
781
813
|
logger.info( { message: camera } );
|
|
782
|
-
return res.sendSuccess( { result: mergeValue, streams: camera } );
|
|
814
|
+
return res.sendSuccess( { result: mergeValue, streams: camera, highCountTicketDetails: getHighCountTicket[0] || defaultValue } );
|
|
783
815
|
} catch ( error ) {
|
|
784
816
|
logger.error( { error: error, function: 'getInfraIssues' } );
|
|
785
817
|
return res.sendError( error, 500 );
|
|
@@ -377,6 +377,18 @@ export async function workHistory( req, res ) {
|
|
|
377
377
|
{ 'issueClosedDate': { $lte: date.end } },
|
|
378
378
|
],
|
|
379
379
|
|
|
380
|
+
},
|
|
381
|
+
},
|
|
382
|
+
);
|
|
383
|
+
} else if ( req.body.dateFilter === 'issueDate' ) {
|
|
384
|
+
query.push(
|
|
385
|
+
{
|
|
386
|
+
$match: {
|
|
387
|
+
$and: [
|
|
388
|
+
{ 'issueDate': { $gte: date.start } },
|
|
389
|
+
{ 'issueDate': { $lte: date.end } },
|
|
390
|
+
],
|
|
391
|
+
|
|
380
392
|
},
|
|
381
393
|
},
|
|
382
394
|
);
|
|
@@ -411,6 +423,7 @@ export async function workHistory( req, res ) {
|
|
|
411
423
|
storeName: '$basicDetails.storeName',
|
|
412
424
|
clientId: '$basicDetails.clientId',
|
|
413
425
|
clientName: '$basicDetails.clientName',
|
|
426
|
+
issueType: 1,
|
|
414
427
|
issueDate: { $dateToString: { format: '%Y-%m-%d', date: '$createdAt' } },
|
|
415
428
|
issueClosedDate: { $dateToString: { format: '%Y-%m-%d', date: '$issueClosedDate' } },
|
|
416
429
|
issueIdentifiedDate: { $dateToString: { format: '%Y-%m-%d', date: '$ticketDetails.issueIdentifiedDate' } },
|
|
@@ -440,6 +453,7 @@ export async function workHistory( req, res ) {
|
|
|
440
453
|
$project: {
|
|
441
454
|
storeId: 1,
|
|
442
455
|
storeName: 1,
|
|
456
|
+
issueType: 1,
|
|
443
457
|
clientId: 1,
|
|
444
458
|
clientName: 1,
|
|
445
459
|
issueDate: 1,
|
|
@@ -452,13 +466,20 @@ export async function workHistory( req, res ) {
|
|
|
452
466
|
infraIssue: { $ifNull: [ '$primaryIssue.reasons.primaryIssue', '' ] },
|
|
453
467
|
},
|
|
454
468
|
} );
|
|
455
|
-
if ( req.body.issueFilter && req.body.issueFilter.length>0 ) {
|
|
469
|
+
if ( req.body.issueFilter && req.body.issueFilter.length>0&&req.body.issueType!='dataMismatch' ) {
|
|
456
470
|
query.push( {
|
|
457
471
|
$match: {
|
|
458
472
|
infraIssue: { $in: req.body.issueFilter },
|
|
459
473
|
},
|
|
460
474
|
} );
|
|
461
475
|
}
|
|
476
|
+
if ( req.body.issueFilter && req.body.issueFilter.length>0&&req.body.issueType==='dataMismatch' ) {
|
|
477
|
+
query.push( {
|
|
478
|
+
$match: {
|
|
479
|
+
issueType: { $in: req.body.issueFilter },
|
|
480
|
+
},
|
|
481
|
+
} );
|
|
482
|
+
}
|
|
462
483
|
if ( req.body.searchValue && req.body.searchValue !== '' ) {
|
|
463
484
|
query.push( {
|
|
464
485
|
$match: {
|