<?php

declare(strict_types=1);

namespace App\Application\LiveComponents\Services;

use App\Application\LiveComponents\ValueObjects\SuggestionContext;
use App\Framework\LiveComponents\Attributes\DataProvider;

/**
 * DatabaseSuggestionProvider - Production implementation with database
 *
 * TODO: Implement actual database queries for autocomplete suggestions
 */
#[DataProvider(name: 'database')]
final readonly class DatabaseSuggestionProvider implements SuggestionProvider
{
    public function __construct(
        // TODO: Inject repositories/services needed for suggestions
        // private readonly SearchRepository $repository,
        // private readonly UserRepository $userRepository
    ) {
    }

    public function getSuggestions(string $query, SuggestionContext $context, int $limit = 10): array
    {
        // TODO: Implement database query to load suggestions
        // Example:
        // return $this->repository->findSuggestions($query, $context, $limit);

        throw new \RuntimeException(
            'DatabaseSuggestionProvider not yet implemented. Use DemoSuggestionProvider for now.'
        );
    }

    public function getAvailableContexts(): array
    {
        // TODO: Load from configuration or database
        throw new \RuntimeException(
            'DatabaseSuggestionProvider not yet implemented. Use DemoSuggestionProvider for now.'
        );
    }
}
