import { Router } from "express";
import { createOrder, listOrders, updateOrderStatus } from "../controllers/order.controller.js";
import { requireAuth, requireRole } from "../middleware/auth.js";

export const orderRouter = Router();

orderRouter.get("/", requireAuth, listOrders);
orderRouter.post("/", requireAuth, createOrder);
orderRouter.patch("/:id/status", requireAuth, requireRole("dispatch", "admin", "super_admin", "seller"), updateOrderStatus);
