tango-app-api-store-builder 1.0.0-beta-2 → 1.0.0-beta-3
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.0-beta-
|
|
3
|
+
"version": "1.0.0-beta-3",
|
|
4
4
|
"description": "storeBuilder",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"joi": "^17.13.3",
|
|
24
24
|
"mongodb": "^6.12.0",
|
|
25
25
|
"nodemon": "^3.1.9",
|
|
26
|
-
"tango-api-schema": "^2.2.
|
|
26
|
+
"tango-api-schema": "^2.2.27",
|
|
27
27
|
"tango-app-api-middleware": "^3.1.48",
|
|
28
28
|
"winston": "^3.17.0",
|
|
29
29
|
"winston-daily-rotate-file": "^5.0.0"
|
|
@@ -512,22 +512,13 @@ export async function fixtureShelfProduct( req, res ) {
|
|
|
512
512
|
}
|
|
513
513
|
let planoDetails = await planoService.findOne( { _id: fixtureDetails.planoId } );
|
|
514
514
|
let shelfDetails = await fixtureShelfService.find( { fixtureId: req.body.fixtureId } );
|
|
515
|
-
let shelfId = shelfDetails.map( ( ele ) => ele._id );
|
|
516
515
|
let query;
|
|
517
516
|
switch ( planoDetails.productResolutionLevel ) {
|
|
518
517
|
case 'L1':
|
|
519
518
|
query = { floorId: fixtureDetails.floorId };
|
|
520
519
|
break;
|
|
521
|
-
case 'L2':
|
|
522
|
-
query = { floorId: fixtureDetails.floorId, fixtureId: req.body.fixtureId };
|
|
523
|
-
break;
|
|
524
|
-
case 'L3':
|
|
525
|
-
query = { floorId: fixtureDetails.floorId, fixtureId: req.body.fixtureId, shelfId: { $in: shelfId } };
|
|
526
|
-
break;
|
|
527
|
-
case 'L4':
|
|
528
|
-
query = { floorId: fixtureDetails.floorId, fixtureId: req.body.fixtureId, shelfId: { $in: shelfId } };
|
|
529
|
-
break;
|
|
530
520
|
default:
|
|
521
|
+
query = { floorId: fixtureDetails.floorId, fixtureId: req.body.fixtureId };
|
|
531
522
|
break;
|
|
532
523
|
}
|
|
533
524
|
let shelfList = [];
|
|
@@ -536,11 +527,19 @@ export async function fixtureShelfProduct( req, res ) {
|
|
|
536
527
|
let productMappingDetails = await planoMappingService.find( { shelfId: shelf._id } );
|
|
537
528
|
let productIdList = productMappingDetails.map( ( item ) => item.productId );
|
|
538
529
|
let productDetails = await planoProductService.find( { _id: productIdList } );
|
|
539
|
-
|
|
530
|
+
query = {
|
|
531
|
+
...query,
|
|
532
|
+
...(['L3','L4'].includes(planoDetails.productResolutionLevel)) ? {shelfId:shelf._id} : {},
|
|
533
|
+
productId: { $in: productIdList },
|
|
534
|
+
createdAt: { $gte: dayjs().startOf( 'day' ).format(), $lte: dayjs().endOf( 'day' ).format() },
|
|
535
|
+
};
|
|
536
|
+
let productComplianceDetails = await planoComplianceService.find( query );
|
|
540
537
|
let product = [];
|
|
541
538
|
productDetails.forEach( ( item ) => {
|
|
542
539
|
let data = { ...item._doc, status: 'missing' };
|
|
543
|
-
let findCompliance = productComplianceDetails.find( ( ele ) =>
|
|
540
|
+
let findCompliance = productComplianceDetails.find( ( ele ) => {
|
|
541
|
+
if()
|
|
542
|
+
});
|
|
544
543
|
if ( findCompliance ) {
|
|
545
544
|
data.status = findCompliance.compliance;
|
|
546
545
|
}
|