/**
 * ==================================================
 * Smart Attendance System
 * AI Routes
 * ==================================================
 * Exposes all AI-related endpoints.
 *
 * Endpoints
 * -----------------------
 * GET    /health
 * POST   /detect
 * POST   /embed
 * POST   /train
 * POST   /recognize
 * ==================================================

*/






const express = require("express");

const router = express.Router();

const AIController = require("../controllers/ai.controller");

const upload = require("../middleware/upload");

const uploadTraining = require("../middleware/upload.training");
const asyncHandler = require("../middleware/asyncHandler");





router.get(
    "/health",
    asyncHandler(AIController.health)
);

router.post(
    "/detect",
    upload.single("image"),
    asyncHandler(AIController.detect)
);

router.post(
    "/embed",
    upload.single("image"),
    asyncHandler(AIController.embed)
);

router.post(
    "/train",
    uploadTraining.array("images", 10),
    asyncHandler(AIController.train)
);

router.post(
    "/recognize",
    upload.single("image"),
    asyncHandler(AIController.recognize)
);



module.exports = router;