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.get("/getAll", getCandidates);
router.get("/:id", getCandidate);
router.get("/career/:careerId", getCandidatesByCareer);

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

export default router;
