tango-app-api-infra 3.1.22 → 3.1.23

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.1.22",
3
+ "version": "3.1.23",
4
4
  "description": "infra",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1292,21 +1292,37 @@ export async function infraTable( req, res ) {
1292
1292
  let result = await aggregateTangoTicket( query );
1293
1293
  if ( req.body.export && result.length > 0 ) {
1294
1294
  const exportdata = [];
1295
- result.forEach( ( element ) => {
1296
- exportdata.push( {
1297
- 'Ticket ID': element.ticketId,
1298
- 'Created Date': dayjs( element.issueDate ).format( 'DD MMM, YYYY' ),
1299
- 'Brand Name': element.clientName,
1300
- 'Brand ID': element.clientId,
1301
- 'Store Name': element.storeName,
1302
- 'Store ID': element.storeId,
1303
- 'Resloved By': element.userName,
1304
- 'Status': element.status,
1305
- 'Primary Issues': element.primaryIssue,
1306
- 'Secondary Issues': element.secondaryIssue,
1307
- 'Comment': element.otherscomment ? element.otherscomment : ( element.commentText?element.commentText:'-' ),
1295
+ if ( req.user.userType ==='tango' ) {
1296
+ result.forEach( ( element ) => {
1297
+ exportdata.push( {
1298
+ 'Ticket ID': element.ticketId,
1299
+ 'Created Date': dayjs( element.issueDate ).format( 'DD MMM, YYYY' ),
1300
+ 'Brand Name': element.clientName,
1301
+ 'Brand ID': element.clientId,
1302
+ 'Store Name': element.storeName,
1303
+ 'Store ID': element.storeId,
1304
+ 'Resloved By': element.userName,
1305
+ 'Status': element.status,
1306
+ 'Primary Issues': element.primaryIssue,
1307
+ 'Secondary Issues': element.secondaryIssue,
1308
+ 'Comment': element.otherscomment ? element.otherscomment : ( element.commentText?element.commentText:'-' ),
1309
+ } );
1308
1310
  } );
1309
- } );
1311
+ } else {
1312
+ result.forEach( ( element ) => {
1313
+ exportdata.push( {
1314
+ 'Ticket ID': element.ticketId,
1315
+ 'Created Date': dayjs( element.issueDate ).format( 'DD MMM, YYYY' ),
1316
+ 'Store Name': element.storeName,
1317
+ 'Store ID': element.storeId,
1318
+ 'Status': element.status,
1319
+ 'Primary Issues': element.primaryIssue,
1320
+ 'Secondary Issues': element.secondaryIssue,
1321
+ 'Comment': element.otherscomment ? element.otherscomment : ( element.commentText?element.commentText:'-' ),
1322
+ } );
1323
+ } );
1324
+ }
1325
+
1310
1326
  await download( exportdata, res );
1311
1327
  return;
1312
1328
  }
@@ -1582,20 +1598,34 @@ export async function installationTable( req, res ) {
1582
1598
 
1583
1599
  if ( req.body.export && result.length > 0 ) {
1584
1600
  const exportdata = [];
1585
- result.forEach( ( element ) => {
1586
- exportdata.push( {
1587
- 'Ticket ID': element.ticketId,
1588
- 'Created Date': dayjs( element.createdAt ).format( 'DD MMM, YYYY' ),
1589
- 'Brand Name': element.clientName,
1590
- 'Brand ID': element.clientId,
1591
- 'Store Name': element.storeName,
1592
- 'Store ID': element.storeId,
1593
- 'Installed By': element.userName,
1594
- 'Deployed Status': element.installationStatus,
1595
- 'Primary Issues': element.primaryIssue=='-'?'Issue not identified':element.primaryIssue,
1596
- 'Secondary Issues': element.secondaryIssue,
1601
+ if ( req.user.userType ==='tango' ) {
1602
+ result.forEach( ( element ) => {
1603
+ exportdata.push( {
1604
+ 'Ticket ID': element.ticketId,
1605
+ 'Created Date': dayjs( element.createdAt ).format( 'DD MMM, YYYY' ),
1606
+ 'Brand Name': element.clientName,
1607
+ 'Brand ID': element.clientId,
1608
+ 'Store Name': element.storeName,
1609
+ 'Store ID': element.storeId,
1610
+ 'Installed By': element.userName,
1611
+ 'Deployed Status': element.installationStatus,
1612
+ 'Primary Issues': element.primaryIssue=='-'?'Issue not identified':element.primaryIssue,
1613
+ 'Secondary Issues': element.secondaryIssue,
1614
+ } );
1597
1615
  } );
1598
- } );
1616
+ } else {
1617
+ result.forEach( ( element ) => {
1618
+ exportdata.push( {
1619
+ 'Ticket ID': element.ticketId,
1620
+ 'Created Date': dayjs( element.createdAt ).format( 'DD MMM, YYYY' ),
1621
+ 'Store Name': element.storeName,
1622
+ 'Store ID': element.storeId,
1623
+ 'Deployed Status': element.installationStatus,
1624
+ 'Primary Issues': element.primaryIssue=='-'?'Issue not identified':element.primaryIssue,
1625
+ 'Secondary Issues': element.secondaryIssue,
1626
+ } );
1627
+ } );
1628
+ }
1599
1629
  await download( exportdata, res );
1600
1630
  return;
1601
1631
  }