package flocks

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

	rFlock "gitlab.com/mbugroup/lti-api.git/internal/modules/master/flocks/repositories"
	sFlock "gitlab.com/mbugroup/lti-api.git/internal/modules/master/flocks/services"

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

type FlockModule struct{}

func (FlockModule) RegisterRoutes(router fiber.Router, db *gorm.DB, validate *validator.Validate) {
	flockRepo := rFlock.NewFlockRepository(db)
	userRepo := rUser.NewUserRepository(db)

	flockService := sFlock.NewFlockService(flockRepo, validate)
	userService := sUser.NewUserService(userRepo, validate)

	FlockRoutes(router, userService, flockService)
}
