package kandangs

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

	rKandang "gitlab.com/mbugroup/lti-api.git/internal/modules/master/kandangs/repositories"
	sKandang "gitlab.com/mbugroup/lti-api.git/internal/modules/master/kandangs/services"

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

type KandangModule struct{}

func (KandangModule) RegisterRoutes(router fiber.Router, db *gorm.DB, validate *validator.Validate) {
	kandangRepo := rKandang.NewKandangRepository(db)
	userRepo := rUser.NewUserRepository(db)

	kandangService := sKandang.NewKandangService(kandangRepo, validate)
	userService := sUser.NewUserService(userRepo, validate)

	KandangRoutes(router, userService, kandangService)
}
