package phaseActivity

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

	rPhaseActivity "gitlab.com/mbugroup/lti-api.git/internal/modules/master/phase-activities/repositories"
	sPhaseActivity "gitlab.com/mbugroup/lti-api.git/internal/modules/master/phase-activities/services"
	rPhases "gitlab.com/mbugroup/lti-api.git/internal/modules/master/phasess/repositories"

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

type PhaseActivityModule struct{}

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

	phaseActivityService := sPhaseActivity.NewPhaseActivityService(phaseActivityRepo, phasesRepo, validate)
	userService := sUser.NewUserService(userRepo, validate)

	PhaseActivityRoutes(router, userService, phaseActivityService)
}
