tango-app-api-infra 3.9.5-vms.65 β 3.9.5-vms.66
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
|
@@ -508,8 +508,8 @@ export async function ticketCreation( req, res, next ) {
|
|
|
508
508
|
if ( r.actionType === 'reviewer' && r.isChecked === true ) {
|
|
509
509
|
revisionMapping = {
|
|
510
510
|
type: 'review',
|
|
511
|
-
revicedFootfall: revisedFootfall,
|
|
512
|
-
revicedPerc: Math.round( ( revisedFootfall / footfallCount ) * 100 || 0 ) + '%',
|
|
511
|
+
// revicedFootfall: revisedFootfall,
|
|
512
|
+
// revicedPerc: Math.round( ( revisedFootfall / footfallCount ) * 100 || 0 ) + '%',
|
|
513
513
|
count: tempAcc,
|
|
514
514
|
revisedDetail: formattedTaggingData,
|
|
515
515
|
status: 'Open',
|
|
@@ -526,8 +526,8 @@ export async function ticketCreation( req, res, next ) {
|
|
|
526
526
|
} else if ( r.actionType === 'tango' && r.isChecked === true ) {
|
|
527
527
|
tangoReviewMapping = {
|
|
528
528
|
type: 'tangoreview',
|
|
529
|
-
revicedFootfall: revisedFootfall,
|
|
530
|
-
revicedPerc: Math.round( ( revisedFootfall / footfallCount ) * 100 || 0 ) + '%',
|
|
529
|
+
// revicedFootfall: revisedFootfall,
|
|
530
|
+
// revicedPerc: Math.round( ( revisedFootfall / footfallCount ) * 100 || 0 ) + '%',
|
|
531
531
|
count: tempAcc,
|
|
532
532
|
revisedDetail: formattedTaggingData,
|
|
533
533
|
status: 'Open',
|
|
@@ -570,7 +570,7 @@ export async function ticketCreation( req, res, next ) {
|
|
|
570
570
|
];
|
|
571
571
|
|
|
572
572
|
const finduserList = await aggregateUser( userQuery );
|
|
573
|
-
|
|
573
|
+
|
|
574
574
|
|
|
575
575
|
const createdOn = dayjs().format( 'DD MMM YYYY' );
|
|
576
576
|
const title = `${getstoreName?.storeName} Have raised a ticket for a Footfall Mismatch`;
|
|
@@ -596,12 +596,12 @@ export async function ticketCreation( req, res, next ) {
|
|
|
596
596
|
m.name === 'reviewer' && ( m.isAdd === true || m.isEdit === true ),
|
|
597
597
|
),
|
|
598
598
|
);
|
|
599
|
-
|
|
599
|
+
|
|
600
600
|
|
|
601
601
|
if ( !ticketsFeature ) return;
|
|
602
602
|
|
|
603
603
|
const notifyUser = await getAssinedStore( userData, req.body.storeId );
|
|
604
|
-
|
|
604
|
+
|
|
605
605
|
if ( !notifyUser || !userData?.fcmToken ) return;
|
|
606
606
|
|
|
607
607
|
await sendPushNotification( title, description, userData.fcmToken, Data );
|
|
@@ -1223,8 +1223,8 @@ export async function ticketReview( req, res, next ) {
|
|
|
1223
1223
|
if ( r.actionType === 'approver' && r.isChecked === true ) {
|
|
1224
1224
|
approverMapping = {
|
|
1225
1225
|
type: 'approve',
|
|
1226
|
-
revicedFootfall: revisedFootfall,
|
|
1227
|
-
revicedPerc: Math.round( ( revisedFootfall / footfallCount ) * 100 || 0 ) + '%',
|
|
1226
|
+
// revicedFootfall: revisedFootfall,
|
|
1227
|
+
// revicedPerc: Math.round( ( revisedFootfall / footfallCount ) * 100 || 0 ) + '%',
|
|
1228
1228
|
count: tempAcc,
|
|
1229
1229
|
revisedDetail: formattedTaggingData,
|
|
1230
1230
|
status: 'Open',
|
|
@@ -1232,8 +1232,8 @@ export async function ticketReview( req, res, next ) {
|
|
|
1232
1232
|
} else if ( r.actionType === 'tango' && r.isChecked === true ) {
|
|
1233
1233
|
tangoReviewMapping = {
|
|
1234
1234
|
type: 'tangoreview',
|
|
1235
|
-
revicedFootfall: revisedFootfall,
|
|
1236
|
-
revicedPerc: Math.round( ( revisedFootfall / footfallCount ) * 100 || 0 ) + '%',
|
|
1235
|
+
// revicedFootfall: revisedFootfall,
|
|
1236
|
+
// revicedPerc: Math.round( ( revisedFootfall / footfallCount ) * 100 || 0 ) + '%',
|
|
1237
1237
|
count: tempAcc,
|
|
1238
1238
|
revisedDetail: formattedTaggingData,
|
|
1239
1239
|
status: 'Open',
|
|
@@ -1269,7 +1269,7 @@ export async function ticketReview( req, res, next ) {
|
|
|
1269
1269
|
},
|
|
1270
1270
|
];
|
|
1271
1271
|
let finduserList = await aggregateUser( userQuery );
|
|
1272
|
-
|
|
1272
|
+
|
|
1273
1273
|
|
|
1274
1274
|
// return;
|
|
1275
1275
|
for ( let userData of finduserList ) {
|
|
@@ -1499,7 +1499,7 @@ export async function ticketApprove( req, res, next ) {
|
|
|
1499
1499
|
if ( !taggingImages || taggingImages?.length == 0 ) {
|
|
1500
1500
|
return res.sendError( 'You donβt have any tagged images right now', 400 );
|
|
1501
1501
|
}
|
|
1502
|
-
|
|
1502
|
+
|
|
1503
1503
|
const formattedTaggingData = formatRevopTaggingHits( taggingImages );
|
|
1504
1504
|
|
|
1505
1505
|
const getTicket = {
|
|
@@ -1647,14 +1647,14 @@ export async function ticketApprove( req, res, next ) {
|
|
|
1647
1647
|
|
|
1648
1648
|
record.mappingInfo = [ ...ticketData?.[0]?._source?.mappingInfo.slice( 0, -1 ),
|
|
1649
1649
|
...temp ];
|
|
1650
|
-
if ( Array.isArray( record.mappingInfo ) ) {
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
}
|
|
1650
|
+
// if ( Array.isArray( record.mappingInfo ) ) {
|
|
1651
|
+
// record.mappingInfo = record.mappingInfo.map( ( item ) => {
|
|
1652
|
+
// return {
|
|
1653
|
+
// ...item,
|
|
1654
|
+
// status: 'Closed',
|
|
1655
|
+
// };
|
|
1656
|
+
// } );
|
|
1657
|
+
// }
|
|
1658
1658
|
// If no review mapping existed, push a new one
|
|
1659
1659
|
if ( record.mappingInfo.length === 0 ) {
|
|
1660
1660
|
record.mappingInfo.push( {
|
|
@@ -1678,8 +1678,8 @@ export async function ticketApprove( req, res, next ) {
|
|
|
1678
1678
|
// if ( r.actionType === 'tango' && r.isChecked === true ) {
|
|
1679
1679
|
tangoReviewMapping = {
|
|
1680
1680
|
type: 'tangoreview',
|
|
1681
|
-
revicedFootfall: revisedFootfall,
|
|
1682
|
-
revicedPerc: Math.round( ( revisedFootfall / footfallCount ) * 100 || 0 ) + '%',
|
|
1681
|
+
// revicedFootfall: revisedFootfall,
|
|
1682
|
+
// revicedPerc: Math.round( ( revisedFootfall / footfallCount ) * 100 || 0 ) + '%',
|
|
1683
1683
|
count: tempAcc,
|
|
1684
1684
|
revisedDetail: formattedTaggingData,
|
|
1685
1685
|
status: 'Open',
|
|
@@ -1769,13 +1769,13 @@ export async function ticketApprove( req, res, next ) {
|
|
|
1769
1769
|
},
|
|
1770
1770
|
];
|
|
1771
1771
|
let finduserList = await aggregateUser( userQuery );
|
|
1772
|
-
|
|
1772
|
+
|
|
1773
1773
|
|
|
1774
1774
|
for ( let userData of finduserList ) {
|
|
1775
1775
|
let title = `${getstoreName?.storeName} Have raised a ticket for a Footfall Mismatch`;
|
|
1776
1776
|
let createdOn = dayjs().format( 'DD MMM YYYY' );
|
|
1777
1777
|
let description = `Created on ${createdOn}`;
|
|
1778
|
-
|
|
1778
|
+
|
|
1779
1779
|
let Data = {
|
|
1780
1780
|
'title': title,
|
|
1781
1781
|
'body': description,
|
|
@@ -1787,7 +1787,7 @@ export async function ticketApprove( req, res, next ) {
|
|
|
1787
1787
|
};
|
|
1788
1788
|
|
|
1789
1789
|
const ticketsFeature = userData?.rolespermission?.some( ( f ) => f.featureName === 'FootfallDirectory' && ( f.modules.find( ( m ) => m.name == 'approver' && ( m.isAdd == true || m.isEdit == true ) ) ) );
|
|
1790
|
-
|
|
1790
|
+
|
|
1791
1791
|
if ( ticketsFeature ) {
|
|
1792
1792
|
let notifyuser = await getAssinedStore( userData, req.body.storeId );
|
|
1793
1793
|
if ( userData && userData.fcmToken && notifyuser ) {
|
|
@@ -1801,7 +1801,7 @@ export async function ticketApprove( req, res, next ) {
|
|
|
1801
1801
|
const id = `${inputData.storeId}_${inputData.dateString}_footfall-directory-tagging`;
|
|
1802
1802
|
const insertResult = await updateOpenSearchData( openSearch.footfallDirectory, id, { doc: record } );
|
|
1803
1803
|
|
|
1804
|
-
|
|
1804
|
+
|
|
1805
1805
|
if ( insertResult && ( insertResult.statusCode === 201 || insertResult.statusCode === 200 ) ) {
|
|
1806
1806
|
return res.sendSuccess( 'Ticket closed successfully' );
|
|
1807
1807
|
} else {
|