const {authJwt} = require("../middlewares");
module.exports = app => {
    const fingerprintAttendance = require("../controllers/fingerprint-attendance.controller.js");
    app.use((req, res, next) => {
      res.header(
        "Access-Control-Allow-Headers",
        "x-access-token, Origin, Content-Type, Accept"
      );
      next();
    });
    var router = require("express").Router();
    
    // Create a new Fingerprint Attendance record
    router.post("/", fingerprintAttendance.createFingerprintAttendance);
    
    // Retrieve all Fingerprint Attendance records
    router.get("/", [authJwt.verifyToken], fingerprintAttendance.getAllFingerprintAttendances);
    
    // Get Fingerprint Attendance records by date range (MUST come before /:id route)
    router.get("/date-range", [authJwt.verifyToken], fingerprintAttendance.getFingerprintAttendancesByDateRange);
    
    // Get Fingerprint Attendance records by employee (MUST come before /:id route)
    router.get("/employee/:employee", [authJwt.verifyToken], fingerprintAttendance.getFingerprintAttendancesByEmployee);
    
    // Retrieve a single Fingerprint Attendance record with id
    router.get("/:id", [authJwt.verifyToken], fingerprintAttendance.getFingerprintAttendance);
    
    // Update a Fingerprint Attendance record with id
    router.put("/:id", [authJwt.verifyToken], fingerprintAttendance.updateFingerprintAttendance);
    
    // Delete a Fingerprint Attendance record with id
    router.delete("/:id", [authJwt.verifyToken], fingerprintAttendance.deleteFingerprintAttendance);
    
    app.use('/api/fingerprint-attendance', router);
};