tango-app-api-store-builder 1.0.0-beta-162 → 1.0.0-beta-163
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
|
@@ -559,6 +559,20 @@ export async function updateStatus( req, res ) {
|
|
|
559
559
|
await floorService.updateOne( { _id: new mongoose.Types.ObjectId( taskDetails.floorId ) }, { planoProgress: 100 } );
|
|
560
560
|
}
|
|
561
561
|
}
|
|
562
|
+
|
|
563
|
+
if ( req.body.status == 'submit' && [ 'merchRollout', 'vmRollout' ].includes( taskDetails.planoType ) ) {
|
|
564
|
+
let merchVmTaskDetails = await planoTaskService.find(
|
|
565
|
+
{
|
|
566
|
+
planoId: new mongoose.Types.ObjectId( taskDetails.planoId ),
|
|
567
|
+
floorId: new mongoose.Types.ObjectId( taskDetails.floorId ),
|
|
568
|
+
type: taskDetails.planoType,
|
|
569
|
+
status: 'complete',
|
|
570
|
+
},
|
|
571
|
+
{ fixtureId: 1 },
|
|
572
|
+
);
|
|
573
|
+
let query = taskDetails.planoType == 'merchRollout' ? { isMerchEdited: false } : { isVmEdited: false };
|
|
574
|
+
await storeFixtureService.updateMany( { _id: { $in: merchVmTaskDetails?.map( ( ele ) => ele.fixtureId ) } }, query );
|
|
575
|
+
}
|
|
562
576
|
return res.sendSuccess( 'Task status updated successfully' );
|
|
563
577
|
} catch ( e ) {
|
|
564
578
|
logger.error( { functionName: 'storeLayout', error: e } );
|
|
@@ -669,11 +683,6 @@ export async function updateAnswersv2( req, res ) {
|
|
|
669
683
|
await sendMessageToQueue( `${sqs.url}${sqs.storeBuilder}`, JSON.stringify( sqsData ) );
|
|
670
684
|
}
|
|
671
685
|
|
|
672
|
-
if ( data.status == 'complete' && [ 'merchRollout', 'vmRollout' ].includes( data.type ) ) {
|
|
673
|
-
let query = data.type == 'merchRollout' ? { isMerchEdited: false } : { isVmEdited: false };
|
|
674
|
-
await storeFixtureService.updateOne( { _id: req.body.fixtureId }, query );
|
|
675
|
-
}
|
|
676
|
-
|
|
677
686
|
return res.sendSuccess( 'Fixture details updated successfully' );
|
|
678
687
|
} catch ( e ) {
|
|
679
688
|
logger.error( { functionName: 'updateAnswers', error: e } );
|