package customers

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

	rCustomer "gitlab.com/mbugroup/lti-api.git/internal/modules/master/customers/repositories"
	sCustomer "gitlab.com/mbugroup/lti-api.git/internal/modules/master/customers/services"

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

type CustomerModule struct{}

func (CustomerModule) RegisterRoutes(router fiber.Router, db *gorm.DB, validate *validator.Validate) {
	customerRepo := rCustomer.NewCustomerRepository(db)
	userRepo := rUser.NewUserRepository(db)

	customerService := sCustomer.NewCustomerService(customerRepo, validate)
	userService := sUser.NewUserService(userRepo, validate)

	CustomerRoutes(router, userService, customerService)
}
