package injections

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

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

func InjectionRoutes(v1 fiber.Router, u user.UserService, s injection.InjectionService) {
	ctrl := controller.NewInjectionController(s)

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

	route.Post("/", m.RequirePermissions(m.P_Finances_Injections_CreateOne), ctrl.CreateOne)
	route.Get("/:id", m.RequirePermissions(m.P_Finances_Injections_GetOne), ctrl.GetOne)
	route.Patch("/:id", m.RequirePermissions(m.P_Finances_Injections_UpdateOne), ctrl.UpdateOne)
}
