tango-app-api-store-builder 1.0.27 → 1.0.29

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.27",
3
+ "version": "1.0.29",
4
4
  "description": "storeBuilder",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -25,7 +25,9 @@ import * as planoStaticService from '../service/planoStaticData.service.js';
25
25
  import * as processedChecklistService from '../service/processedchecklist.service.js';
26
26
  import dayjs from 'dayjs';
27
27
  import advancedFormat from 'dayjs/plugin/advancedFormat.js';
28
+ import utc from 'dayjs/plugin/utc.js';
28
29
  dayjs.extend( advancedFormat );
30
+ dayjs.extend( utc );
29
31
  export async function getplanoFeedback( req, res ) {
30
32
  try {
31
33
  const taskTypes = req.body.filterByTask && req.body.filterByTask.length > 0 ? req.body.filterByTask : [ 'layout', 'fixture', 'vm' ];
@@ -1775,7 +1777,7 @@ export async function getAllPlanoRevisions( req, res ) {
1775
1777
 
1776
1778
  const revisions = await planoRevisionService.aggregate( query );
1777
1779
  revisions.forEach( ( revision ) => {
1778
- revision.floorData.lastUpdate = dayjs( revision?.updatedAt ).format( 'Do MMMM YYYY hh:mm A' );
1780
+ revision.floorData.lastUpdate = dayjs.utc( revision?.updatedAt ).format( 'Do MMMM YYYY hh:mm A' );
1779
1781
  } );
1780
1782
 
1781
1783
  res.sendSuccess( revisions );
@@ -1967,7 +1969,7 @@ export async function getPlanoRevisionById( req, res ) {
1967
1969
  } ) );
1968
1970
  return fixture;
1969
1971
  } ) );
1970
- return { ...floor, lastUpdate: dayjs( revisions[0]?.lastUpdate ).format( 'Do MMMM YYYY hh:mm A' ) };
1972
+ return { ...floor, lastUpdate: dayjs.utc( revisions[0]?.lastUpdate ).format( 'Do MMMM YYYY hh:mm A' ) };
1971
1973
  } ) );
1972
1974
 
1973
1975
  res.sendSuccess( revisions );
@@ -9573,8 +9573,8 @@ export async function productMappings( req, res ) {
9573
9573
 
9574
9574
  const { fixtureId, Top, Mid, Bottom } = payload;
9575
9575
 
9576
- const storeName = 'LKST11';
9577
- const storeId = '11-259';
9576
+ const storeName = 'LKST2681';
9577
+ const storeId = '11-2362';
9578
9578
  const clientId = '11';
9579
9579
 
9580
9580
  if ( !fixtureId ) {
@@ -18631,7 +18631,7 @@ export async function updateProduct( req, res ) {
18631
18631
  }
18632
18632
  fixtureDetails['readerId'] = req.body.macId;
18633
18633
  fixtureDetails.save();
18634
- let getProducts = await planoProductService.findSort( { brandName: { $ne: null } }, {}, { brandName: 1 } );
18634
+ let getProducts = await planoProductService.findSort( { brandName: { $ne: null }, $or: [ { rfId: { $exists: false } }, { rfId: "" } ] }, {}, { brandName: 1 } );
18635
18635
  let rfIdList = req.body.shelfDetails.flatMap( ( ele ) => ele.rfIdList );
18636
18636
  await Promise.all( rfIdList.map( async ( idList, index ) => {
18637
18637
  getProducts[index]['rfId']= idList;
@@ -3075,7 +3075,7 @@ export async function storeFixturesv2( req, res ) {
3075
3075
  otherElements: otherElements,
3076
3076
  ...( masterTempArr.length && { masterTemplates: masterTempArr } ),
3077
3077
  lastUpdate: dayjs( floor?.updatedAt ).format( 'Do MMMM YYYY hh:mm A' ),
3078
- ...( floors.length > 1 ) ? { floorNum: `${floor.floorName} ${index + 1}/${floors.length}` } : { floorNum: floor.floorName },
3078
+ ...( floors.length > 1 ) ? { floorNum: `Floor ${index + 1}/${floors.length}` } : { floorNum: 'Floor 1' },
3079
3079
  };
3080
3080
  } ),
3081
3081
  );
@@ -5155,7 +5155,7 @@ export async function planoList( req, res ) {
5155
5155
  status: 'active',
5156
5156
  ...( inputData?.stores?.length && { storeId: { $in: inputData.stores } } ),
5157
5157
  ...( req.body.filter.country.length && { 'storeProfile.country': { $in: req.body.filter.country } } ),
5158
- ...( req.body.filter.city.length && { 'storeProfile.city': { $in: req.body.city.country } } ),
5158
+ ...( req.body.filter.city.length && { 'storeProfile.city': { $in: req.body.filter.city } } ),
5159
5159
  ...( req.body?.assignedStores?.length && { storeId: { $in: req.body?.assignedStores } } ) }, { storeId: 1, storeProfile: 1 } );
5160
5160
 
5161
5161
  let storeDetails = storeList.map( ( ele ) => ele.storeId );
@@ -6100,11 +6100,11 @@ export async function planoList( req, res ) {
6100
6100
  'Layout Name': ele?.layoutName ?? '--',
6101
6101
  'Plano Completion %': ele?.taskDetails.layoutStatus == 'complete' && ele?.taskDetails.fixtureStatus == 'complete' ? 100 : ele?.taskDetails.layoutStatus == 'complete' ? 50 : 25,
6102
6102
  'Layout': ele?.layoutCount ?? 0,
6103
- 'Layout Status': ele?.taskDetails.layoutStatus == 'complete' ? 'Complete' : 'Yet to assign',
6103
+ 'Layout Status': ele?.taskDetails.layoutStatus == 'complete' ? 'Completed' : 'Yet to assign',
6104
6104
  'No of Fixtures': ele?.fixtureCount ?? 0,
6105
- 'Fixture Status': ele?.taskDetails.fixtureStatus == 'complete' ? 'Complete' : ele?.taskDetails.fixtureStatus == 'pending' ? 'Review Pending' : 'Yet to assign',
6105
+ 'Fixture Status': ele?.taskDetails.fixtureStatus == 'complete' ? 'Completed' : ele?.taskDetails.fixtureStatus == 'pending' ? 'Review Pending' : 'Yet to assign',
6106
6106
  'No of VMs': ele?.vmCount ?? 0,
6107
- 'VM Status': ele?.taskDetails.fixtureStatus == 'complete' ? 'Complete' : ele?.taskDetails.fixtureStatus == 'pending' ? 'Review Pending' : 'Yet to assign',
6107
+ 'VM Status': ele?.taskDetails.fixtureStatus == 'complete' ? 'Completed' : ele?.taskDetails.fixtureStatus == 'pending' ? 'Review Pending' : 'Yet to assign',
6108
6108
  'Store Capacity': ele?.fixtureCapacity ?? 0,
6109
6109
  'Last update': ele?.lastUpdate ? dayjs( ele.lastUpdate ).format( 'MMM DD, YYYY' ) : '--',
6110
6110
  'Planogram Status': ( ele?.taskDetails.fixtureStatus == 'complete' && ele?.taskDetails.layoutStatus == 'complete' && ele.layoutStatus.includes( false ) ) ? 'Yet to Publish' : !ele.layoutStatus.includes( false ) ? 'Published' : 'In-Progress',
@@ -7667,9 +7667,9 @@ export async function getRolloutDetails( req, res ) {
7667
7667
  'Store Name': ele?.storeName ?? '--',
7668
7668
  'Plano Name': ele?.layoutName ?? '--',
7669
7669
  'Merch Fixtures': ele?.fixtureCount ?? 0,
7670
- 'Merch Status': ele?.taskDetails.fixtureStatus == 'complete' ? 'Complete' : ele?.taskDetails.fixtureStatus == 'pending' ? 'Review Pending' : 'Yet to Assign',
7670
+ 'Merch Status': ele?.taskDetails.fixtureStatus == 'complete' ? 'Completed' : ele?.taskDetails.fixtureStatus == 'pending' ? 'Review Pending' : 'Yet to Assign',
7671
7671
  'Visual Merch': ele?.vmCount ?? 0,
7672
- 'VM Status': ele?.taskDetails.fixtureStatus == 'complete' ? 'Complete' : ele?.taskDetails.fixtureStatus == 'pending' ? 'Review Pending' : 'Yet to Assign',
7672
+ 'VM Status': ele?.taskDetails.fixtureStatus == 'complete' ? 'Completed' : ele?.taskDetails.fixtureStatus == 'pending' ? 'Review Pending' : 'Yet to Assign',
7673
7673
  'Last update': ele?.lastUpdate ? dayjs( ele.lastUpdate ).format( 'MMM dd, YYYY' ) : '--',
7674
7674
  'Planogram Status': ( ele?.taskDetails.fixtureStatus == 'complete' && ele?.taskDetails.layoutStatus == 'complete' && ele.layoutStatus.includes( false ) ) ? 'Yet to Publish' : !ele.layoutStatus.includes( false ) ? 'Published' : 'In-Progress',
7675
7675
  } );