tango-app-api-infra 3.0.104-dev → 3.0.106-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.104-dev",
3
+ "version": "3.0.106-dev",
4
4
  "description": "infra",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -17,7 +17,6 @@ export async function infraCard( req, res ) {
17
17
  $and: [
18
18
  { issueType: 'installation' },
19
19
  { 'status': { $ne: 'closed' } },
20
- { 'ticketDetails.issueStatus': 'notidentified' },
21
20
  { 'basicDetails.clientId': { $in: req.body.clientId } },
22
21
  { createdAt: { $lte: date.end } },
23
22
  ],
@@ -570,7 +569,7 @@ export async function InstallationIssuesTable( req, res ) {
570
569
  if ( req.body.installtionfilterIssue == 'yettoInstallStores' ) {
571
570
  query.push( { $match: { 'ticketDetails.issueStatus': 'notidentified' } } );
572
571
  }
573
- if ( req.body.installtionfilterIssue == 'installFailedStores' ) {
572
+ if ( req.body.installtionfilterIssue == 'installationFailedStores' ) {
574
573
  query.push( { $match: { 'ticketDetails.issueStatus': 'identified' } } );
575
574
  }
576
575
 
@@ -726,7 +725,7 @@ export async function InstallationIssuesTable( req, res ) {
726
725
  },
727
726
  } );
728
727
  }
729
- if ( req.body.installtionfilterIssue && req.body.installtionfilterIssue != '' && req.body.installtionfilterIssue != 'yettoInstallStores' && req.body.installtionfilterIssue != 'installFailedStores' ) {
728
+ if ( req.body.installtionfilterIssue && req.body.installtionfilterIssue != '' && req.body.installtionfilterIssue != 'yettoInstallStores' && req.body.installtionfilterIssue != 'installationFailedStores' ) {
730
729
  query.push( {
731
730
  $match: {
732
731
  primaryIssue: req.body.installtionfilterIssue,
@@ -772,7 +771,7 @@ export async function InstallationIssuesTable( req, res ) {
772
771
  const exportdata = [];
773
772
  storesList.forEach( ( element ) => {
774
773
  exportdata.push( {
775
- 'Client Name': element.clientName,
774
+ 'Brand Name': element.clientName,
776
775
  'Store ID': element.storeId,
777
776
  'Store Name': element.storeName,
778
777
  'Status': element.status,
@@ -1342,14 +1341,16 @@ export async function overViewTable( req, res ) {
1342
1341
  },
1343
1342
  },
1344
1343
  ];
1345
- if ( inputData.searchValue ) {
1346
- filter.push( {
1347
- $or: [
1348
- { 'clientName': { $regex: req.body.searchValue, $options: 'i' } },
1349
- { 'storeId': { $regex: req.body.searchValue, $options: 'i' } },
1350
- { 'storeName': { $regex: req.body.searchValue, $options: 'i' } },
1351
- { 'status': { $regex: req.body.searchValue, $options: 'i' } },
1352
- ],
1344
+ if ( req.body.searchValue && req.body.searchValue != '' ) {
1345
+ query.push( {
1346
+ $match: {
1347
+ $or: [
1348
+ { storeId: { $regex: req.body.searchValue, $options: 'i' } },
1349
+ { storeName: { $regex: req.body.searchValue, $options: 'i' } },
1350
+ { clientName: { $regex: req.body.searchValue, $options: 'i' } },
1351
+ { status: { $regex: req.body.searchValue, $options: 'i' } },
1352
+ ],
1353
+ },
1353
1354
  } );
1354
1355
  }
1355
1356
  if ( inputData.sortColumnName ) {
@@ -205,10 +205,10 @@ export async function activityList( req, res ) {
205
205
  } );
206
206
  }
207
207
 
208
- if ( req.body.filter && req.body.filter !== '' ) {
208
+ if ( req.body.filter && req.body.filter.length ) {
209
209
  query.push( {
210
210
  $match: {
211
- issueType: req.body.filter,
211
+ issueType: { $in: req.body.filter },
212
212
  },
213
213
  } );
214
214
  }
@@ -532,21 +532,32 @@ export async function workHistory( req, res ) {
532
532
  if ( req.body.export ) {
533
533
  const exportdata = [];
534
534
  result.forEach( ( element ) => {
535
- let data = {
536
- 'CREATED ON': dayjs( element.createdAt ).format( 'DD-MM-YYYY' ),
537
- 'TICKET ID': element.ticketId,
538
- 'STORE ID': element.storeId,
539
- 'STORE NAME': element.storeName,
540
- 'CLIENT ID': element.clientId,
541
- 'CLIENT NAME': element.clientName,
542
- 'CLOSED ON': element.issueClosedDate,
543
- 'STATUS': element.status,
544
- };
535
+ let data = {};
545
536
  if ( req.body.issueType === 'infra' || req.body.issueType === 'installation' ) {
546
- data = { ...data, ...{ 'ISSUE': element.infraIssue ? element.infraIssue : '-', 'ISSUE IDENTIFIED DATE': element.issueIdentifiedDate } };
537
+ data ={
538
+ 'Created on': dayjs( element.createdAt ).format( 'DD MMM, YYYY' ),
539
+ 'Ticket ID': element.ticketId,
540
+ 'Brand Name': element.clientName,
541
+ 'Brand ID': element.clientId,
542
+ 'Store Name': element.storeName,
543
+ 'Store ID': element.storeId,
544
+ 'Closed on': element.issueClosedDate,
545
+ 'Issue Identified on': element.issueIdentifiedDate,
546
+ 'Issue Type': element.infraIssue ? element.infraIssue : '-',
547
+ };
547
548
  }
548
549
  if ( req.body.issueType === 'dataMismatch' ) {
549
- data = { ...data, ...{ 'issueType': element.issueType ? element.issueType : '-', 'ISSUE DATE': dayjs( element.issueDate ).format( 'DD-MM-YYYY' ) } };
550
+ data ={
551
+ 'Created on': dayjs( element.createdAt ).format( 'DD MMM, YYYY' ),
552
+ 'Ticket ID': element.ticketId,
553
+ 'Brand Name': element.clientName,
554
+ 'Brand ID': element.clientId,
555
+ 'Store Name': element.storeName,
556
+ 'Store ID': element.storeId,
557
+ 'Issue date': dayjs( element.issueDate ).format( 'DD MMM, YYYY' ),
558
+ 'Closed on': element.issueClosedDate,
559
+ 'Issue Type': element.issueType ? element.issueType : '-',
560
+ };
550
561
  }
551
562
  exportdata.push( data );
552
563
  } );