package banks

import (
	m "gitlab.com/mbugroup/lti-api.git/internal/middleware"
	controller "gitlab.com/mbugroup/lti-api.git/internal/modules/master/banks/controllers"
	bank "gitlab.com/mbugroup/lti-api.git/internal/modules/master/banks/services"
	user "gitlab.com/mbugroup/lti-api.git/internal/modules/users/services"

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

func BankRoutes(v1 fiber.Router, u user.UserService, s bank.BankService) {
	ctrl := controller.NewBankController(s)

	route := v1.Group("/banks")
	route.Use(m.Auth(u))
	route.Get("/",m.RequirePermissions(m.P_BanksGetAll), ctrl.GetAll)
	route.Post("/",m.RequirePermissions(m.P_BanksCreateOne), ctrl.CreateOne)
	route.Get("/:id",m.RequirePermissions(m.P_BanksGetOne), ctrl.GetOne)
	route.Patch("/:id",m.RequirePermissions(m.P_BanksUpdateOne), ctrl.UpdateOne)
	route.Delete("/:id",m.RequirePermissions(m.P_BanksDeleteOne), ctrl.DeleteOne)
}
