tango-app-api-infra 3.9.5-vms.53 → 3.9.5-vms.54
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
|
@@ -546,7 +546,7 @@ export async function ticketCreation( req, res, next ) {
|
|
|
546
546
|
record.mappingInfo.push( tangoReviewMapping );
|
|
547
547
|
}
|
|
548
548
|
}
|
|
549
|
-
|
|
549
|
+
|
|
550
550
|
let checkreview = getConfig.footfallDirectoryConfigs.revision.filter( ( data ) => data.actionType === 'reviewer' && data.isChecked === true );
|
|
551
551
|
let checkapprove = getConfig.footfallDirectoryConfigs.revision.filter( ( data ) => data.actionType === 'approver' && data.isChecked === true );
|
|
552
552
|
|
|
@@ -566,14 +566,13 @@ export async function ticketCreation( req, res, next ) {
|
|
|
566
566
|
let title = `${getstoreName?.storeName} Have raised a ticket for a Footfall Mismatch`;
|
|
567
567
|
let createdOn = dayjs().format( 'DD MMM YYYY' );
|
|
568
568
|
let description = `Created on ${createdOn}`;
|
|
569
|
-
console.log( '🚀 ~ ticketCreation ~ userData.role:', userData.email );
|
|
570
569
|
let Data = {
|
|
571
570
|
storeId: getstoreName.storeId,
|
|
572
571
|
issueDate: inputData.dateString,
|
|
573
572
|
};
|
|
574
573
|
|
|
575
574
|
const ticketsFeature = userData?.rolespermission?.some( ( f ) => f.featureName === 'FootfallDirectory' && ( f.modules.find( ( m ) => m.name == 'reviewer' && ( m.isAdd == true || m.isEdit == true ) ) ) );
|
|
576
|
-
|
|
575
|
+
|
|
577
576
|
if ( ticketsFeature ) {
|
|
578
577
|
let notifyuser = await getAssinedStore( userData, req.body.storeId, Data );
|
|
579
578
|
if ( userData && userData.fcmToken && notifyuser ) {
|
|
@@ -1143,7 +1142,7 @@ export async function ticketReview( req, res, next ) {
|
|
|
1143
1142
|
record.mappingInfo.push( tangoReviewMapping );
|
|
1144
1143
|
}
|
|
1145
1144
|
}
|
|
1146
|
-
|
|
1145
|
+
|
|
1147
1146
|
let checkreview = getConfig.footfallDirectoryConfigs.revision.filter( ( data ) => data.actionType === 'reviewer' && data.isChecked === true );
|
|
1148
1147
|
let checkapprove = getConfig.footfallDirectoryConfigs.revision.filter( ( data ) => data.actionType === 'approver' && data.isChecked === true );
|
|
1149
1148
|
|
|
@@ -1163,13 +1162,13 @@ export async function ticketReview( req, res, next ) {
|
|
|
1163
1162
|
let title = `${getstoreName?.storeName} Have raised a ticket for a Footfall Mismatch`;
|
|
1164
1163
|
let createdOn = dayjs().format( 'DD MMM YYYY' );
|
|
1165
1164
|
let description = `Created on ${createdOn}`;
|
|
1166
|
-
|
|
1165
|
+
|
|
1167
1166
|
let Data = {
|
|
1168
1167
|
storeId: getstoreName.storeId,
|
|
1169
1168
|
issueDate: inputData.dateString,
|
|
1170
1169
|
};
|
|
1171
1170
|
const ticketsFeature = userData?.rolespermission?.some( ( f ) => f.featureName === 'FootfallDirectory' && ( f.modules.find( ( m ) => m.name == 'reviewer' && ( m.isAdd == true || m.isEdit == true ) ) ) );
|
|
1172
|
-
|
|
1171
|
+
|
|
1173
1172
|
if ( ticketsFeature ) {
|
|
1174
1173
|
let notifyuser = await getAssinedStore( userData, req.body.storeId, Data );
|
|
1175
1174
|
if ( userData && userData.fcmToken && notifyuser ) {
|
|
@@ -1636,23 +1635,40 @@ export async function ticketApprove( req, res, next ) {
|
|
|
1636
1635
|
},
|
|
1637
1636
|
);
|
|
1638
1637
|
}
|
|
1639
|
-
for ( let userData of finduserList ) {
|
|
1640
|
-
let title = `${getstoreName?.storeName} Have raised a ticket for a Footfall Mismatch`;
|
|
1641
|
-
let createdOn = dayjs().format( 'DD MMM YYYY' );
|
|
1642
|
-
let description = `Created on ${createdOn}`;
|
|
1643
|
-
console.log( '🚀 ~ ticketCreation ~ userData.role:', userData.email );
|
|
1644
|
-
let Data = {
|
|
1645
|
-
storeId: getstoreName.storeId,
|
|
1646
|
-
issueDate: inputData.dateString,
|
|
1647
|
-
};
|
|
1648
1638
|
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1639
|
+
|
|
1640
|
+
let checkreview = getConfig.footfallDirectoryConfigs.revision.filter( ( data ) => data.actionType === 'reviewer' && data.isChecked === true );
|
|
1641
|
+
let checkapprove = getConfig.footfallDirectoryConfigs.revision.filter( ( data ) => data.actionType === 'approver' && data.isChecked === true );
|
|
1642
|
+
|
|
1643
|
+
if ( checkreview.length > 0 || checkapprove.length > 0 ) {
|
|
1644
|
+
let userQuery = [
|
|
1645
|
+
{
|
|
1646
|
+
$match: {
|
|
1647
|
+
clientId: getstoreName.clientId,
|
|
1648
|
+
role: 'admin',
|
|
1649
|
+
},
|
|
1650
|
+
},
|
|
1651
|
+
];
|
|
1652
|
+
let finduserList = await aggregateUser( userQuery );
|
|
1653
|
+
|
|
1654
|
+
// return;
|
|
1655
|
+
for ( let userData of finduserList ) {
|
|
1656
|
+
let title = `${getstoreName?.storeName} Have raised a ticket for a Footfall Mismatch`;
|
|
1657
|
+
let createdOn = dayjs().format( 'DD MMM YYYY' );
|
|
1658
|
+
let description = `Created on ${createdOn}`;
|
|
1659
|
+
|
|
1660
|
+
let Data = {
|
|
1661
|
+
storeId: getstoreName.storeId,
|
|
1662
|
+
issueDate: inputData.dateString,
|
|
1663
|
+
};
|
|
1664
|
+
const ticketsFeature = userData?.rolespermission?.some( ( f ) => f.featureName === 'FootfallDirectory' && ( f.modules.find( ( m ) => m.name == 'approver' && ( m.isAdd == true || m.isEdit == true ) ) ) );
|
|
1665
|
+
|
|
1666
|
+
if ( ticketsFeature ) {
|
|
1667
|
+
let notifyuser = await getAssinedStore( userData, req.body.storeId, Data );
|
|
1668
|
+
if ( userData && userData.fcmToken && notifyuser ) {
|
|
1669
|
+
const fcmToken = userData.fcmToken;
|
|
1670
|
+
await sendPushNotification( title, description, fcmToken );
|
|
1671
|
+
}
|
|
1656
1672
|
}
|
|
1657
1673
|
}
|
|
1658
1674
|
}
|
|
@@ -1735,7 +1751,6 @@ export async function getAssinedStore( user, storeId ) {
|
|
|
1735
1751
|
// Convert Set back to Array if needed
|
|
1736
1752
|
let assignedStores = Array.from( storeIds );
|
|
1737
1753
|
if ( assignedStores.includes( storeId ) ) {
|
|
1738
|
-
console.log( '🚀 ~ getAssinedStore ~ req.body.assignedStores:', assignedStores );
|
|
1739
1754
|
return true;
|
|
1740
1755
|
} else {
|
|
1741
1756
|
return true;
|