tango-app-api-infra 3.9.5-vms.83 → 3.9.5-vms.84

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.5-vms.83",
3
+ "version": "3.9.5-vms.84",
4
4
  "description": "infra",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -312,6 +312,33 @@ export async function tangoReviewTicket( req, res ) {
312
312
 
313
313
  record.mappingInfo = [ ...ticketData?.[0]?._source?.mappingInfo.slice( 0, -1 ),
314
314
  ...temp ];
315
+
316
+ if ( Array.isArray( record.mappingInfo ) ) {
317
+ record.mappingInfo = record.mappingInfo.map( ( item ) => {
318
+ return {
319
+ ...item,
320
+ status: item.type === 'approve'? 'Tango Review Done':'Closed',
321
+ };
322
+ } );
323
+ }
324
+
325
+ record.mappingInfo.push(
326
+ {
327
+ type: 'finalRevision',
328
+ mode: inputData.mappingInfo?.mode,
329
+ revicedFootfall: revisedFootfall,
330
+ revicedPerc: inputData.mappingInfo?.revicedPerc,
331
+ count: inputData.mappingInfo?.count,
332
+ revisedDetail: inputData.mappingInfo?.revisedDetail,
333
+ status: 'Closed',
334
+ createdByEmail: req?.user?.email,
335
+ createdByUserName: req?.user?.userName,
336
+ createdByRole: req?.user?.role,
337
+ createdAt: new Date(),
338
+ },
339
+
340
+
341
+ );
315
342
  }
316
343
  } else {
317
344
  if ( Array.isArray( record.mappingInfo ) ) {
@@ -392,7 +419,7 @@ export async function tangoReviewTicket( req, res ) {
392
419
  const insertResult = await updateOpenSearchData( openSearch.footfallDirectory, id, { doc: record } );
393
420
 
394
421
  if ( insertResult && ( insertResult.statusCode === 201 || insertResult.statusCode === 200 ) ) {
395
- if ( record.status = 'Closed' && inputData.ticketType !== 'internal' ) {
422
+ if ( ( record.status === 'Closed' || record.status === 'Open - Accuracy Issue' ) && inputData.ticketType !== 'internal' ) {
396
423
  const query = {
397
424
  storeId: inputData?.storeId,
398
425
  isVideoStream: true,
@@ -532,7 +559,7 @@ export async function tangoReviewAccuracyClosedTicket( req, res ) {
532
559
  },
533
560
  },
534
561
  };
535
- if ( Ticket[0]?._source?.type != 'internal' ) {
562
+ if ( Ticket[0]?._source?.type !== 'internal' ) {
536
563
  getTicket.query.bool.must.push(
537
564
  {
538
565
  nested: {
@@ -576,22 +603,24 @@ export async function tangoReviewAccuracyClosedTicket( req, res ) {
576
603
  .filter( ( item ) => item.type === 'tangoreview' )
577
604
  .map( ( item ) => ( {
578
605
  ...item,
579
- status: 'Closed',
606
+ status: 'Closed - Accuracy Issue',
580
607
  createdByEmail: req?.user?.email,
581
608
  createdByUserName: req?.user?.userName,
582
609
  createdByRole: req?.user?.role,
610
+ comments: inputData?.comments || '',
611
+ subComments: inputData?.subComments ||'',
583
612
  } ) );
584
613
 
585
614
  record.mappingInfo = [ ...ticketData?.[0]?._source?.mappingInfo.slice( 0, -1 ),
586
615
  ...temp ];
587
- if ( Array.isArray( record.mappingInfo ) ) {
588
- record.mappingInfo = record.mappingInfo.map( ( item ) => {
589
- return {
590
- ...item,
591
- status: 'Closed',
592
- };
593
- } );
594
- }
616
+ // if ( Array.isArray( record.mappingInfo ) ) {
617
+ // record.mappingInfo = record.mappingInfo.map( ( item ) => {
618
+ // return {
619
+ // ...item,
620
+ // status: 'Closed',
621
+ // };
622
+ // } );
623
+ // }
595
624
 
596
625
  record.mappingInfo.push(
597
626
  {
@@ -606,6 +635,8 @@ export async function tangoReviewAccuracyClosedTicket( req, res ) {
606
635
  createdByUserName: req?.user?.userName,
607
636
  createdByRole: req?.user?.role,
608
637
  createdAt: new Date(),
638
+ comments: inputData?.comments || '',
639
+ subComments: inputData?.subComments || '',
609
640
  },
610
641
  );
611
642
  }
@@ -2209,7 +2240,6 @@ export async function ticketList( req, res ) {
2209
2240
  const offset = inputData.offset == 0 ? 0 : ( inputData.offset - 1 ) * limit || 0;
2210
2241
  inputData.clientId = inputData?.clientId?.split( ',' ); // convert strig to array
2211
2242
 
2212
-
2213
2243
  const ticketsFeature = userInfo?.rolespermission?.some( ( f ) => f.featureName === 'FootfallDirectory' && ( f.modules.find( ( m ) => m.name == 'reviewer' && ( m.isAdd == true || m.isEdit == true ) ) ) );
2214
2244
 
2215
2245
  const ticketsApproveFeature = userInfo?.rolespermission?.some( ( f ) => f.featureName === 'FootfallDirectory' && ( f.modules.find( ( m ) => m.name == 'approver' && ( m.isAdd == true || m.isEdit == true ) ) ) );
@@ -3034,6 +3064,8 @@ export async function ticketList( req, res ) {
3034
3064
  'Approver (%)': item?.mappingInfo?.find( ( f ) => f.type === 'approve' )?.revicedPerc || '--',
3035
3065
  'Tango (%)': item?.mappingInfo?.find( ( f ) => f.type === 'tangoreview' )?.revicedPerc || '--',
3036
3066
  'Status': item?.mappingInfo?.find( ( f ) => f.type === 'tangoreview' )?.status || '--',
3067
+ 'Comments': item?.mappingInfo?.find( ( f ) => f.type === 'finalRevision' )?.comments || '--',
3068
+ 'Sub Comments': item?.mappingInfo?.find( ( f ) => f.type === 'finalRevision' )?.subComments || '--',
3037
3069
 
3038
3070
  } );
3039
3071
  }
@@ -3054,6 +3086,8 @@ export async function ticketList( req, res ) {
3054
3086
  approverRevisedAccuracy: item?.mappingInfo?.find( ( f ) => f.type === 'approve' )?.revicedPerc || '--',
3055
3087
  tangoRevisedAccuracy: item?.mappingInfo?.find( ( f ) => f.type === 'tangoreview' )?.revicedPerc || '--',
3056
3088
  status: item?.mappingInfo?.find( ( f ) => f.type === 'tangoreview' )?.status || '--',
3089
+ comments: item?.mappingInfo?.find( ( f ) => f.type === 'finalRevision' )?.comments || '--',
3090
+ subComments: item?.mappingInfo?.find( ( f ) => f.type === 'finalRevision' )?.subComments || '--',
3057
3091
 
3058
3092
  } );
3059
3093
  }