package phases

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

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

func PhasesRoutes(v1 fiber.Router, u user.UserService, s phases.PhasesService) {
	ctrl := controller.NewPhasesController(s)

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

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