Add material transformation planning
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user