package employeess

import (
	m "gitlab.com/mbugroup/lti-api.git/internal/middleware"
	controller "gitlab.com/mbugroup/lti-api.git/internal/modules/master/employees/controllers"
	employees "gitlab.com/mbugroup/lti-api.git/internal/modules/master/employees/services"
	user "gitlab.com/mbugroup/lti-api.git/internal/modules/users/services"

	"github.com/gofiber/fiber/v2"
)

func EmployeesRoutes(v1 fiber.Router, u user.UserService, s employees.EmployeesService) {
	ctrl := controller.NewEmployeesController(s)

	route := v1.Group("/employees")
	route.Use(m.Auth(u))

	route.Get("/", m.RequirePermissions(m.P_DailyChecklistEmployee), ctrl.GetAll)
	route.Post("/", m.RequirePermissions(m.P_DailyChecklistEmployee), ctrl.CreateOne)
	route.Get("/:id", m.RequirePermissions(m.P_DailyChecklistEmployee), ctrl.GetOne)
	route.Patch("/:id", m.RequirePermissions(m.P_DailyChecklistEmployee), ctrl.UpdateOne)
	route.Delete("/:id", m.RequirePermissions(m.P_DailyChecklistEmployee), ctrl.DeleteOne)
}
