tango-app-api-store-builder 1.0.0-beta-38 → 1.0.0-beta-39

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-38",
3
+ "version": "1.0.0-beta-39",
4
4
  "description": "storeBuilder",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -23,7 +23,7 @@
23
23
  "joi": "^17.13.3",
24
24
  "mongodb": "^6.12.0",
25
25
  "nodemon": "^3.1.9",
26
- "tango-api-schema": "^2.2.62",
26
+ "tango-api-schema": "^2.2.65",
27
27
  "tango-app-api-middleware": "^3.1.48",
28
28
  "winston": "^3.17.0",
29
29
  "winston-daily-rotate-file": "^5.0.0"
@@ -1004,7 +1004,7 @@ export async function fixtureShelfProductv1( req, res ) {
1004
1004
 
1005
1005
  return await Promise.all(
1006
1006
  mappings.map( async ( mapping ) => {
1007
- const productData = productMap.get( mapping.productId.toString() ) || {};
1007
+ const productData = productMap.get( mapping?.productId?.toString() ) || {};
1008
1008
  delete productData._id;
1009
1009
  const mappingCompliance = await planoComplianceService.findOne( {
1010
1010
  planoMappingId: mapping._id,
@@ -1746,12 +1746,13 @@ export async function bulkFixtureUpload( req, res ) {
1746
1746
  'shelfCapacity': 2,
1747
1747
  'shelfType': 'middle',
1748
1748
  'sectionName': req.body.data[i].sectionName,
1749
- 'rfId': req.body.data[i].rfId,
1750
1749
  };
1751
1750
 
1752
1751
  const createdShelf = await fixtureShelfService.create( shelfData );
1753
1752
 
1754
1753
  for ( let j = 0; j < req.body.data[i].products.length; j++ ) {
1754
+ const product = await planoProductService.findOne( { itemcode: req.body.data[i].products[j].rfId } );
1755
+
1755
1756
  const productMapping = {
1756
1757
  'clientId': fixtureDoc.clientId,
1757
1758
  'storeName': fixtureDoc.storeName,
@@ -1762,7 +1763,7 @@ export async function bulkFixtureUpload( req, res ) {
1762
1763
  'fixtureId': fixtureDoc._id,
1763
1764
  'shelfId': createdShelf._id,
1764
1765
  'shelfPosition': j+1,
1765
- 'productId': new mongoose.Types.ObjectId( '67a1e8070c8643358225140c' ),
1766
+ 'productId': product ? product.toObject()._id : undefined,
1766
1767
  'rfId': req.body.data[i].products[j].rfId,
1767
1768
  'category': 'middle',
1768
1769
  };
@@ -1801,31 +1802,32 @@ export async function bulkFixtureUpload( req, res ) {
1801
1802
 
1802
1803
  // const data = [
1803
1804
  // {
1804
- // 'facility_code': 'LKST98',
1805
- // 'product_id': 207042,
1806
- // 'brand': 'John Jacobs',
1807
- // 'category': 'sunglasses',
1808
- // 'zone': 'South',
1809
- // 'tlp_status': 'YES',
1810
- // 'lf_nonlf': 'LF',
1811
- // 'kpi': 'SOH',
1812
- // 'qty': 1,
1813
- // 'created_at': '1/31/2025',
1814
- // 'store_type': 'COCO',
1815
- // 'status': 'Active',
1816
- // 'PLC': 'Singapore Ex',
1817
- // 'itemcode': 'JJJ015799816',
1818
- // },
1819
- // ];
1805
+ // "facility_code": "LKST98",
1806
+ // "product_id": 217622,
1807
+ // "brand": "Lenskart READERS",
1808
+ // "category": "Non-Power Reading",
1809
+ // "zone": "South",
1810
+ // "tlp_status": "N",
1811
+ // "lf_nonlf": "LF",
1812
+ // "kpi": "SOH",
1813
+ // "qty": 1,
1814
+ // "created_at": "01\/31\/2025",
1815
+ // "store_type": "COCO",
1816
+ // "status": "Active",
1817
+ // "PLC": "New Launches",
1818
+ // "itemcode": "CCC086062840"
1819
+ // }
1820
+ // ]
1820
1821
 
1821
1822
  // const cleanData = ( data ) => {
1822
- // return data.map( ( { product_id, brand, category, itemcode } ) => ( {
1823
+ // return data.map( ( { product_id, brand, category, itemcode, facility_code } ) => ( {
1823
1824
  // productId: String( product_id ),
1824
1825
  // productBrand: brand,
1825
1826
  // productType: category,
1826
1827
  // clientId: '11',
1827
- // type: 'new',
1828
+ // storeName: facility_code,
1828
1829
  // itemcode,
1830
+ // type:'product'
1829
1831
  // } ) );
1830
1832
  // };
1831
1833