import { Router } from "express";
import { AuditLogController } from "./auditLog.controller";
import { authMiddleware } from "../auth/auth.middleware";

const auditRouter = Router();
const controller = new AuditLogController();

auditRouter.get("/", authMiddleware, controller.getAll);

auditRouter.get("/:id", authMiddleware, controller.getById);

auditRouter.post("/", authMiddleware, controller.create);

auditRouter.get("/user/:userId", authMiddleware, controller.getByUser);

auditRouter.get("/module/:module", authMiddleware, controller.getByModule);

auditRouter.get("/action/:action", authMiddleware, controller.getByAction);

auditRouter.get("/status/:status", authMiddleware, controller.getByStatus);

auditRouter.get("/date-range", authMiddleware, controller.getByDateRange);

auditRouter.delete("/:id", authMiddleware, controller.delete);

export default auditRouter;