package productStocks

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

	sProductStock "gitlab.com/mbugroup/lti-api.git/internal/modules/inventory/product-stocks/services"

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

type ProductStockModule struct{}

func (ProductStockModule) RegisterRoutes(router fiber.Router, db *gorm.DB, validate *validator.Validate) {
	productRepo := rProduct.NewProductRepository(db)
	userRepo := rUser.NewUserRepository(db)

	productStockService := sProductStock.NewProductStockService(productRepo, validate)
	userService := sUser.NewUserService(userRepo, validate)

	ProductStockRoutes(router, userService, productStockService)
}
