tango-app-api-store-builder 1.0.0-beta-210 → 1.0.0-beta-211
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
|
@@ -9694,3 +9694,49 @@ function transformProducts( products, shelvesByZone, fixtureData ) {
|
|
|
9694
9694
|
|
|
9695
9695
|
return result;
|
|
9696
9696
|
}
|
|
9697
|
+
|
|
9698
|
+
|
|
9699
|
+
// ---------------------Plano Migrate-------------------------
|
|
9700
|
+
|
|
9701
|
+
export async function getAllPlanoIds(req, res){
|
|
9702
|
+
try {
|
|
9703
|
+
|
|
9704
|
+
if (!req.query?.clientId) {
|
|
9705
|
+
return res.sendError('Client id is required', 400);
|
|
9706
|
+
}
|
|
9707
|
+
const floorsData = await storeBuilderService.aggregate([
|
|
9708
|
+
{
|
|
9709
|
+
'$match': {
|
|
9710
|
+
'clientId': '11'
|
|
9711
|
+
}
|
|
9712
|
+
}, {
|
|
9713
|
+
'$group': {
|
|
9714
|
+
'_id': '$planoId',
|
|
9715
|
+
'storeName': {
|
|
9716
|
+
'$first': '$storeName'
|
|
9717
|
+
},
|
|
9718
|
+
'storeId': {
|
|
9719
|
+
'$first': '$storeId'
|
|
9720
|
+
}
|
|
9721
|
+
}
|
|
9722
|
+
}, {
|
|
9723
|
+
'$project': {
|
|
9724
|
+
'planoId': '$_id',
|
|
9725
|
+
'storeName': 1,
|
|
9726
|
+
'storeId': 1
|
|
9727
|
+
}
|
|
9728
|
+
}, {
|
|
9729
|
+
'$sort': { storeName: 1 }
|
|
9730
|
+
}
|
|
9731
|
+
]);
|
|
9732
|
+
|
|
9733
|
+
if (floorsData) {
|
|
9734
|
+
return res.sendSuccess(floorsData);
|
|
9735
|
+
} else {
|
|
9736
|
+
return res.sendError("No floor data found", 204)
|
|
9737
|
+
}
|
|
9738
|
+
} catch (error) {
|
|
9739
|
+
console.log("@@ ~ getAllPlanoIds [ERR]:", error);
|
|
9740
|
+
return res.sendError(e, 500);
|
|
9741
|
+
}
|
|
9742
|
+
}
|
|
@@ -33,4 +33,5 @@ scriptRouter
|
|
|
33
33
|
.post( '/migrateCrest', scriptController.migrateCrestv1 )
|
|
34
34
|
.post( '/updatePlanoMappings', scriptController.updatePlanoMappings )
|
|
35
35
|
.post( '/productMappings', scriptController.productMappings )
|
|
36
|
+
.get( '/getAllPlanoIdsM', scriptController.getAllPlanoIds )
|
|
36
37
|
;
|