package locations

import (
	"github.com/go-playground/validator/v10"
	"github.com/gofiber/fiber/v2"
	"gorm.io/gorm"

	rLocation "gitlab.com/mbugroup/lti-api.git/internal/modules/master/locations/repositories"
	sLocation "gitlab.com/mbugroup/lti-api.git/internal/modules/master/locations/services"

	rUser "gitlab.com/mbugroup/lti-api.git/internal/modules/users/repositories"
	sUser "gitlab.com/mbugroup/lti-api.git/internal/modules/users/services"
)

type LocationModule struct{}

func (LocationModule) RegisterRoutes(router fiber.Router, db *gorm.DB, validate *validator.Validate) {
	locationRepo := rLocation.NewLocationRepository(db)
	userRepo := rUser.NewUserRepository(db)

	locationService := sLocation.NewLocationService(locationRepo, validate)
	userService := sUser.NewUserService(userRepo, validate)

	LocationRoutes(router, userService, locationService)
}
