Add material transformation planning

This commit is contained in:
Cauê Faleiros
2026-08-27 10:44:49 -03:00
parent da6f3b2955
commit 442b23dc62
6 changed files with 325 additions and 3 deletions

View File

@@ -5,15 +5,18 @@ const {
approveReceipt,
consumeLotForProduction,
createFabricPlan,
createMaterialTransformation,
createPurchaseOrder,
createReceipt,
deleteFabricPlan,
deleteReceipt,
getSupplySummary,
listFabricPlans,
listMaterialTransformations,
listKnownSuppliers,
listPurchaseOrders,
saveMaterialDetails,
updateMaterialTransformationStatus,
updatePurchaseOrderStatus,
listLots,
listMovements,
@@ -153,6 +156,30 @@ router.delete('/supply/fabric-plans/:id', verifyToken, async (req, res, next) =>
}
});
router.get('/supply/material-transformations', verifyToken, async (req, res, next) => {
try {
res.json(await listMaterialTransformations());
} catch (error) {
next(error);
}
});
router.post('/supply/material-transformations', verifyToken, async (req, res, next) => {
try {
res.status(201).json(await createMaterialTransformation(req.body || {}));
} catch (error) {
next(error);
}
});
router.patch('/supply/material-transformations/:id/status', verifyToken, async (req, res, next) => {
try {
res.json(await updateMaterialTransformationStatus(req.params.id, req.body?.status));
} catch (error) {
next(error);
}
});
router.get('/supply/purchase-needs', verifyToken, async (req, res, next) => {
try {
res.json(await listPurchaseNeeds());