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

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.28",
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 );
@@ -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;
@@ -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
  } );