import { Router } from "express";
import { authenticateToken } from "../middleware/authMiddleware";
import * as ctrl from "../controllers/salesOrderMgmtController";

const router = Router();
router.use(authenticateToken);

router.get("/list", ctrl.getList);
router.get("/generate-number", ctrl.generateNumber);
router.get("/:id/form-view", ctrl.getFormView);
router.get("/:id", ctrl.getById);
router.post("/", ctrl.create);
router.put("/:id", ctrl.update);
router.delete("/:id", ctrl.remove);
router.patch("/:id/status", ctrl.updateStatus);
router.post("/:id/cancel-qty", ctrl.saveCancelQty);
router.post("/:id/copy", ctrl.copyOrder);
router.post("/:id/amaranth-approval", ctrl.startApproval);

export default router;
