package service

import (
	repository "gitlab.com/mbugroup/lti-api.git/internal/modules/constants/repositories"

	"github.com/go-playground/validator/v10"
	"github.com/gofiber/fiber/v2"
)

type ConstantService interface {
	GetAll(ctx *fiber.Ctx) (map[string]interface{}, error)
}

type constantService struct {
	Repository repository.ConstantRepository
}

func NewConstantService(repo repository.ConstantRepository, validate *validator.Validate) ConstantService {
	return &constantService{
		Repository: repo,
	}
}

func (s constantService) GetAll(c *fiber.Ctx) (map[string]interface{}, error) {
	return s.Repository.GetConstants()
}
