const EmployeeCtrl = require('../controllers/employee');

const employeeRoutes = (router) => {
    const employeeCtrl = new EmployeeCtrl();

    // AccountController
    router.route('/account/login').post(employeeCtrl.login);
    router.route('/account/getByUsername').post(employeeCtrl.getByUsername);
    router.route('/account/logout').get(employeeCtrl.logout);
    router.route('/account/lock').get(employeeCtrl.lock);
    router.route('/account/unlock').post(employeeCtrl.unlock);
    router.route('/account/changePass').post(employeeCtrl.changePassword);
    router.route('/account/checkSupervisor').post(employeeCtrl.checkSupervisor);

    // DriverController
    router.route('/drivers/getAll').get(employeeCtrl.getUsersForTypeDriver);
    router.route('/drivers/assign').post(employeeCtrl.pushEmployee);
    router.route('/drivers/block').post(employeeCtrl.pushEmployee);
    router.route('/drivers/unblock').get(employeeCtrl.unblock);

    // PosUserController
    router.route('/posUser/getAll').get(employeeCtrl.getUsersForTypePos);
    router.route('/posUser/getSessionToday').get(employeeCtrl.getSessionToday);
    router.route('/posUser/getSessionHistory').get(employeeCtrl.getSessionHistory);
    router.route('/posUser/changePass').post(employeeCtrl.changePassword);
}

module.exports = employeeRoutes;
