import { Router } from "express";
import { listStaff, createStaff, updateStaff, deleteStaff, resetStaffPassword } from "../controllers/staff.controller.js";
import { authenticate, requireRole, requireExpirationCheck } from "../middleware/auth.middleware.js";

const router = Router();
router.get("/", authenticate, requireExpirationCheck, listStaff);
router.post("/", authenticate, requireExpirationCheck, requireRole('owner'), createStaff);
router.put("/:id", authenticate, requireExpirationCheck, requireRole('owner'), updateStaff);
router.patch("/:id/reset-password", authenticate, requireExpirationCheck, requireRole('owner'), resetStaffPassword);
router.delete("/:id", authenticate, requireExpirationCheck, requireRole('owner'), deleteStaff);

export default router;
