package nonstocks

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

	rNonstock "gitlab.com/mbugroup/lti-api.git/internal/modules/master/nonstocks/repositories"
	sNonstock "gitlab.com/mbugroup/lti-api.git/internal/modules/master/nonstocks/services"

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

type NonstockModule struct{}

func (NonstockModule) RegisterRoutes(router fiber.Router, db *gorm.DB, validate *validator.Validate) {
	nonstockRepo := rNonstock.NewNonstockRepository(db)
	userRepo := rUser.NewUserRepository(db)

	nonstockService := sNonstock.NewNonstockService(nonstockRepo, validate)
	userService := sUser.NewUserService(userRepo, validate)

	NonstockRoutes(router, userService, nonstockService)
}
