package transfers

import (
	m "gitlab.com/mbugroup/lti-api.git/internal/middleware"
	controller "gitlab.com/mbugroup/lti-api.git/internal/modules/inventory/transfers/controllers"
	transfer "gitlab.com/mbugroup/lti-api.git/internal/modules/inventory/transfers/services"
	user "gitlab.com/mbugroup/lti-api.git/internal/modules/users/services"

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

func TransferRoutes(v1 fiber.Router, u user.UserService, s transfer.TransferService) {
	ctrl := controller.NewTransferController(s)

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

	route.Get("/", m.RequirePermissions(m.P_TransferGetAll), ctrl.GetAll)
	route.Post("/", m.RequirePermissions(m.P_TransferCreateOne), ctrl.CreateOne)
	route.Get("/:id", m.RequirePermissions(m.P_TransferGetOne), ctrl.GetOne)
	route.Delete("/:id", m.RequirePermissions(m.P_TransferDeleteOne), ctrl.DeleteOne)

}
