package transactions

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

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

func TransactionRoutes(v1 fiber.Router, u user.UserService, s transaction.TransactionService) {
	ctrl := controller.NewTransactionController(s)

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

	route.Get("/",m.RequirePermissions(m.P_Finances_Transaction_GetAll), ctrl.GetAll)
	route.Get("/:id",m.RequirePermissions(m.P_Finances_Transaction_GetOne),  ctrl.GetOne)
	route.Delete("/:id",m.RequirePermissions(m.P_Finances_Transaction_DeleteOne),  ctrl.DeleteOne)
}
