Connect production orders to stock movements

This commit is contained in:
Cauê Faleiros
2026-07-13 13:22:11 -03:00
parent afaa18ca14
commit 8f3f2f3e93
6 changed files with 475 additions and 10 deletions

View File

@@ -1,7 +1,9 @@
const express = require('express');
const { verifyToken } = require('../auth');
const {
adjustInventoryLot,
approveReceipt,
consumeLotForProduction,
createFabricPlan,
createReceipt,
deleteFabricPlan,
@@ -65,6 +67,22 @@ router.get('/supply/lots', verifyToken, async (req, res, next) => {
}
});
router.post('/supply/lots/:id/inventory-adjustment', verifyToken, async (req, res, next) => {
try {
res.json(await adjustInventoryLot(req.params.id, req.body || {}));
} catch (error) {
next(error);
}
});
router.post('/supply/lots/:id/production-exit', verifyToken, async (req, res, next) => {
try {
res.json(await consumeLotForProduction(req.params.id, req.body || {}));
} catch (error) {
next(error);
}
});
router.get('/supply/movements', verifyToken, async (req, res, next) => {
try {
res.json(await listMovements());