package products

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

	rProduct "gitlab.com/mbugroup/lti-api.git/internal/modules/master/products/repositories"
	sProduct "gitlab.com/mbugroup/lti-api.git/internal/modules/master/products/services"

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

type ProductModule struct{}

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

	productService := sProduct.NewProductService(productRepo, validate)
	userService := sUser.NewUserService(userRepo, validate)

	ProductRoutes(router, userService, productService)
}
