tango-app-api-store-builder 1.0.56 → 1.0.58

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.56",
3
+ "version": "1.0.58",
4
4
  "description": "storeBuilder",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -12438,9 +12438,9 @@ async function deriveSubTemplatesFromStoreFixtures() {
12438
12438
  for ( let index = 0; index < storeFixtures.length; index++ ) {
12439
12439
  const fixture = storeFixtures[index];
12440
12440
 
12441
- let mapKey = `${fixture.templateGroupName}${fixture.templateGroupMax}${fixture.templateGroupNumber}`;
12441
+ // let mapKey = `${fixture.templateGroupName}${fixture.templateGroupMax}${fixture.templateGroupNumber}`;
12442
12442
 
12443
- // let mapKey = `${fixture.fixtureCategory}${fixture.fixtureWidth.value}${fixture.fixtureWidth.unit}${fixture.header.label}`;
12443
+ let mapKey = `${fixture.fixtureCategory}${fixture.fixtureWidth.value}${fixture.fixtureWidth.unit}${fixture.header.label}`;
12444
12444
 
12445
12445
  // const shelfIdentifier = `${fixture.shelfConfig.length}${JSON.stringify(
12446
12446
  // fixture.productBrandName,
@@ -12496,9 +12496,22 @@ async function deriveSubTemplatesFromStoreFixtures() {
12496
12496
  templateIndex = maxIndex + 1;
12497
12497
  }
12498
12498
 
12499
- fixture.templateGroupMax = fixture?.templateGroupMax ?? 1;
12500
- fixture.templateGroupNumber = fixture?.templateGroupNumber ?? 1;
12501
- const templateName = `${fixture.templateGroupName}-rule-${fixture.templateGroupMax}-fixture-${fixture.templateGroupNumber}-varient-${templateIndex}`;
12499
+ // fixture.templateGroupMax = fixture?.templateGroupMax ?? 1;
12500
+ // fixture.templateGroupNumber = fixture?.templateGroupNumber ?? 1;
12501
+ // const templateName = `${fixture.templateGroupName}-rule-${fixture.templateGroupMax}-fixture-${fixture.templateGroupNumber}-varient-${templateIndex}`;
12502
+
12503
+ // const fixtureTemplateData = {
12504
+ // ...fixture,
12505
+ // fixtureName: templateName,
12506
+ // crestMapKey: mapKey,
12507
+ // templateType: 'sub',
12508
+ // templateIndex,
12509
+ // };
12510
+
12511
+ // delete fixtureTemplateData._id;
12512
+ // delete fixtureTemplateData.masterTemplateId;
12513
+
12514
+ const templateName = `${fixture.header.label}-${fixture.fixtureCategory}-${fixture.fixtureWidth.value}-${fixture.fixtureWidth.unit}-varient-${templateIndex}`;
12502
12515
 
12503
12516
  const fixtureTemplateData = {
12504
12517
  ...fixture,
@@ -12511,18 +12524,6 @@ async function deriveSubTemplatesFromStoreFixtures() {
12511
12524
  delete fixtureTemplateData._id;
12512
12525
  delete fixtureTemplateData.masterTemplateId;
12513
12526
 
12514
- // const templateName = `${fixture.header.label}-${fixture.fixtureCategory}-${fixture.fixtureWidth.value}-${fixture.fixtureWidth.unit}-varient-${templateIndex}`;
12515
-
12516
- // const fixtureTemplateData = {
12517
- // ...fixture,
12518
- // fixtureName: templateName,
12519
- // crestMapKey: mapKey,
12520
- // templateType: 'sub',
12521
- // templateIndex,
12522
- // };
12523
-
12524
- // delete fixtureTemplateData._id;
12525
-
12526
12527
  const fixtureTemplate = await fixtureConfigService.upsertOne(
12527
12528
  { crestMapKey: mapKey, templateType: 'sub' },
12528
12529
  fixtureTemplateData,
@@ -15673,21 +15674,21 @@ export async function insertAntennaMappingData( req, res ) {
15673
15674
  {
15674
15675
  "fixtureNumber": 18,
15675
15676
  "readerId": "A4-E8-A3-91-7E-FC",
15676
- "storageBoxAntennaNo": [ 13, 10, 2 ],
15677
+ "storageBoxAntennaNo": [ 20, 18, 3 ],
15677
15678
  "shelfConfig": [
15678
- { "shelfNumber": 1, "antennaNo": [ 24, 9 ] },
15679
- { "shelfNumber": 2, "antennaNo": [ 12, 11 ] },
15680
- { "shelfNumber": 3, "antennaNo": [ 20, 25 ] },
15679
+ { "shelfNumber": 1, "antennaNo": [ 17, 25 ] },
15680
+ { "shelfNumber": 2, "antennaNo": [ 10, 15 ] },
15681
+ { "shelfNumber": 3, "antennaNo": [ 6, 19 ] },
15681
15682
  ],
15682
15683
  },
15683
15684
  {
15684
15685
  "fixtureNumber": 20,
15685
15686
  "readerId": "A4-E8-A3-91-7E-FC",
15686
- "storageBoxAntennaNo": [ 3, 15, 1 ],
15687
+ "storageBoxAntennaNo": [ 8, 2, 21, 27, 32 ],
15687
15688
  "shelfConfig": [
15688
- { "shelfNumber": 1, "antennaNo": [ 5, 18 ] },
15689
- { "shelfNumber": 2, "antennaNo": [ 7, 17 ] },
15690
- { "shelfNumber": 3, "antennaNo": [ 4, 16 ] },
15689
+ { "shelfNumber": 1, "antennaNo": [ 22, 11 ] },
15690
+ { "shelfNumber": 2, "antennaNo": [ 4, 16 ] },
15691
+ { "shelfNumber": 3, "antennaNo": [ 9, 28 ] },
15691
15692
  ],
15692
15693
  },
15693
15694
  {
@@ -15695,31 +15696,31 @@ export async function insertAntennaMappingData( req, res ) {
15695
15696
  "readerId": "A4-E8-A3-91-7E-FC",
15696
15697
  "storageBoxAntennaNo": [],
15697
15698
  "shelfConfig": [
15698
- { "shelfNumber": 1, "antennaNo": [ 26, 22 ] },
15699
- { "shelfNumber": 2, "antennaNo": [ 19, 23 ] },
15700
- { "shelfNumber": 3, "antennaNo": [ 14, 18 ] },
15699
+ { "shelfNumber": 1, "antennaNo": [ 12, 1 ] },
15700
+ { "shelfNumber": 2, "antennaNo": [ 23, 14 ] },
15701
+ { "shelfNumber": 3, "antennaNo": [ 13, 29 ] },
15701
15702
  ],
15702
15703
  },
15703
15704
  {
15704
15705
  "fixtureNumber": 17,
15705
15706
  "wallNumber": null,
15706
15707
  "readerId": "A4-E8-A3-91-7F-05",
15707
- "storageBoxAntennaNo": [ 20, 18, 3 ],
15708
+ "storageBoxAntennaNo": [ 3, 15, 1 ],
15708
15709
  "shelfConfig": [
15709
- { "shelfNumber": 1, "antennaNo": [ 17, 25 ] },
15710
- { "shelfNumber": 2, "antennaNo": [ 10, 15 ] },
15711
- { "shelfNumber": 3, "antennaNo": [ 6, 19 ] },
15710
+ { "shelfNumber": 1, "antennaNo": [ 5, 18 ] },
15711
+ { "shelfNumber": 2, "antennaNo": [ 7, 17 ] },
15712
+ { "shelfNumber": 3, "antennaNo": [ 4, 16 ] },
15712
15713
  ],
15713
15714
  },
15714
15715
  {
15715
15716
  "fixtureNumber": 16,
15716
15717
  "wallNumber": null,
15717
15718
  "readerId": "A4-E8-A3-91-7F-05",
15718
- "storageBoxAntennaNo": [ 8, 2, 21, 27, 32 ],
15719
+ "storageBoxAntennaNo": [ 13, 10.2 ],
15719
15720
  "shelfConfig": [
15720
- { "shelfNumber": 1, "antennaNo": [ 22, 11 ] },
15721
- { "shelfNumber": 2, "antennaNo": [ 4, 16 ] },
15722
- { "shelfNumber": 3, "antennaNo": [ 9, 28 ] },
15721
+ { "shelfNumber": 1, "antennaNo": [ 24, 9 ] },
15722
+ { "shelfNumber": 2, "antennaNo": [ 12, 11 ] },
15723
+ { "shelfNumber": 3, "antennaNo": [ 14, 8 ] },
15723
15724
  ],
15724
15725
  },
15725
15726
  {
@@ -15728,9 +15729,9 @@ export async function insertAntennaMappingData( req, res ) {
15728
15729
  "readerId": "A4-E8-A3-91-7F-05",
15729
15730
  "storageBoxAntennaNo": [],
15730
15731
  "shelfConfig": [
15731
- { "shelfNumber": 1, "antennaNo": [ 12, 1 ] },
15732
- { "shelfNumber": 2, "antennaNo": [ 23, 14 ] },
15733
- { "shelfNumber": 3, "antennaNo": [ 13, 29 ] },
15732
+ { "shelfNumber": 1, "antennaNo": [ 26, 22 ] },
15733
+ { "shelfNumber": 2, "antennaNo": [ 19, 23 ] },
15734
+ { "shelfNumber": 3, "antennaNo": [ 20, 25 ] },
15734
15735
  ],
15735
15736
  },
15736
15737
 
@@ -16038,7 +16039,7 @@ export async function getstoreMBQFixtureExcel( req, res ) {
16038
16039
  }
16039
16040
  }
16040
16041
 
16041
- export async function get4487FixtureData( req, res ) {
16042
+ export async function getRfidFixtureData( req, res ) {
16042
16043
  try {
16043
16044
  let fixtureDetails = await storeFixtureService.find( { planoId: new mongoose.Types.ObjectId( '690b2b9dc27523201d101bbb' ), fixtureType: { $ne: 'other' } } );
16044
16045
  let data = [];
@@ -16089,22 +16090,7 @@ export async function get4487FixtureData( req, res ) {
16089
16090
  }
16090
16091
  }
16091
16092
 
16092
- const fetchWithCookies = fetchCookie( fetch );
16093
- let splitArray = await chunkArray( data, 50 );
16094
- for ( let chunk of splitArray ) {
16095
- let uploadData = await fetchWithCookies( `https://api-gateway.juno.lenskart.com/v2/lenskart-personalize/fixture-mappings/bulk`, {
16096
- method: 'POST',
16097
- headers: {
16098
- 'Content-Type': 'application/json',
16099
- 'Cookie': '__cf_bm=MkKoKWIxlAN21LorpSTh6yRib4s2TL_RFWTLDAdNA0I-1769622733-1.0.1.1-5KpHJzGgnbtf01g7DoWkWUlTMLssLy1qKcfj4avp_R7E6Q6gvda.1NblcCfBdqCcKJ.GhiTRx1hcqhVmVZq4X3j6.gt4LGo4vYX9YjpN2O4',
16100
- },
16101
- body: JSON.stringify( { data: chunk } ),
16102
- } );
16103
-
16104
- console.log( uploadData );
16105
- }
16106
-
16107
- return res.sendSuccess( chunkArray );
16093
+ return res.sendSuccess( data );
16108
16094
  } catch ( e ) {
16109
16095
  console.log( e );
16110
16096
  logger.error( { functionName: 'get4487FixtureData', error: e } );
@@ -3812,7 +3812,7 @@ export async function storeFixturesTaskv2( req, res ) {
3812
3812
  },
3813
3813
  ];
3814
3814
  let complianceStatus = await planoComplianceService.aggregate( complianceQuery );
3815
- const productCompliance = complianceStatus?.[0]?.status?.length ? ( complianceStatus?.[0]?.status?.length.includes( 'missing' ) || complianceStatus?.[0]?.status.length.includes( 'misplaced' ) ) ? 'improper' : 'proper' : 'improper';
3815
+ const productCompliance = complianceStatus?.[0]?.status?.length ? ( complianceStatus?.[0]?.status?.includes( 'missing' ) || complianceStatus?.[0]?.status?.includes( 'misplaced' ) ) ? 'improper' : 'proper' : 'improper';
3816
3816
  const vmCount = await planoMappingService.count( { fixtureId: fixture._id, shelfId: shelf.toObject(), type: 'vm' } );
3817
3817
 
3818
3818
  return {
@@ -3943,7 +3943,7 @@ export async function storeFixturesTaskv2( req, res ) {
3943
3943
  },
3944
3944
  ];
3945
3945
  let complianceStatus = await planoComplianceService.aggregate( complianceQuery );
3946
- const productCompliance = complianceStatus?.[0]?.status?.length ? ( complianceStatus?.[0]?.status?.length.includes( 'missing' ) || complianceStatus?.[0]?.status.length.includes( 'misplaced' ) ) ? 'improper' : 'proper' : 'improper';
3946
+ const productCompliance = complianceStatus?.[0]?.status?.length ? ( complianceStatus?.[0]?.status?.includes( 'missing' ) || complianceStatus?.[0]?.status?.includes( 'misplaced' ) ) ? 'improper' : 'proper' : 'improper';
3947
3947
  return {
3948
3948
  ...shelf.toObject(),
3949
3949
  productCount: productDetails.length,
@@ -6137,7 +6137,7 @@ export async function planoList( req, res ) {
6137
6137
  ele['country'] = findStore.storeProfile.country;
6138
6138
  ele['city'] = findStore.storeProfile.city;
6139
6139
  }
6140
- let fixtureStatus = ele?.taskDetails.fixtureStatus == 'complete' ? 'Completed' : ele?.taskDetails.fixtureStatus == 'pending' ? 'Review Pending' : 'Yet to assign';
6140
+ let fixtureStatus = ele?.taskDetails.fixtureStatus == 'complete' ? 'Completed' : ( ele?.planoTask?.[0]?.taskStatus?.some( ( task ) => task.status == 'submit' && task.type == 'fixture' ) && ele?.taskDetails.fixtureStatus == 'pending' ) ? 'Review Pending' : ( ele?.planoTask?.[0]?.taskStatus?.some( ( task ) => task.type == 'fixture' && task.status != 'submit' && !task.breach ) ) ?'Task Assigned' : ( ele?.planoTask?.[0]?.taskStatus?.some( ( task ) => task.type == 'fixture' && task.status != 'submit' && task.breach ) ) ? 'Flagged' : 'Yet To Assign';
6141
6141
  exportData.push( {
6142
6142
  'Store Name': ele?.storeName ?? '--',
6143
6143
  'Layout Name': ele?.layoutName ?? '--',
@@ -7532,13 +7532,13 @@ export async function getRolloutDetails( req, res ) {
7532
7532
  type: 'merchRollout',
7533
7533
  status: 'submit',
7534
7534
  },
7535
- } }, { 'taskDetails.fixtureStatus': 'complete' },
7536
- { 'planoTask.taskStatus': {
7535
+ } }, { 'taskFeedback.fixtureStatus': 'complete' },
7536
+ { 'taskDetails': {
7537
7537
  $elemMatch: {
7538
7538
  type: 'vmRollout',
7539
7539
  status: 'submit',
7540
7540
  },
7541
- } }, { 'taskDetails.vmStatus': 'complete' },
7541
+ } }, { 'taskFeedback.vmStatus': 'complete' },
7542
7542
  {
7543
7543
  layoutStatus: { $in: [ false ] },
7544
7544
  },
@@ -7552,13 +7552,13 @@ export async function getRolloutDetails( req, res ) {
7552
7552
  type: 'merchRollout',
7553
7553
  status: 'submit',
7554
7554
  },
7555
- } }, { 'taskDetails.fixtureStatus': 'complete' },
7556
- { 'planoTask.taskStatus': {
7555
+ } }, { 'taskFeedback.fixtureStatus': 'complete' },
7556
+ { 'taskDetails': {
7557
7557
  $elemMatch: {
7558
7558
  type: 'vmRollout',
7559
7559
  status: 'submit',
7560
7560
  },
7561
- } }, { 'taskDetails.vmStatus': 'complete' },
7561
+ } }, { 'taskFeedback.vmStatus': 'complete' },
7562
7562
  {
7563
7563
  layoutStatus: { $nin: [ false ] },
7564
7564
  },
@@ -7711,8 +7711,8 @@ export async function getRolloutDetails( req, res ) {
7711
7711
  if ( req.body.export ) {
7712
7712
  let exportData = [];
7713
7713
  result.tableData.data.forEach( ( ele ) => {
7714
- let merchStatus = ele?.taskDetails.fixtureStatus == 'complete' ? 'Completed' : ele?.taskDetails.fixtureStatus == 'pending' ? 'Review Pending' : 'Yet to Assign';
7715
- let vmStatus = ele?.taskDetails.fixtureStatus == 'complete' ? 'Completed' : ele?.taskDetails.fixtureStatus == 'pending' ? 'Review Pending' : 'Yet to Assign';
7714
+ let merchStatus = ele?.taskFeedback.fixtureStatus == 'complete' ? 'Completed' : ( ele?.taskDetails?.some( ( task ) => task.status == 'submit' && task.type == 'merchRollout' ) && ele?.taskFeedback.fixtureStatus == 'pending' ) ? 'Review Pending' : ( ele?.taskDetails?.some( ( task ) => task.type == 'merchRollout' && task.status != 'submit' && !task.breach ) ) ?'Task Assigned' : ( ele?.taskDetails?.some( ( task ) => task.type == 'merchRollout' && task.status != 'submit' && task.breach ) ) ? 'Flagged' : 'Yet To Assign';
7715
+ let vmStatus = ele?.taskFeedback.vmStatus == 'complete' ? 'Completed' : ( ele?.taskDetails?.some( ( task ) => task.status == 'submit' && task.type == 'vmRollout' ) && ele?.taskFeedback.vmStatus == 'pending' ) ? 'Review Pending' : ( ele?.taskDetails?.some( ( task ) => task.type == 'vmRollout' && task.status != 'submit' && !task.breach ) ) ?'Task Assigned' : ( ele?.taskDetails?.some( ( task ) => task.type == 'vmRollout' && task.status != 'submit' && task.breach ) ) ? 'Flagged' : 'Yet To Assign';
7716
7716
  let planoStatus = [ merchStatus, vmStatus ];
7717
7717
  exportData.push( {
7718
7718
  'Store Name': ele?.storeName ?? '--',
@@ -52,5 +52,5 @@ scriptRouter
52
52
  .post( '/update4487Inventory', scriptController.update4487Inventory )
53
53
  .get( '/4487FixtureDetails', scriptController.get4487FixtureDetails )
54
54
  .post( '/getstoreMBQFixtureExcel', scriptController.getstoreMBQFixtureExcel )
55
- .get( '/get4487FixtureData', scriptController.get4487FixtureData )
55
+ .get( '/getRfidFixtureData', isAllowedInternalAPIHandler, scriptController.getRfidFixtureData )
56
56
  ;
@@ -73,4 +73,5 @@ storeBuilderRouter
73
73
  .get( '/getAllStores', isAllowedSessionHandler, storeBuilderController.getAllStores )
74
74
  .get( '/getStoreFloorsList', isAllowedSessionHandler, storeBuilderController.getStoreFloorsList )
75
75
  .post( '/getShelfDetails', isAllowedInternalAPIHandler, storeBuilderController.getShelfDetails )
76
+ // .get( '/migrationScript', isAllowedInternalAPIHandler, storeBuilderController.migrationScript )
76
77
  ;