package payments

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

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

func PaymentRoutes(v1 fiber.Router, u user.UserService, s payment.PaymentService) {
	ctrl := controller.NewPaymentController(s)

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

	route.Post("/", m.RequirePermissions(m.P_Finances_Payments_CreateOne), ctrl.CreateOne)
	route.Get("/:id", m.RequirePermissions(m.P_Finances_Payments_GetOne), ctrl.GetOne)
	route.Patch("/:id", m.RequirePermissions(m.P_Finances_Payments_UpdateOne), ctrl.UpdateOne)
}
