package kandanggroups

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

	rKandangGroup "gitlab.com/mbugroup/lti-api.git/internal/modules/master/kandang-groups/repositories"
	sKandangGroup "gitlab.com/mbugroup/lti-api.git/internal/modules/master/kandang-groups/services"

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

type KandangGroupModule struct{}

func (KandangGroupModule) RegisterRoutes(router fiber.Router, db *gorm.DB, validate *validator.Validate) {
	kandangGroupRepo := rKandangGroup.NewKandangGroupRepository(db)
	userRepo := rUser.NewUserRepository(db)

	kandangGroupService := sKandangGroup.NewKandangGroupService(kandangGroupRepo, validate)
	userService := sUser.NewUserService(userRepo, validate)

	KandangGroupRoutes(router, userService, kandangGroupService)
}
