const express = require('express')
const router = express.Router()
const controller = require('../controllers/absensi.controller')
const apiKey = require('../../../middlewares/apiKey')
const jwt = require('../../../middlewares/authentication')
const upload = require('../../../middlewares/upload')

router.get('/history', apiKey, jwt, (req, res) => {
    controller.history(req, res);
})

router.post('/', jwt, apiKey, upload.single('attendances'), (req, res) => {
    controller.create(req, res)
})

router.post('/clock-out', jwt, apiKey, (req, res) => {
    controller.clockOut(req, res)
})


module.exports = router