tango-app-api-store-builder 1.0.5 → 1.0.6
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
|
@@ -7590,8 +7590,8 @@ export async function calculateCompliance( req, res ) {
|
|
|
7590
7590
|
// return Number.isInteger( truncated ) ? Math.trunc( truncated ) : truncated;
|
|
7591
7591
|
// }
|
|
7592
7592
|
if ( totalProducts.length ) {
|
|
7593
|
-
result.merchCompliance = ( ( getCompliance?.[0]?.count / totalProducts?.[0]?.productCount ) * 100 )
|
|
7594
|
-
let previousMerchCompliance = getCompliance?.[1]?.count ? ( ( getCompliance?.[1]?.count / totalProducts?.[0]?.productCount ) * 100 )
|
|
7593
|
+
result.merchCompliance = Math.floor( ( getCompliance?.[0]?.count / totalProducts?.[0]?.productCount ) * 100 );
|
|
7594
|
+
let previousMerchCompliance = getCompliance?.[1]?.count ? Math.floor( ( getCompliance?.[1]?.count / totalProducts?.[0]?.productCount ) * 100 ) : 0;
|
|
7595
7595
|
if ( getCompliance.length > 1 && result.merchCompliance != previousMerchCompliance ) {
|
|
7596
7596
|
if ( result.merchCompliance > previousMerchCompliance ) {
|
|
7597
7597
|
let diff = result.merchCompliance - previousMerchCompliance;
|
|
@@ -7630,7 +7630,7 @@ export async function getPlanogramList( req, res ) {
|
|
|
7630
7630
|
|
|
7631
7631
|
const today = new Date( dayjs().format( 'YYYY-MM-DD' ) );
|
|
7632
7632
|
|
|
7633
|
-
const storeQuery = { clientId };
|
|
7633
|
+
const storeQuery = { clientId,status:'active' };
|
|
7634
7634
|
|
|
7635
7635
|
if ( filter?.country?.length ) {
|
|
7636
7636
|
storeQuery['storeProfile.country'] = { $in: filter.country };
|
|
@@ -7640,7 +7640,7 @@ export async function getPlanogramList( req, res ) {
|
|
|
7640
7640
|
storeQuery['storeProfile.city'] = { $in: filter.city };
|
|
7641
7641
|
}
|
|
7642
7642
|
|
|
7643
|
-
const storeDocs = await storeService.find( storeQuery );
|
|
7643
|
+
const storeDocs = await storeService.find( storeQuery,{storeId:1,storeProfile:1} );
|
|
7644
7644
|
|
|
7645
7645
|
if ( !storeDocs.length ) {
|
|
7646
7646
|
return res.sendSuccess( { data: [], count: 0 } );
|
|
@@ -7724,7 +7724,7 @@ export async function getPlanogramList( req, res ) {
|
|
|
7724
7724
|
fixtureDetails: 1,
|
|
7725
7725
|
complianceCount: 1,
|
|
7726
7726
|
merchCompliance: {
|
|
7727
|
-
$
|
|
7727
|
+
$floor: [
|
|
7728
7728
|
{
|
|
7729
7729
|
$multiply: [
|
|
7730
7730
|
{
|
|
@@ -7736,7 +7736,6 @@ export async function getPlanogramList( req, res ) {
|
|
|
7736
7736
|
100,
|
|
7737
7737
|
],
|
|
7738
7738
|
},
|
|
7739
|
-
1,
|
|
7740
7739
|
],
|
|
7741
7740
|
},
|
|
7742
7741
|
},
|