tango-app-api-store-builder 1.0.0-beta-156 → 1.0.0-beta-158
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
|
@@ -7400,7 +7400,7 @@ export async function migrateCrestv1( req, res ) {
|
|
|
7400
7400
|
clientId: '11',
|
|
7401
7401
|
$and: [
|
|
7402
7402
|
{ storeName: req.body.storeName },
|
|
7403
|
-
// { storeName: { $in: [
|
|
7403
|
+
// { storeName: { $in: [ 'LKST1324', 'LKST495' ] } },
|
|
7404
7404
|
// { storeName: { $nin: [ 'LKST98', 'LKST1193' ] } },
|
|
7405
7405
|
],
|
|
7406
7406
|
};
|
|
@@ -7430,15 +7430,15 @@ export async function migrateCrestv1( req, res ) {
|
|
|
7430
7430
|
|
|
7431
7431
|
const existingPlanogram = await planoService.findOne( { storeName: storeData.storeName } );
|
|
7432
7432
|
|
|
7433
|
-
if ( existingPlanogram ) {
|
|
7434
|
-
|
|
7433
|
+
// if ( existingPlanogram ) {
|
|
7434
|
+
// const checkTaskSubmitted = await planoTaskService.findOne( { planoId: existingPlanogram.toObject()._id } );
|
|
7435
7435
|
|
|
7436
|
-
|
|
7436
|
+
// const checkTaskCreated = await processedTaskService.findOne( { storeName: storeData.storeName, date_string: dayjs().format( 'YYYY-MM-DD' ), isPlano: true } );
|
|
7437
7437
|
|
|
7438
|
-
|
|
7439
|
-
|
|
7440
|
-
|
|
7441
|
-
}
|
|
7438
|
+
// if ( checkTaskSubmitted || checkTaskCreated ) {
|
|
7439
|
+
// continue;
|
|
7440
|
+
// }
|
|
7441
|
+
// }
|
|
7442
7442
|
|
|
7443
7443
|
|
|
7444
7444
|
if ( existingPlanogram?.toObject()?._id && mongoose.Types.ObjectId.isValid( existingPlanogram?.toObject()?._id ) ) {
|
|
@@ -1451,6 +1451,8 @@ export async function updateMissing( req, res ) {
|
|
|
1451
1451
|
|
|
1452
1452
|
if ( !fixtureShelves.length ) return res.sendError( 'No shelves found for the fixture', 204 );
|
|
1453
1453
|
|
|
1454
|
+
console.log('called')
|
|
1455
|
+
|
|
1454
1456
|
await Promise.all(
|
|
1455
1457
|
fixtureShelves.map( async ( shelf ) => {
|
|
1456
1458
|
const productMappings = await planoMappingService.find( { shelfId: shelf._id } );
|
|
@@ -1459,18 +1461,18 @@ export async function updateMissing( req, res ) {
|
|
|
1459
1461
|
return { ...shelf.toObject(), products: [] };
|
|
1460
1462
|
}
|
|
1461
1463
|
|
|
1462
|
-
const productIds = productMappings.map( ( mapping ) => mapping.productId );
|
|
1463
|
-
const products = await planoProductService.find( { _id: { $in: productIds } } );
|
|
1464
|
-
const productMap = new Map( products.map( ( product ) => [ product._id.toString(), product.toObject() ] ) );
|
|
1464
|
+
// const productIds = productMappings.map( ( mapping ) => mapping.productId );
|
|
1465
|
+
// const products = await planoProductService.find( { _id: { $in: productIds } } );
|
|
1466
|
+
// const productMap = new Map( products.map( ( product ) => [ product._id.toString(), product.toObject() ] ) );
|
|
1465
1467
|
|
|
1466
1468
|
const currentDate = new Date( dayjs().format( 'YYYY-MM-DD' ) );
|
|
1467
1469
|
|
|
1468
1470
|
await Promise.all(
|
|
1469
1471
|
productMappings.map( async ( mapping ) => {
|
|
1470
|
-
const productData = productMap.get( mapping
|
|
1471
|
-
if ( !productData ) {
|
|
1472
|
-
|
|
1473
|
-
}
|
|
1472
|
+
// const productData = productMap.get( mapping?.productId?.toString() );
|
|
1473
|
+
// if ( !productData ) {
|
|
1474
|
+
// return { ...mapping.toObject(), status: '' };
|
|
1475
|
+
// }
|
|
1474
1476
|
|
|
1475
1477
|
const mappingCompliance = await planoComplianceService.findOne( {
|
|
1476
1478
|
planoMappingId: mapping._id,
|
|
@@ -1484,7 +1486,7 @@ export async function updateMissing( req, res ) {
|
|
|
1484
1486
|
|
|
1485
1487
|
return {
|
|
1486
1488
|
...mapping.toObject(),
|
|
1487
|
-
...productData,
|
|
1489
|
+
// ...productData,
|
|
1488
1490
|
};
|
|
1489
1491
|
} ),
|
|
1490
1492
|
);
|