<?php

declare(strict_types=1);

namespace App\Application\LiveComponents\Services;

use App\Application\LiveComponents\ValueObjects\Activity;
use App\Application\LiveComponents\ValueObjects\ActivityFilter;
use App\Framework\LiveComponents\Attributes\DataProvider;

/**
 * DatabaseActivityDataProvider - Production implementation with database
 *
 * TODO: Implement actual database queries
 */
#[DataProvider(name: 'database')]
final readonly class DatabaseActivityDataProvider implements ActivityDataProvider
{
    public function __construct(
        // TODO: Inject repositories/services needed for activities
        // private readonly ActivityRepository $repository,
        // private readonly NotificationService $notifications
    ) {
    }

    public function getActivities(ActivityFilter $filter = ActivityFilter::ALL, int $limit = 50): array
    {
        // TODO: Implement database query to load activities
        // Example:
        // return $this->repository->findActivitiesWithFilter($filter, $limit);

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

    public function addActivity(Activity $activity): bool
    {
        // TODO: Implement database insert
        throw new \RuntimeException(
            'DatabaseActivityDataProvider not yet implemented. Use DemoActivityDataProvider for now.'
        );
    }

    public function markAsRead(string $activityId): bool
    {
        // TODO: Implement database update
        throw new \RuntimeException(
            'DatabaseActivityDataProvider not yet implemented. Use DemoActivityDataProvider for now.'
        );
    }

    public function markAllAsRead(): int
    {
        // TODO: Implement batch update
        throw new \RuntimeException(
            'DatabaseActivityDataProvider not yet implemented. Use DemoActivityDataProvider for now.'
        );
    }

    public function getUnreadCount(): int
    {
        // TODO: Implement count query
        throw new \RuntimeException(
            'DatabaseActivityDataProvider not yet implemented. Use DemoActivityDataProvider for now.'
        );
    }

    public function deleteActivity(string $activityId): bool
    {
        // TODO: Implement database delete
        throw new \RuntimeException(
            'DatabaseActivityDataProvider not yet implemented. Use DemoActivityDataProvider for now.'
        );
    }
}
