package warehouses

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

	rWarehouse "gitlab.com/mbugroup/lti-api.git/internal/modules/master/warehouses/repositories"
	sWarehouse "gitlab.com/mbugroup/lti-api.git/internal/modules/master/warehouses/services"

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

type WarehouseModule struct{}

func (WarehouseModule) RegisterRoutes(router fiber.Router, db *gorm.DB, validate *validator.Validate) {
	warehouseRepo := rWarehouse.NewWarehouseRepository(db)
	userRepo := rUser.NewUserRepository(db)

	warehouseService := sWarehouse.NewWarehouseService(warehouseRepo, validate)
	userService := sUser.NewUserService(userRepo, validate)

	WarehouseRoutes(router, userService, warehouseService)
}
