package areas

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

	rArea "gitlab.com/mbugroup/lti-api.git/internal/modules/master/areas/repositories"
	sArea "gitlab.com/mbugroup/lti-api.git/internal/modules/master/areas/services"

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

type AreaModule struct{}

func (AreaModule) RegisterRoutes(router fiber.Router, db *gorm.DB, validate *validator.Validate) {
	areaRepo := rArea.NewAreaRepository(db)
	userRepo := rUser.NewUserRepository(db)

	areaService := sArea.NewAreaService(areaRepo, validate)
	userService := sUser.NewUserService(userRepo, validate)

	AreaRoutes(router, userService, areaService)
}
