tango-app-api-store-builder 1.0.4 → 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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tango-app-api-store-builder",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "storeBuilder",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"path": "^0.12.7",
|
|
33
33
|
"selenium-webdriver": "^4.31.0",
|
|
34
34
|
"sharp": "^0.34.1",
|
|
35
|
-
"tango-api-schema": "^2.4.
|
|
35
|
+
"tango-api-schema": "^2.4.31",
|
|
36
36
|
"tango-app-api-middleware": "3.1.48",
|
|
37
37
|
"url": "^0.11.4",
|
|
38
38
|
"winston": "^3.17.0",
|
|
@@ -3572,7 +3572,7 @@ export async function storeFixturesTaskv2( req, res ) {
|
|
|
3572
3572
|
|
|
3573
3573
|
if ( !planograms?.length ) return res.sendError( 'No data found', 204 );
|
|
3574
3574
|
|
|
3575
|
-
|
|
3575
|
+
const currentDate = new Date( dayjs().format( 'YYYY-MM-DD' ) );
|
|
3576
3576
|
const storeLayout = await Promise.all(
|
|
3577
3577
|
planograms.map( async ( planogram ) => {
|
|
3578
3578
|
const floors = await storeBuilderService.find(
|
|
@@ -3640,7 +3640,7 @@ export async function storeFixturesTaskv2( req, res ) {
|
|
|
3640
3640
|
},
|
|
3641
3641
|
},
|
|
3642
3642
|
{
|
|
3643
|
-
$sort: {
|
|
3643
|
+
$sort: { _id: -1 },
|
|
3644
3644
|
},
|
|
3645
3645
|
{
|
|
3646
3646
|
$limit: 1,
|
|
@@ -3771,7 +3771,7 @@ export async function storeFixturesTaskv2( req, res ) {
|
|
|
3771
3771
|
},
|
|
3772
3772
|
},
|
|
3773
3773
|
{
|
|
3774
|
-
$sort: {
|
|
3774
|
+
$sort: { _id: -1 },
|
|
3775
3775
|
},
|
|
3776
3776
|
{
|
|
3777
3777
|
$limit: 1,
|
|
@@ -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
|
},
|