tango-app-api-store-builder 1.0.0-beta-221 → 1.0.0-beta-223

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.
Files changed (33) hide show
  1. package/{logs.json → data/logs.json} +2 -2
  2. package/{missing_stores.json → data/missing_stores.json} +2 -2
  3. package/package.json +2 -2
  4. package/src/controllers/fixtureTemplate.controller.js +2 -7
  5. package/src/controllers/managePlano.controller.js +0 -3
  6. package/src/controllers/planoLibrary.controller.js +39 -0
  7. package/src/controllers/script.controller.js +83 -81
  8. package/src/controllers/storeBuilder.controller.js +930 -18
  9. package/src/controllers/task.controller.js +0 -7
  10. package/src/dtos/validation.dtos.js +1 -0
  11. package/src/routes/fixtureTemplate.routes.js +19 -18
  12. package/src/routes/managePlano.routes.js +21 -21
  13. package/src/routes/planoLibrary.routes.js +28 -28
  14. package/src/routes/script.routes.js +37 -36
  15. package/src/routes/storeBuilder.routes.js +45 -42
  16. package/src/routes/task.routes.js +13 -13
  17. package/src/service/storeFixture.service.js +0 -1
  18. package/src/service/storeFixtureDuplicate.service.js +0 -2
  19. package/Euro.xlsx +0 -0
  20. package/failure_cases.json +0 -2
  21. package/inputjson/layoutverification.json +0 -465
  22. /package/{Bitz_Final_Store_List_28.08.25.xlsx → data/Bitz_Final_Store_List_28.08.25.xlsx} +0 -0
  23. /package/{Coastline 3.0 Tango.xlsx → data/Coastline 3.0 Tango.xlsx} +0 -0
  24. /package/{Fixture capacity.xlsx → data/Fixture capacity.xlsx} +0 -0
  25. /package/{JJ_OD New Launch_Tango.xlsx → data/JJ_OD New Launch_Tango.xlsx} +0 -0
  26. /package/{LKST 98 - Inventory Analysis.xlsx → data/LKST 98 - Inventory Analysis.xlsx} +0 -0
  27. /package/{OE_Vs_NON_OE_UPDATED.xlsx → data/OE_Vs_NON_OE_UPDATED.xlsx} +0 -0
  28. /package/{Sale, Non sale stores.xlsx → data/Sale, Non sale stores.xlsx} +0 -0
  29. /package/{Updated IVM New Fixture Flow-v8.xlsx → data/Updated IVM New Fixture Flow-v8.xlsx} +0 -0
  30. /package/{VM_logic.xlsx → data/VM_logic.xlsx} +0 -0
  31. /package/{euro_center_stores_tentpole.xls → data/euro_center_stores_tentpole.xls} +0 -0
  32. /package/{ivmLogic.json → data/ivmLogic.json} +0 -0
  33. /package/{response.json → data/response.json} +0 -0
@@ -1,3 +1,3 @@
1
- [
2
-
1
+ [
2
+
3
3
  ]
@@ -1,3 +1,3 @@
1
- [
2
-
1
+ [
2
+
3
3
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-store-builder",
3
- "version": "1.0.0-beta-221",
3
+ "version": "1.0.0-beta-223",
4
4
  "description": "storeBuilder",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -32,7 +32,7 @@
32
32
  "path": "^0.12.7",
33
33
  "selenium-webdriver": "^4.31.0",
34
34
  "sharp": "^0.34.1",
35
- "tango-api-schema": "^2.4.14",
35
+ "tango-api-schema": "^2.4.18",
36
36
  "tango-app-api-middleware": "3.1.48",
37
37
  "url": "^0.11.4",
38
38
  "winston": "^3.17.0",
@@ -20,6 +20,7 @@ dayjs.extend( customParseFormat );
20
20
  export async function createTemplate( req, res ) {
21
21
  try {
22
22
  let inputData = req.body;
23
+ const templateType = inputData?.templateType ?? 'sub';
23
24
  let getLibDetails = await fixtureLibService.findOne( { _id: inputData.fixtureLibraryId, clientId: inputData.clientId } );
24
25
  if ( !getLibDetails ) {
25
26
  return res.sendError( 'Fixture library id is wrong', 400 );
@@ -47,6 +48,7 @@ export async function createTemplate( req, res ) {
47
48
  value: 1220,
48
49
  unit: 'mm',
49
50
  },
51
+ templateType: templateType,
50
52
  templateIndex: parseInt( templateId.split( '-' )[1] ),
51
53
  };
52
54
  let fixtureData = await fixtureConfigService.create( templateData );
@@ -578,7 +580,6 @@ export async function getFixtureTemplate( req, res ) {
578
580
  if ( templateDoc?.vmConfig?.length ) {
579
581
  templateDoc.vmConfig = await Promise.all( templateDoc.vmConfig.map( async ( vm ) => {
580
582
  let vmDetails = await vmService.findOne( { _id: vm.vmId } );
581
- console.log( vmDetails );
582
583
  if ( vmDetails ) {
583
584
  vm = { ...vm, ...vmDetails.toObject() };
584
585
  return vm;
@@ -669,7 +670,6 @@ export async function TemplateStoresList( req, res ) {
669
670
  let limit = inputData?.limit || 10;
670
671
  let page = inputData?.offset || 1;
671
672
  let skip = limit * ( page - 1 );
672
- console.log( skip, limit );
673
673
 
674
674
  query.push( {
675
675
  $match: {
@@ -931,17 +931,12 @@ export async function replaceFixtureDetails( req, res ) {
931
931
  storeId: store.storeId,
932
932
  } );
933
933
 
934
- // console.log( replaceFixture );
935
934
 
936
935
  if ( !replaceFixture.length ) return;
937
936
 
938
- // console.log( replaceFixture._id );
939
-
940
937
  const deleteFixShelves = await fixtureShelfService.deleteMany( {
941
938
  fixtureId: { $in: replaceFixture.map( ( ele ) => ele._id ) },
942
939
  } );
943
- console.log( deleteFixShelves );
944
-
945
940
  await storeFixtureService.updateMany(
946
941
  { fixtureConfigId: inputData.findFixture, ...( store?.floorDetails?._id ) ? { floorId: store?.floorDetails?._id } : {}, storeId: store.storeId },
947
942
  updateData,
@@ -187,7 +187,6 @@ export async function getplanoFeedbackv1( req, res ) {
187
187
  }
188
188
 
189
189
  function buildPipelineByType( type, planoId, floorId, filterByStatus, filterByApprovalStatus, showtask, taskId = 0 ) {
190
- console.log( type, planoId, floorId, filterByStatus );
191
190
  const matchStage = {
192
191
  $match: {
193
192
  planoId: new mongoose.Types.ObjectId( planoId ),
@@ -430,7 +429,6 @@ function buildPipelineByType( type, planoId, floorId, filterByStatus, filterByAp
430
429
  }
431
430
 
432
431
  function buildPipelineByType1( type, planoId, floorId, filterByStatus, filterByApprovalStatus, showtask, taskId = 0 ) {
433
- console.log( type, planoId, floorId, filterByStatus );
434
432
  const matchStage = {
435
433
  $match: {
436
434
  planoId: new mongoose.Types.ObjectId( planoId ),
@@ -1984,6 +1982,5 @@ function pipelineStage( type, planoId, floorId, filterByStatus, filterByApproval
1984
1982
  { $sort: { _id: 1 } },
1985
1983
  ];
1986
1984
 
1987
- console.log( JSON.stringify( pipeline, 'pipeline' ) );
1988
1985
  return pipeline;
1989
1986
  }
@@ -1437,6 +1437,45 @@ export async function fixtureNameList( req, res ) {
1437
1437
  }
1438
1438
  }
1439
1439
 
1440
+ export async function fixtureLibNameList( req, res ) {
1441
+ try {
1442
+ let getFixtureDetails = await planoLibraryService.aggregate( [
1443
+ {
1444
+ $match: {
1445
+ clientId: req.query.clientId,
1446
+ status: 'complete',
1447
+ },
1448
+ },
1449
+ {
1450
+ $group: {
1451
+ _id: '',
1452
+ fixtureDetails: {
1453
+ $push: { fixtureName: {
1454
+ $concat: [
1455
+ '$fixtureCategory',
1456
+ ' - ',
1457
+ { $toString: '$fixtureWidth.value' },
1458
+ '$fixtureWidth.unit',
1459
+ ] }, id: '$_id',
1460
+ },
1461
+ },
1462
+ },
1463
+ },
1464
+ {
1465
+ $project: {
1466
+ _id: 1,
1467
+ fixtureDetails: 1,
1468
+ },
1469
+ },
1470
+ ] );
1471
+
1472
+ return res.sendSuccess( getFixtureDetails?.[0]?.fixtureDetails || [] );
1473
+ } catch ( e ) {
1474
+ logger.error( { functionName: 'fixtureNameList', error: e } );
1475
+ return res.sendError( e, 500 );
1476
+ }
1477
+ }
1478
+
1440
1479
  export async function vmNameList( req, res ) {
1441
1480
  try {
1442
1481
  let getVmDetails = await vmService.find( { clientId: req.query.clientId, status: 'complete' }, { vmName: 1, vmWidth: 1, vmHeight: 1, vmImageUrl: 1, vmType: 1 } );
@@ -2327,7 +2327,7 @@ async function scrapeCrest() {
2327
2327
  const storeIds = [ 'LKST4080' ];
2328
2328
  const apiUrl = 'https://api.getcrest.ai/api/ms_shelfsensei/layout/';
2329
2329
  const bearerToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzYwMDA1MTY3LCJpYXQiOjE3NjAwMDE1NjcsImp0aSI6IjJiZmVjNzI2NDE3OTRjMDRhMjQ1OWVhMmMxOTExNzUyIiwidXNlcl9pZCI6MTA4NSwiaWQiOjEwODUsImlzX21lZXNlZWtfYWNjb3VudCI6ZmFsc2UsImN1c3RvbWVyX2dyb3VwIjozOTgsImlzX2NyZXN0X2xpdGVfdXNlciI6ZmFsc2UsImlzX3ZlbmRvcl91c2VyIjpmYWxzZSwibGljZW5jZV9zY29wZXMiOlt7InJlc291cmNlX3NldCI6InBwX3NldCIsInNjb3BlX3JvbGUiOiJjb250cmlidXRvciJ9LHsicmVzb3VyY2Vfc2V0IjoiZHBfc2V0Iiwic2NvcGVfcm9sZSI6ImNvbnRyaWJ1dG9yIn0seyJyZXNvdXJjZV9zZXQiOiJkZl9zZXQiLCJzY29wZV9yb2xlIjoiY29udHJpYnV0b3IifSx7InJlc291cmNlX3NldCI6ImRlZmF1bHRfc2V0Iiwic2NvcGVfcm9sZSI6ImNvbnRyaWJ1dG9yIn1dfQ.Yn2dkM3BYaHeoA9vpYCFKB0XK4pUpVD6NGT2rEOXJSs';
2330
- const filePath = 'response.json';
2330
+ const filePath = './data/response.json';
2331
2331
  let allResults = [];
2332
2332
 
2333
2333
  if ( fs.existsSync( filePath ) ) {
@@ -9269,7 +9269,7 @@ export async function migrateCrestv1( req, res ) {
9269
9269
 
9270
9270
 
9271
9271
  // try {
9272
- // const raw = await readFile('response.json', 'utf-8');
9272
+ // const raw = await readFile('./data/response.json', 'utf-8');
9273
9273
  // const json = JSON.parse(raw);
9274
9274
 
9275
9275
  // const resultArray = json;
@@ -9704,97 +9704,96 @@ function transformProducts( products, shelvesByZone, fixtureData ) {
9704
9704
 
9705
9705
  // ---------------------Plano Migrate-------------------------
9706
9706
 
9707
- export async function getAllPlanoIds(req, res){
9707
+ export async function getAllPlanoIds( req, res ) {
9708
9708
  try {
9709
-
9710
- if (!req.query?.clientId) {
9711
- return res.sendError('Client id is required', 400);
9709
+ if ( !req.query?.clientId ) {
9710
+ return res.sendError( 'Client id is required', 400 );
9712
9711
  }
9713
- const floorsData = await storeBuilderService.aggregate([
9712
+ const floorsData = await storeBuilderService.aggregate( [
9714
9713
  {
9715
- '$match': {
9716
- 'clientId': '11'
9717
- }
9714
+ '$match': {
9715
+ 'clientId': '11',
9716
+ },
9718
9717
  }, {
9719
- '$group': {
9720
- '_id': '$planoId',
9721
- 'storeName': {
9722
- '$first': '$storeName'
9718
+ '$group': {
9719
+ '_id': '$planoId',
9720
+ 'storeName': {
9721
+ '$first': '$storeName',
9722
+ },
9723
+ 'storeId': {
9724
+ '$first': '$storeId',
9725
+ },
9723
9726
  },
9724
- 'storeId': {
9725
- '$first': '$storeId'
9726
- }
9727
- }
9728
- }, {
9729
- '$project': {
9730
- 'planoId': '$_id',
9731
- 'storeName': 1,
9732
- 'storeId': 1
9733
- }
9734
9727
  }, {
9735
- '$sort': { storeName: 1 }
9736
- }
9737
- ]);
9728
+ '$project': {
9729
+ 'planoId': '$_id',
9730
+ 'storeName': 1,
9731
+ 'storeId': 1,
9732
+ },
9733
+ }, {
9734
+ '$sort': { storeName: 1 },
9735
+ },
9736
+ ] );
9738
9737
 
9739
- if (floorsData) {
9740
- return res.sendSuccess(floorsData);
9738
+ if ( floorsData ) {
9739
+ return res.sendSuccess( floorsData );
9741
9740
  } else {
9742
- return res.sendError("No floor data found", 204)
9741
+ return res.sendError( "No floor data found", 204 );
9743
9742
  }
9744
- } catch (error) {
9745
- console.log("@@ ~ getAllPlanoIds [ERR]:", error);
9746
- return res.sendError(e, 500);
9743
+ } catch ( error ) {
9744
+ console.log( "@@ ~ getAllPlanoIds [ERR]:", error );
9745
+ return res.sendError( e, 500 );
9747
9746
  }
9748
9747
  }
9749
9748
 
9750
- export async function createComplianceFromMappins(req, res) {
9749
+ export async function createComplianceFromMappins( req, res ) {
9751
9750
  try {
9752
9751
  const { planoId, fixtureId } = req.body;
9753
9752
 
9754
- if (!planoId) {
9755
- res.sendError('PlanoId is required', 400);
9753
+ if ( !planoId ) {
9754
+ res.sendError( 'PlanoId is required', 400 );
9756
9755
  }
9757
9756
 
9758
- if (!fixtureId) {
9759
- res.sendError('FixtureId is required', 400);
9757
+ if ( !fixtureId ) {
9758
+ res.sendError( 'FixtureId is required', 400 );
9760
9759
  }
9761
9760
 
9762
- const allMappings = await planoMappingService.find({ planoId: planoId, fixtureId: fixtureId, type: 'product' });
9761
+ const allMappings = await planoMappingService.find( { planoId: planoId, fixtureId: fixtureId, type: 'product' } );
9763
9762
 
9764
9763
  const allCompliance = [];
9765
9764
 
9766
- for (let i = 0; i < allMappings.length; i++) {
9765
+ for ( let i = 0; i < allMappings.length; i++ ) {
9767
9766
  const mapping = allMappings[i];
9768
9767
  const complianceDoc = {
9769
9768
  "clientId": "11",
9770
9769
  "storeName": "LKST2255",
9771
9770
  "storeId": "11-1984",
9772
9771
  "type": "product",
9773
- "planoId": new mongoose.Types.ObjectId(mapping.planoId),
9774
- "floorId": new mongoose.Types.ObjectId(mapping.floorId),
9775
- "fixtureId": new mongoose.Types.ObjectId(mapping.fixtureId),
9776
- "shelfId": new mongoose.Types.ObjectId(mapping.shelfId),
9777
- "productId": new mongoose.Types.ObjectId(mapping.productId),
9772
+ "planoId": new mongoose.Types.ObjectId( mapping.planoId ),
9773
+ "floorId": new mongoose.Types.ObjectId( mapping.floorId ),
9774
+ "fixtureId": new mongoose.Types.ObjectId( mapping.fixtureId ),
9775
+ "shelfId": new mongoose.Types.ObjectId( mapping.shelfId ),
9776
+ "productId": new mongoose.Types.ObjectId( mapping.productId ),
9778
9777
  "rfId": "CCC094850431",
9779
9778
  "compliance": "proper",
9780
9779
  "date": new Date(),
9781
- "planoMappingId": new mongoose.Types.ObjectId(mapping._id)
9780
+ "planoMappingId": new mongoose.Types.ObjectId( mapping._id ),
9782
9781
  };
9783
9782
 
9784
- const res = await planoComplianceService.create(complianceDoc);
9785
- if (res) {
9786
- allCompliance.push(res);
9783
+ const res = await planoComplianceService.create( complianceDoc );
9784
+ if ( res ) {
9785
+ allCompliance.push( res );
9787
9786
  }
9788
9787
  }
9789
9788
 
9790
- if (allCompliance) {
9791
- return res.sendSuccess({ mappings: allCompliance, count: allCompliance.length });
9789
+ if ( allCompliance ) {
9790
+ return res.sendSuccess( { mappings: allCompliance, count: allCompliance.length } );
9792
9791
  } else {
9793
- return res.sendError("No mapping data found", 204)
9792
+ return res.sendError( "No mapping data found", 204 );
9794
9793
  }
9795
- } catch (error) {
9796
- console.log("@@ ~ createComplianceFromMappins [ERR]: ", error);
9797
- return res.sendError(e, 500);
9794
+ } catch ( error ) {
9795
+ console.log( "@@ ~ createComplianceFromMappins [ERR]: ", error );
9796
+ return res.sendError( e, 500 );
9798
9797
  }
9799
9798
  }
9800
9799
 
@@ -9804,11 +9803,11 @@ export async function migrateOvmToIvm( req, res ) {
9804
9803
  return res.sendError( 'Unauthorized', 401 );
9805
9804
  }
9806
9805
 
9807
- const ivmLogicJson = fs.readFileSync( 'ivmLogic.json', 'utf8' );
9806
+ const ivmLogicJson = fs.readFileSync( './data/ivmLogic.json', 'utf8' );
9808
9807
  const ivmLogic = JSON.parse( ivmLogicJson );
9809
9808
 
9810
9809
 
9811
- const saleWorkbook = xlsx.readFile( './OE_Vs_NON_OE_UPDATED.xlsx' );
9810
+ const saleWorkbook = xlsx.readFile( './data/OE_Vs_NON_OE_UPDATED.xlsx' );
9812
9811
 
9813
9812
  const saleSheetName = saleWorkbook.SheetNames[0];
9814
9813
  const saleSheet = saleWorkbook.Sheets[saleSheetName];
@@ -9818,7 +9817,7 @@ export async function migrateOvmToIvm( req, res ) {
9818
9817
  const saleData = JSON.parse( JSON.stringify( saleJsonData, null, 2 ) );
9819
9818
 
9820
9819
 
9821
- const euroMappingWorkbook = xlsx.readFile( './VM_logic.xlsx' );
9820
+ const euroMappingWorkbook = xlsx.readFile( './data/VM_logic.xlsx' );
9822
9821
  const euroMappingSheet = euroMappingWorkbook.Sheets['Eurocentre mapping'];
9823
9822
 
9824
9823
 
@@ -9832,7 +9831,7 @@ export async function migrateOvmToIvm( req, res ) {
9832
9831
 
9833
9832
  const euroMappingData = JSON.parse( JSON.stringify( euroMappingFiltered, null, 2 ) );
9834
9833
 
9835
- const mbqWorkbook = xlsx.readFile( './Fixture capacity.xlsx' );
9834
+ const mbqWorkbook = xlsx.readFile( './data/Fixture capacity.xlsx' );
9836
9835
 
9837
9836
  const mbqSheetName = mbqWorkbook.SheetNames[0];
9838
9837
  const mbqSheet = mbqWorkbook.Sheets[mbqSheetName];
@@ -9841,7 +9840,7 @@ export async function migrateOvmToIvm( req, res ) {
9841
9840
 
9842
9841
  const mbqData = JSON.parse( JSON.stringify( mbqJsonData, null, 2 ) );
9843
9842
 
9844
- const strategyWorkbook = xlsx.readFile( './Updated IVM New Fixture Flow-v8.xlsx' );
9843
+ const strategyWorkbook = xlsx.readFile( './data/Updated IVM New Fixture Flow-v8.xlsx' );
9845
9844
 
9846
9845
  const combinationFixturesSheetName = 'Combined fixture logic';
9847
9846
  const combinationFixtureSheet = strategyWorkbook.Sheets[combinationFixturesSheetName];
@@ -9857,7 +9856,7 @@ export async function migrateOvmToIvm( req, res ) {
9857
9856
 
9858
9857
  const tentpoleEurocentreFixtureData = JSON.parse( JSON.stringify( tentpoleEurocentreJsonData, null, 2 ) );
9859
9858
 
9860
- const tentpoleCollectionsWorkbook = xlsx.readFile( './euro_center_stores_tentpole.xls' );
9859
+ const tentpoleCollectionsWorkbook = xlsx.readFile( './data/euro_center_stores_tentpole.xls' );
9861
9860
 
9862
9861
  const tentpoleCollectionsSheetName = tentpoleCollectionsWorkbook.SheetNames[0];
9863
9862
  const tentpoleCollectionsSheet = tentpoleCollectionsWorkbook.Sheets[tentpoleCollectionsSheetName];
@@ -10351,7 +10350,7 @@ export async function migrateOvmToIvm( req, res ) {
10351
10350
  header: fixture.header.label,
10352
10351
  };
10353
10352
 
10354
- writeLog( data, './failure_cases.json' );
10353
+ writeLog( data, './data/failure_cases.json' );
10355
10354
  // console.log( unknown );
10356
10355
  return 'skip-store';
10357
10356
  }
@@ -10796,7 +10795,7 @@ export async function migrateOvmToIvm( req, res ) {
10796
10795
 
10797
10796
 
10798
10797
  const updateEuroCollections = ( fixtures, tentpoleCollectionsData, tentpoleEurocentreFixtureData ) => {
10799
- fixtures = sortFunc( fixtures )
10798
+ fixtures = sortFunc( fixtures );
10800
10799
  let tentpoleCount = 1;
10801
10800
  for ( let i = 0; i < fixtures.length; i++ ) {
10802
10801
  const fixture = fixtures[i];
@@ -10839,9 +10838,9 @@ export async function migrateOvmToIvm( req, res ) {
10839
10838
  if ( !collection ) {
10840
10839
  const tentpoleCol = tentpoleEurocentreFixtureData.find( ( data ) => data?.['Store Code'] === fixture.storeName );
10841
10840
 
10842
- if(tentpoleCount === 1){
10841
+ if ( tentpoleCount === 1 ) {
10843
10842
  collection = tentpoleCol?.Tentpole_1;
10844
- }else if(tentpoleCount === 2){
10843
+ } else if ( tentpoleCount === 2 ) {
10845
10844
  collection = tentpoleCol?.Tentpole_2;
10846
10845
  }
10847
10846
  }
@@ -10874,7 +10873,7 @@ export async function migrateOvmToIvm( req, res ) {
10874
10873
  } );
10875
10874
  }
10876
10875
 
10877
- tentpoleCount += 1
10876
+ tentpoleCount += 1;
10878
10877
  }
10879
10878
  }
10880
10879
  }
@@ -11226,7 +11225,7 @@ export async function migrateOvmToIvm( req, res ) {
11226
11225
  bottomCat: bottomCat,
11227
11226
  store: floor.storeName,
11228
11227
  };
11229
- writeLog( logData, './logs.json' );
11228
+ writeLog( logData, '.data/logs.json' );
11230
11229
  }
11231
11230
 
11232
11231
  console.log( topCat, bottomCat, 'final top and bottom' );
@@ -11259,7 +11258,7 @@ export async function migrateOvmToIvm( req, res ) {
11259
11258
  // sale: isSale,
11260
11259
  // };
11261
11260
 
11262
- // writeLog( logData, './logs.json' );
11261
+ // writeLog( logData, './data/logs.json' );
11263
11262
 
11264
11263
 
11265
11264
  if ( group === "VC Eye / LK Air" && isSale ) {
@@ -11415,7 +11414,7 @@ export async function migrateOvmToIvm( req, res ) {
11415
11414
  // count: groupFixtures.length,
11416
11415
  // };
11417
11416
 
11418
- // writeLog( logData, './logs.json' );
11417
+ // writeLog( logData, './data/logs.json' );
11419
11418
 
11420
11419
 
11421
11420
  if ( floorFixtures.some( ( fixture ) => fixture._id === fixtureTarget._id ) ) {
@@ -11985,7 +11984,7 @@ export async function migrateOvmToIvm( req, res ) {
11985
11984
 
11986
11985
 
11987
11986
  export async function updateFixtureDetails() {
11988
- const mbqWorkbook = xlsx.readFile( './Fixture capacity.xlsx' );
11987
+ const mbqWorkbook = xlsx.readFile( './data/Fixture capacity.xlsx' );
11989
11988
 
11990
11989
  const mbqSheetName = mbqWorkbook.SheetNames[0];
11991
11990
  const mbqSheet = mbqWorkbook.Sheets[mbqSheetName];
@@ -12556,7 +12555,7 @@ export async function groupFixture( req, res ) {
12556
12555
  }
12557
12556
  }
12558
12557
  async function updateBlitzCollection() {
12559
- const blitzWorkbook = xlsx.readFile( './Bitz_Final_Store_List_28.08.25.xlsx' );
12558
+ const blitzWorkbook = xlsx.readFile( './data/Bitz_Final_Store_List_28.08.25.xlsx' );
12560
12559
 
12561
12560
  const blitzSheetName = blitzWorkbook.SheetNames[0];
12562
12561
  const blitzSheet = blitzWorkbook.Sheets[blitzSheetName];
@@ -13003,7 +13002,7 @@ async function updateBlitzCollection() {
13003
13002
  xlsx.utils.book_append_sheet( workbook, worksheet, "Euro" );
13004
13003
 
13005
13004
  const buffer = xlsx.write( workbook, { type: "buffer", bookType: "xlsx" } );
13006
- fs.writeFileSync( "Euro.xlsx", buffer );
13005
+ fs.writeFileSync( "./data/Euro.xlsx", buffer );
13007
13006
 
13008
13007
  console.log( `Excel file written with ${exportData.length} rows.` );
13009
13008
  } else {
@@ -13015,7 +13014,7 @@ async function updateBlitzCollection() {
13015
13014
 
13016
13015
 
13017
13016
  async function updateFixtureGroupNumber( ) {
13018
- const ivmLogicJson = fs.readFileSync( 'ivmLogic.json', 'utf8' );
13017
+ const ivmLogicJson = fs.readFileSync( './data/ivmLogic.json', 'utf8' );
13019
13018
  const ivmLogic = JSON.parse( ivmLogicJson );
13020
13019
  const strategyWorkbook = xlsx.readFile( './Updated IVM New Fixture Flow-v4.xlsx' );
13021
13020
 
@@ -13342,7 +13341,7 @@ async function deriveMasterTemplatesFromStoreFixtures() {
13342
13341
 
13343
13342
 
13344
13343
  async function updateProductCategories() {
13345
- const ivmLogicJson = fs.readFileSync( 'ivmLogic.json', 'utf8' );
13344
+ const ivmLogicJson = fs.readFileSync( './data/ivmLogic.json', 'utf8' );
13346
13345
  const ivmLogic = JSON.parse( ivmLogicJson );
13347
13346
 
13348
13347
  ivmLogic.pidOneEu.forEach( ( logic ) => {
@@ -13533,7 +13532,7 @@ async function getTrendingFixtureSizes() {
13533
13532
  }
13534
13533
 
13535
13534
  async function updateJJCollection() {
13536
- const workbook = xlsx.readFile( './JJ_OD New Launch_Tango.xlsx' );
13535
+ const workbook = xlsx.readFile( './data/JJ_OD New Launch_Tango.xlsx' );
13537
13536
 
13538
13537
  const zodiacSheet = workbook.Sheets['Zodiac'];
13539
13538
 
@@ -13732,7 +13731,7 @@ async function updateJJCollection() {
13732
13731
  // updateJJCollection();
13733
13732
 
13734
13733
  async function updateCoastlineCollection() {
13735
- const workbook = xlsx.readFile( './Coastline 3.0 Tango.xlsx' );
13734
+ const workbook = xlsx.readFile( './data/Coastline 3.0 Tango.xlsx' );
13736
13735
 
13737
13736
  const sheetName = 'Sheet1';
13738
13737
  const sheet = workbook.Sheets[sheetName];
@@ -14042,7 +14041,7 @@ async function updateCoastlineCollection() {
14042
14041
  // updateCoastlineCollection();
14043
14042
 
14044
14043
  async function updatePhonicCollection() {
14045
- const workbook = xlsx.readFile( './Coastline 3.0 Tango.xlsx' );
14044
+ const workbook = xlsx.readFile( './data/Coastline 3.0 Tango.xlsx' );
14046
14045
 
14047
14046
  const sheetName = 'Sheet1';
14048
14047
  const sheet = workbook.Sheets[sheetName];
@@ -14382,13 +14381,14 @@ function findMissingStores() {
14382
14381
  }
14383
14382
  } );
14384
14383
 
14385
- writeLog( newStores, './missing_stores.json' );
14384
+ writeLog( newStores, './data/missing_stores.json' );
14386
14385
  }
14387
14386
 
14388
14387
  // findMissingStores()
14389
14388
 
14390
14389
  async function createStores() {
14391
14390
  const storeList = [
14391
+ "Tamsui",
14392
14392
  ];
14393
14393
 
14394
14394
  for ( let index = 0; index < storeList.length; index++ ) {
@@ -14399,7 +14399,7 @@ async function createStores() {
14399
14399
  const planoData = {
14400
14400
  "storeName": storeName,
14401
14401
  "attachments": [],
14402
- "clientId": "11",
14402
+ "clientId": "193",
14403
14403
  "createdBy": new mongoose.Types.ObjectId( '66a78cd82734f4f857cd6db6' ),
14404
14404
  "createdByEmail": "bejan@tangotech.co.in",
14405
14405
  "createdByName": "Bejan",
@@ -14416,7 +14416,7 @@ async function createStores() {
14416
14416
  const storeLayout = {
14417
14417
  "floorNumber": 1,
14418
14418
  "planoId": planogram.toObject()._id,
14419
- "clientId": "11",
14419
+ "clientId": "193",
14420
14420
  "createdBy": new mongoose.Types.ObjectId( '66a78cd82734f4f857cd6db6' ),
14421
14421
  "createdByEmail": "bejan@tangotech.co.in",
14422
14422
  "createdByName": "Bejan",
@@ -14493,7 +14493,7 @@ async function createStores() {
14493
14493
 
14494
14494
 
14495
14495
  async function updateStoreFixtureShelves() {
14496
- const stores = ["LKST223"];
14496
+ const stores = [ "LKST163" ];
14497
14497
 
14498
14498
  for ( let i = 0; i < stores.length; i++ ) {
14499
14499
  const store = stores[i];
@@ -14508,6 +14508,7 @@ async function updateStoreFixtureShelves() {
14508
14508
  for ( let j = 0; j < storeFixtures.length; j++ ) {
14509
14509
  const fixture = storeFixtures[j].toObject();
14510
14510
 
14511
+ // if ( storeFixtures[j].toString() === '68abeaa210e4af67a2b99ae5' ) {
14511
14512
  let library = await fixtureConfigService.findOne( { "fixtureCategory": fixture.fixtureCategory, "fixtureWidth.value": fixture.fixtureWidth.value } );
14512
14513
 
14513
14514
  await fixtureShelfService.deleteMany( { fixtureId: fixture._id } );
@@ -14534,6 +14535,7 @@ async function updateStoreFixtureShelves() {
14534
14535
 
14535
14536
  await fixtureShelfService.create( shelf );
14536
14537
  }
14538
+ // }
14537
14539
  }
14538
14540
  }
14539
14541