import express from "express";
import {
	createCandidate,
	getCandidates,
	getCandidate,
	getCandidatesByCareer,
	updateCandidate,
	deleteCandidate,
} from "../controllers/candidate.controller.js";

import jwtAuthMiddleware from "../middleware/auth.js";

const router = express.Router();

/* PUBLIC */
router.post("/", createCandidate);

router.get("/getAll", jwtAuthMiddleware, getCandidates);
router.get("/:id", jwtAuthMiddleware, getCandidate);
router.get("/career/:careerId", jwtAuthMiddleware, getCandidatesByCareer);

router.patch("/:id", jwtAuthMiddleware, updateCandidate);
router.delete("/:id", jwtAuthMiddleware, deleteCandidate);

export default router;
