package productcategories

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

	rProductCategory "gitlab.com/mbugroup/lti-api.git/internal/modules/master/product-categories/repositories"
	sProductCategory "gitlab.com/mbugroup/lti-api.git/internal/modules/master/product-categories/services"

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

type ProductCategoryModule struct{}

func (ProductCategoryModule) RegisterRoutes(router fiber.Router, db *gorm.DB, validate *validator.Validate) {
	productCategoryRepo := rProductCategory.NewProductCategoryRepository(db)
	userRepo := rUser.NewUserRepository(db)

	productCategoryService := sProductCategory.NewProductCategoryService(productCategoryRepo, validate)
	userService := sUser.NewUserService(userRepo, validate)

	ProductCategoryRoutes(router, userService, productCategoryService)
}
