package group

import (
	"context"

	"github.com/google/uuid"
)

type Service struct {
	repo Repository
}

func NewService(repo Repository) *Service {
	return &Service{repo: repo}
}

func (s *Service) List(ctx context.Context) ([]Group, error) {
	return s.repo.List(ctx)
}

func (s *Service) Create(ctx context.Context, input CreateRequest) (Group, error) {
	return s.repo.Create(ctx, input)
}

func (s *Service) Update(ctx context.Context, groupID uuid.UUID, input UpdateRequest) (Group, error) {
	return s.repo.Update(ctx, groupID, input)
}

func (s *Service) Delete(ctx context.Context, groupID uuid.UUID) error {
	return s.repo.Delete(ctx, groupID)
}
