fix(dm): correction to passing the username over for the importing of the file
This commit is contained in:
@@ -12,4 +12,6 @@ type IncomingForecastData = {
|
||||
CustomerArticleNumber: number;
|
||||
};
|
||||
|
||||
export const forecastData = async (data: IncomingForecastData) => {};
|
||||
export const forecastData = async (data: IncomingForecastData) => {
|
||||
console.log(data);
|
||||
};
|
||||
|
||||
9
app/src/internal/logistics/routes/demandMgt/dmRoutes.ts
Normal file
9
app/src/internal/logistics/routes/demandMgt/dmRoutes.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Router } from "express";
|
||||
import { requireAuth } from "../../../../pkg/middleware/authMiddleware.js";
|
||||
import forecastData from "./forecastEDIData.js";
|
||||
|
||||
const router = Router();
|
||||
|
||||
router.use("/", requireAuth(), forecastData);
|
||||
|
||||
export default router;
|
||||
@@ -0,0 +1,27 @@
|
||||
import type { Request, Response } from "express";
|
||||
import { Router } from "express";
|
||||
import z from "zod";
|
||||
import { preprintLabels } from "../../controller/labeling/preprint.js";
|
||||
|
||||
export const Preprint = z.object({
|
||||
scannerId: z.number(),
|
||||
lotNr: z.number(),
|
||||
machineId: z.number(), // 457=22, 458=23
|
||||
printerId: z.number(), // 457=22, 458=23
|
||||
layoutId: z.number(),
|
||||
numberOfCopies: z.number(),
|
||||
qtyToPrint: z.number().default(1),
|
||||
});
|
||||
|
||||
const router = Router();
|
||||
|
||||
router.post("/preprint", async (req: Request, res: Response) => {
|
||||
const parsed = Preprint.safeParse(req.body);
|
||||
const print = await preprintLabels(req.body, req.user?.username || "");
|
||||
|
||||
res
|
||||
.status(200)
|
||||
.json({ success: print.success, message: print.message, data: print.data });
|
||||
});
|
||||
|
||||
export default router;
|
||||
Reference in New Issue
Block a user