package phases

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

	rPhases "gitlab.com/mbugroup/lti-api.git/internal/modules/master/phasess/repositories"
	sPhases "gitlab.com/mbugroup/lti-api.git/internal/modules/master/phasess/services"

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

type PhasesModule struct{}

func (PhasesModule) RegisterRoutes(router fiber.Router, db *gorm.DB, validate *validator.Validate) {
	phasesRepo := rPhases.NewPhasesRepository(db)
	userRepo := rUser.NewUserRepository(db)

	phasesService := sPhases.NewPhasesService(phasesRepo, validate)
	userService := sUser.NewUserService(userRepo, validate)

	PhasesRoutes(router, userService, phasesService)
}
