tango-app-api-store-builder 1.0.0-beta-151 → 1.0.0-beta-152

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-151",
3
+ "version": "1.0.0-beta-152",
4
4
  "description": "storeBuilder",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -735,6 +735,13 @@ export async function updateStoreFixture( req, res ) {
735
735
  };
736
736
  }
737
737
 
738
+ if ( data.productResolutionLevel == 'L1' ) {
739
+ currentFixtureDoc.productBrandName = [ ...new Set( data.productBrandName.map( ( ele ) => ele ) ) ];
740
+ currentFixtureDoc.productCategory = [ ...new Set( data.productCategory.map( ( ele ) => ele ) ) ];
741
+ currentFixtureDoc.productSubCategory = [ ...new Set( data.productSubCategory.map( ( ele ) => ele ) ) ];
742
+ }
743
+
744
+
738
745
  delete currentFixtureDoc._id;
739
746
 
740
747
 
@@ -534,6 +534,20 @@ export async function updateStatus( req, res ) {
534
534
  if ( req.body.status == 'submit' ) {
535
535
  await processedService.deleteMany( { planoId: taskDetails.planoId, userEmail: taskDetails.userEmail, store_id: taskDetails.store_id, ...( taskDetails?.floorId ) ? { floorId: taskDetails.floorId } : {}, date_iso: { $gt: new Date( dayjs().format( 'YYYY-MM-DD' ) ) } } );
536
536
  }
537
+ let vmTask = await planoTaskService.find(
538
+ {
539
+ planoId: new mongoose.Types.ObjectId( taskDetails.planoId ),
540
+ floorId: new mongoose.Types.ObjectId( taskDetails.floorId ),
541
+ type: 'vm',
542
+ },
543
+
544
+ );
545
+ if ( vmTask.length>0 ) {
546
+ let allTaskDone = vmTask.filter( ( data ) => data.status === 'incomplete' );
547
+ if ( allTaskDone.length === 0 ) {
548
+ await floorService.updateOne( { _id: new mongoose.Types.ObjectId( taskDetails.floorId ) }, { planoProgress: 100 } );
549
+ }
550
+ }
537
551
  return res.sendSuccess( 'Task status updated successfully' );
538
552
  } catch ( e ) {
539
553
  logger.error( { functionName: 'storeLayout', error: e } );
@@ -632,20 +646,7 @@ export async function updateAnswersv2( req, res ) {
632
646
  }
633
647
 
634
648
  await insertOpenSearchData( JSON.parse( process.env.OPENSEARCH ).planotaskcompliances, data );
635
- let vmTask = await planoTaskService.find(
636
- {
637
- planoId: new mongoose.Types.ObjectId( req.body.planoId ),
638
- floorId: new mongoose.Types.ObjectId( req.body.floorId ),
639
- type: 'vm',
640
- },
641
649
 
642
- );
643
- if ( vmTask.length>0 ) {
644
- let allTaskDone = vmTask.filter( ( data ) => data.status === 'incomplete' );
645
- if ( allTaskDone.length === 0 ) {
646
- await floorService.updateOne( { _id: new mongoose.Types.ObjectId( req.body.floorId ) }, { planoProgress: 100 } );
647
- }
648
- }
649
650
  return res.sendSuccess( 'Fixture details updated successfully' );
650
651
  } catch ( e ) {
651
652
  logger.error( { functionName: 'updateAnswers', error: e } );