# app/src/notifications/targets.py

from __future__ import annotations

from aiogram import Bot


class NotificationTargetRegistry:
    _bot: Bot | None = None
    _chat_id: int | None = None

    @classmethod
    def set_bot(cls, bot: Bot) -> None:
        cls._bot = bot

    @classmethod
    def set_default_chat(cls, *, bot: Bot | None = None, chat_id: int) -> None:
        if bot is not None:
            cls._bot = bot

        cls._chat_id = chat_id

    @classmethod
    def get_bot(cls) -> Bot | None:
        return cls._bot

    @classmethod
    def get_default_chat_id(cls) -> int | None:
        return cls._chat_id

    @classmethod
    def is_ready(cls) -> bool:
        return cls._bot is not None and cls._chat_id is not None