tango-app-api-infra 3.9.20 → 3.9.22

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.9.20",
3
+ "version": "3.9.22",
4
4
  "description": "infra",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -2611,7 +2611,7 @@ export async function ticketList( req, res ) {
2611
2611
  if ( inputData.sortBy ) {
2612
2612
  let sortOrder = inputData.sortOrder === 1 ? 'asc' : 'desc';
2613
2613
  const stringKeywordFields = [ 'storeName', 'storeId', 'ticketId', 'status', 'type', 'clientId' ];
2614
- let sortField = inputData.sortBy == 'footfall' ? 'footfallCount' : inputData.sortBy == 'issueDate' ? 'dateString': inputData.sortBy == 'tangoStatus'? 'status' : inputData.sortBy;
2614
+ let sortField = inputData.sortBy == 'footfall' ? 'footfallCount' :inputData.sortBy == 'revisedFF' ? 'revicedFootfall' : inputData.sortBy == 'issueDate' ? 'dateString': inputData.sortBy == 'tangoStatus'? 'status' : inputData.sortBy;
2615
2615
  if ( stringKeywordFields.includes( sortField ) ) {
2616
2616
  sortField = `${sortField}.keyword`;
2617
2617
  }
@@ -2645,6 +2645,9 @@ export async function ticketList( req, res ) {
2645
2645
  } else if ( inputData.sortBy === 'ticketBy' ) {
2646
2646
  sortKey = 'createdByEmail';
2647
2647
  requestedSortType = 'tangoreview';
2648
+ } else if ( inputData.sortBy === 'ticketCreatedBy' ) {
2649
+ sortKey = 'createdByEmail';
2650
+ requestedSortType = 'tagging';
2648
2651
  } else if ( inputData.sortBy === 'status' ) {
2649
2652
  sortKey = 'status';
2650
2653
  requestedSortType =( req.user.userType === 'tango' && inputData.tangoType === 'store' )? 'tangoreview' : inputData?.permissionType === 'review' ? 'review' : ( ticketsFeature && !ticketsApproveFeature )? 'review':'approve';
@@ -4134,12 +4137,6 @@ export async function ticketList( req, res ) {
4134
4137
  ticketRaised: item?.mappingInfo?.find( ( f ) => f.type === 'review' )?.createdAt,
4135
4138
  issueDate: item?.dateString,
4136
4139
  footfall: item?.footfallCount,
4137
- dueDate: item?.mappingInfo?.find( ( f ) => f.type === 'review' )?.dueDate,
4138
- type: item.type || 'store',
4139
- storeRevisedAccuracy: item?.mappingInfo?.find( ( f ) => f.type === 'tagging' )?.revicedPerc || '--',
4140
- reviewerRevisedAccuracy: item?.mappingInfo?.find( ( f ) => f.type === 'review' )?.revicedPerc || '--',
4141
- ...( isApprover !== true? item?.mappingInfo?.find( ( f ) => f.type === 'tangoreview' )?.revicedPerc : '' ),
4142
- revicedFF: item.status === 'Closed' || item.status === 'Tango Review Done' ?item?.revicedFootfall : '--',
4143
4140
  ...( function() {
4144
4141
  let counts = undefined;
4145
4142
  if ( Array.isArray( item.mappingInfo ) ) {
@@ -4168,6 +4165,13 @@ export async function ticketList( req, res ) {
4168
4165
  }
4169
4166
  return {};
4170
4167
  } )(),
4168
+ dueDate: item?.mappingInfo?.find( ( f ) => f.type === 'review' )?.dueDate,
4169
+ type: item.type || 'store',
4170
+ storeRevisedAccuracy: item?.mappingInfo?.find( ( f ) => f.type === 'tagging' )?.revicedPerc || '--',
4171
+ reviewerRevisedAccuracy: item?.mappingInfo?.find( ( f ) => f.type === 'review' )?.revicedPerc || '--',
4172
+ ...( isApprover !== true? item?.mappingInfo?.find( ( f ) => f.type === 'tangoreview' )?.revicedPerc : '' ),
4173
+ revisedFF: item.status === 'Closed' || item.status === 'Tango Review Done' ?item?.revicedFootfall : '--',
4174
+
4171
4175
  status: item?.mappingInfo?.find( ( f ) => f.type === 'review' )?.status || '--',
4172
4176
  closedDate: item.status === 'Closed' || item.status === 'Tango Review Done' ? item?.mappingInfo?.find( ( f ) => f.type === 'review' )?.updatedAt : '--',
4173
4177
  ReviewedBy: item?.mappingInfo?.find( ( f ) => f.type === 'review' )?.createdByEmail || '--',
@@ -4250,13 +4254,6 @@ export async function ticketList( req, res ) {
4250
4254
  ticketRaised: item?.mappingInfo?.find( ( f ) => f.type === 'review' )?.createdAt,
4251
4255
  issueDate: item?.dateString,
4252
4256
  footfall: item?.footfallCount,
4253
- // revicedFootfall: item?.revicedFootfall,
4254
- dueDate: item?.mappingInfo?.find( ( f ) => f.type === 'review' )?.dueDate,
4255
- type: item.type || 'store',
4256
- storeRevisedAccuracy: item?.mappingInfo?.find( ( f ) => f.type === 'tagging' )?.revicedPerc || '--',
4257
- reviewerRevisedAccuracy: item?.mappingInfo?.find( ( f ) => f.type === 'review' )?.revicedPerc || '--',
4258
- ...( isApprover !== true? tangoRevisedAccuracy: item?.mappingInfo?.find( ( f ) => f.type === 'tangoreview' )?.revicedPerc || '' ),
4259
- revicedFF: item.status === 'Closed' || item.status === 'Tango Review Done' ?item?.revicedFootfall : '--',
4260
4257
  ...( function() {
4261
4258
  let counts = undefined;
4262
4259
  if ( Array.isArray( item.mappingInfo ) ) {
@@ -4285,6 +4282,14 @@ export async function ticketList( req, res ) {
4285
4282
  }
4286
4283
  return {};
4287
4284
  } )(),
4285
+ // revicedFootfall: item?.revicedFootfall,
4286
+ dueDate: item?.mappingInfo?.find( ( f ) => f.type === 'review' )?.dueDate,
4287
+ type: item.type || 'store',
4288
+ storeRevisedAccuracy: item?.mappingInfo?.find( ( f ) => f.type === 'tagging' )?.revicedPerc || '--',
4289
+ reviewerRevisedAccuracy: item?.mappingInfo?.find( ( f ) => f.type === 'review' )?.revicedPerc || '--',
4290
+ ...( isApprover !== true? tangoRevisedAccuracy: item?.mappingInfo?.find( ( f ) => f.type === 'tangoreview' )?.revicedPerc || '' ),
4291
+ revisedFF: item.status === 'Closed' || item.status === 'Tango Review Done' ?item?.revicedFootfall : '--',
4292
+
4288
4293
  status: item?.mappingInfo?.find( ( f ) => f.type === 'review' )?.status || '--',
4289
4294
  closedDate: item.status === 'Closed' || item.status === 'Tango Review Done' ? item?.mappingInfo?.find( ( f ) => f.type === 'review' )?.updatedAt : '--',
4290
4295
  ReviewedBy: item?.mappingInfo?.find( ( f ) => f.type === 'review' )?.createdByEmail || '--',