"""GraphQL subscriptions for {{ model_name }}.

⚠️ AUTO-GENERATED BY PRISM - DO NOT EDIT
"""

from __future__ import annotations

from typing import AsyncGenerator

import strawberry
from strawberry.types import Info

from ..context import Context
from ..types.{{ snake_name }} import {{ model_name }}Type


@strawberry.type
class {{ model_name }}Subscriptions:
    """GraphQL subscriptions for {{ model_name }}."""

    @strawberry.subscription(description="{{ model_name }} created events")
    async def {{ camel_name }}Created(
        self,
        info: Info[Context, None],
    ) -> AsyncGenerator[{{ model_name }}Type, None]:
        """Subscribe to {{ model_name }} creation events."""
        # Implement with your pub/sub system (Redis, etc.)
        raise NotImplementedError("Implement subscription with your pub/sub system")
        yield  # type: ignore

    @strawberry.subscription(description="{{ model_name }} updated events")
    async def {{ camel_name }}Updated(
        self,
        info: Info[Context, None],
        id: int | None = None,
    ) -> AsyncGenerator[{{ model_name }}Type, None]:
        """Subscribe to {{ model_name }} update events."""
        raise NotImplementedError("Implement subscription with your pub/sub system")
        yield  # type: ignore

    @strawberry.subscription(description="{{ model_name }} deleted events")
    async def {{ camel_name }}Deleted(
        self,
        info: Info[Context, None],
    ) -> AsyncGenerator[int, None]:
        """Subscribe to {{ model_name }} deletion events. Returns the deleted ID."""
        raise NotImplementedError("Implement subscription with your pub/sub system")
        yield  # type: ignore


__all__ = ["{{ model_name }}Subscriptions"]
