package phaseActivity

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

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

func PhaseActivityRoutes(v1 fiber.Router, u user.UserService, s phaseActivity.PhaseActivityService) {
	ctrl := controller.NewPhaseActivityController(s)

	route := v1.Group("/phase-activities")
	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)
}
