{{define "route"}}package {{Kebab .Entity}}s

import (
	m "gitlab.com/mbugroup/lti-api.git/internal/middleware"
	controller "gitlab.com/mbugroup/lti-api.git/internal/modules/{{Kebab .FeatName}}s/controllers"
	{{Camel .Entity}} "gitlab.com/mbugroup/lti-api.git/internal/modules/{{Kebab .FeatName}}s/services"
	user "gitlab.com/mbugroup/lti-api.git/internal/modules/users/services"

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

func {{Pascal .Entity}}Routes(v1 fiber.Router, u user.UserService, s {{Camel .Entity}}.{{Pascal .Entity}}Service) {
	ctrl := controller.New{{Pascal .Entity}}Controller(s)

	route := v1.Group("/{{Kebab .Entity}}s")
	route.Use(m.Auth(u))

	route.Get("/", m.RequirePermissions(m.P_FinanceGetAll), ctrl.GetAll)
	route.Post("/", m.RequirePermissions(m.P_FinanceGetOne), ctrl.CreateOne)
	route.Get("/:id", m.RequirePermissions(m.P_FinanceCreateOne), ctrl.GetOne)
	route.Patch("/:id", m.RequirePermissions(m.P_FinanceUpdateOne), ctrl.UpdateOne)
	route.Delete("/:id", m.RequirePermissions(m.P_FinanceDeleteOne), ctrl.DeleteOne)
}
{{end}}
