<?php

declare(strict_types=1);

namespace App\Framework\Notification\Channels\Telegram;

use App\Framework\Notification\Channels\Telegram\ValueObjects\TelegramChatId;

/**
 * Fixed chat ID resolver
 *
 * Returns a single hardcoded chat ID for all users
 * Useful for development/testing or single-user scenarios
 */
final readonly class FixedChatIdResolver implements UserChatIdResolver
{
    public function __construct(
        private TelegramChatId $chatId
    ) {
    }

    /**
     * Always returns the same chat ID regardless of user ID
     */
    public function resolveChatId(string $userId): ?TelegramChatId
    {
        return $this->chatId;
    }

    /**
     * Create resolver with default chat ID
     */
    public static function createDefault(): self
    {
        return new self(
            chatId: TelegramChatId::fromString('8240973979')
        );
    }
}
