import { Router } from "express";
import { createTicket, listTickets } from "../controllers/support.controller.js";
import { requireAuth, requireRole } from "../middleware/auth.js";

export const supportRouter = Router();

supportRouter.post("/tickets", requireAuth, createTicket);
supportRouter.get("/tickets", requireAuth, requireRole("admin", "super_admin"), listTickets);
supportRouter.get("/faq", (_request, response) => {
  response.json([
    { question: "How long does print production take?", answer: "Most standard jobs move to production after artwork approval and payment verification." },
    { question: "Can vendors sell on OMOSALA?", answer: "Yes. Vendors create stores, complete KYC, upload products, and receive payouts." }
  ]);
});
