const { body } = require('express-validator');
const { schedules, update } = require('../../controllers/drivers/schedules');
const { driverAuth, validation } = require('../../middlewares');

const router = require('express').Router();

router.get('/', driverAuth, schedules);

router.patch(
	'/',
	driverAuth,
	[body('action').isString().isIn(['start', 'finish']), body('scheduleId').notEmpty(), validation],
	update,
);

module.exports = router;
