Import finalized Olist production orders
This commit is contained in:
@@ -9,6 +9,7 @@ const {
|
||||
requestOlistSyncStop,
|
||||
startOlistSync
|
||||
} = require('../services/olistService');
|
||||
const { importFinalizedProductionOrderCsv, listProductionOrderImportData } = require('../services/productionOrderCsvImportService');
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
@@ -48,6 +49,22 @@ router.post('/olist/sync/stop', verifySuperAdmin, async (req, res, next) => {
|
||||
}
|
||||
});
|
||||
|
||||
router.get('/olist/production-order-imports', verifySuperAdmin, async (req, res, next) => {
|
||||
try {
|
||||
res.json(await listProductionOrderImportData());
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
});
|
||||
|
||||
router.post('/olist/production-order-imports', verifySuperAdmin, async (req, res, next) => {
|
||||
try {
|
||||
res.status(201).json(await importFinalizedProductionOrderCsv(req.body || {}));
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
});
|
||||
|
||||
router.get('/olist/runs/:runId', verifySuperAdmin, async (req, res, next) => {
|
||||
try {
|
||||
res.json(await getOlistRunDetails(req.params.runId, {
|
||||
|
||||
Reference in New Issue
Block a user