import { Router } from "express";
import { approveVendor, createVendor, listVendors } from "../controllers/vendor.controller.js";
import { requireAuth, requireRole } from "../middleware/auth.js";

export const vendorRouter = Router();

vendorRouter.get("/", listVendors);
vendorRouter.post("/", requireAuth, createVendor);
vendorRouter.patch("/:id/approve", requireAuth, requireRole("admin", "super_admin"), approveVendor);
