package fcrs

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

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

func FcrRoutes(v1 fiber.Router, u user.UserService, s fcr.FcrService) {
	ctrl := controller.NewFcrController(s)

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

	route.Get("/",m.RequirePermissions(m.P_FcrGetAll), ctrl.GetAll)
	route.Post("/",m.RequirePermissions(m.P_FcrCreateOne), ctrl.CreateOne)
	route.Get("/:id",m.RequirePermissions(m.P_FcrGetOne), ctrl.GetOne)
	route.Patch("/:id",m.RequirePermissions(m.P_FcrUpdateOne), ctrl.UpdateOne)
	route.Delete("/:id",m.RequirePermissions(m.P_FcrDeleteOne), ctrl.DeleteOne)
}
