tango-app-api-store-builder 1.0.0-beta-215 → 1.0.0-beta-216
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
|
@@ -1362,9 +1362,12 @@ export async function updateStoreFixture( req, res ) {
|
|
|
1362
1362
|
let getMaxTemp = await fixtureConfigService.aggregate( tempQuery );
|
|
1363
1363
|
templateIndex = getMaxTemp?.[0]?.tempId + 1;
|
|
1364
1364
|
}
|
|
1365
|
-
templateData.fixtureName= `${header}-${data.fixtureCategory}-
|
|
1365
|
+
templateData.fixtureName= `${header}-${data.fixtureCategory}-variant-${templateIndex}`,
|
|
1366
1366
|
templateData.templateType = 'sub';
|
|
1367
1367
|
templateData.masterTemplateId = fixtureMasterTemplate._id;
|
|
1368
|
+
templateData.templateIndex = templateIndex;
|
|
1369
|
+
templateData.createdAt = new Date();
|
|
1370
|
+
templateData.updatedAt = new Date();
|
|
1368
1371
|
let subTemplate = await fixtureConfigService.create( templateData );
|
|
1369
1372
|
configId = subTemplate._id;
|
|
1370
1373
|
|
|
@@ -9698,44 +9698,45 @@ function transformProducts( products, shelvesByZone, fixtureData ) {
|
|
|
9698
9698
|
|
|
9699
9699
|
// ---------------------Plano Migrate-------------------------
|
|
9700
9700
|
|
|
9701
|
-
export async function getAllPlanoIds(
|
|
9701
|
+
export async function getAllPlanoIds(req, res){
|
|
9702
9702
|
try {
|
|
9703
|
-
|
|
9704
|
-
|
|
9703
|
+
|
|
9704
|
+
if (!req.query?.clientId) {
|
|
9705
|
+
return res.sendError('Client id is required', 400);
|
|
9705
9706
|
}
|
|
9706
|
-
const floorsData = await storeBuilderService.aggregate(
|
|
9707
|
+
const floorsData = await storeBuilderService.aggregate([
|
|
9707
9708
|
{
|
|
9708
|
-
|
|
9709
|
-
|
|
9710
|
-
|
|
9711
|
-
}, {
|
|
9712
|
-
'$group': {
|
|
9713
|
-
'_id': '$planoId',
|
|
9714
|
-
'storeName': {
|
|
9715
|
-
'$first': '$storeName',
|
|
9716
|
-
},
|
|
9717
|
-
'storeId': {
|
|
9718
|
-
'$first': '$storeId',
|
|
9719
|
-
},
|
|
9720
|
-
},
|
|
9709
|
+
'$match': {
|
|
9710
|
+
'clientId': '11'
|
|
9711
|
+
}
|
|
9721
9712
|
}, {
|
|
9722
|
-
|
|
9723
|
-
|
|
9724
|
-
|
|
9725
|
-
|
|
9713
|
+
'$group': {
|
|
9714
|
+
'_id': '$planoId',
|
|
9715
|
+
'storeName': {
|
|
9716
|
+
'$first': '$storeName'
|
|
9726
9717
|
},
|
|
9718
|
+
'storeId': {
|
|
9719
|
+
'$first': '$storeId'
|
|
9720
|
+
}
|
|
9721
|
+
}
|
|
9722
|
+
}, {
|
|
9723
|
+
'$project': {
|
|
9724
|
+
'planoId': '$_id',
|
|
9725
|
+
'storeName': 1,
|
|
9726
|
+
'storeId': 1
|
|
9727
|
+
}
|
|
9727
9728
|
}, {
|
|
9728
|
-
|
|
9729
|
-
}
|
|
9730
|
-
]
|
|
9729
|
+
'$sort': { storeName: 1 }
|
|
9730
|
+
}
|
|
9731
|
+
]);
|
|
9731
9732
|
|
|
9732
|
-
if (
|
|
9733
|
-
return res.sendSuccess(
|
|
9733
|
+
if (floorsData) {
|
|
9734
|
+
return res.sendSuccess(floorsData);
|
|
9734
9735
|
} else {
|
|
9735
|
-
return res.sendError(
|
|
9736
|
+
return res.sendError("No floor data found", 204)
|
|
9736
9737
|
}
|
|
9737
|
-
} catch (
|
|
9738
|
-
console.log(
|
|
9739
|
-
return res.sendError(
|
|
9738
|
+
} catch (error) {
|
|
9739
|
+
console.log("@@ ~ getAllPlanoIds [ERR]:", error);
|
|
9740
|
+
return res.sendError(e, 500);
|
|
9740
9741
|
}
|
|
9741
|
-
}
|
|
9742
|
+
}
|