tango-app-api-store-builder 1.0.8 → 1.0.9
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
|
@@ -3383,19 +3383,23 @@ export async function fixtureShelfProductv2( req, res ) {
|
|
|
3383
3383
|
|
|
3384
3384
|
|
|
3385
3385
|
if ( req.body?.compliance ) {
|
|
3386
|
-
|
|
3386
|
+
const [ getAllFixtures, getFixtureDetails ] = await Promise.all( [
|
|
3387
|
+
await fixtureShelfService.find( { planoId: fixture.planoId, floorId: fixture.floorId, fixtureId: { $ne: fixtureId } } ),
|
|
3388
|
+
await storeFixtureService.find( { planoId: fixture.planoId, floorId: fixture.floorId, fixtureId: { $ne: fixtureId } }, { _id: 1, fixtureName: 1 } ),
|
|
3389
|
+
] );
|
|
3387
3390
|
|
|
3388
3391
|
shelfMapping = getAllFixtures.reduce( ( acc, ele ) => {
|
|
3389
3392
|
let productList = ele.productBrandName?.toString()?.toLowerCase();
|
|
3390
3393
|
if ( !acc?.[productList] ) {
|
|
3391
3394
|
let findZone = acc?.[productList]?.find( ( prod ) => prod.zone == ele.zone && prod.shelfId.toString() == ele._id.toString() );
|
|
3392
3395
|
if ( !findZone ) {
|
|
3396
|
+
let fixDetails = getFixtureDetails.find( ( fix ) => fix._id.toString() == ele.fixtureId.toString() );
|
|
3393
3397
|
acc[productList] = [
|
|
3394
3398
|
{
|
|
3395
3399
|
zone: ele.zone,
|
|
3396
3400
|
shelfId: ele._id,
|
|
3397
3401
|
fixtureId: ele.fixtureId,
|
|
3398
|
-
fixtureName:
|
|
3402
|
+
fixtureName: fixDetails?.fixtureName,
|
|
3399
3403
|
brandName: ele.productBrandName,
|
|
3400
3404
|
},
|
|
3401
3405
|
];
|