"""Minimal in-memory event bus used for Behave assertions."""

from __future__ import annotations

from collections.abc import Callable

from cleveragents.infrastructure.events.models import DomainEvent
from cleveragents.infrastructure.events.types import EventType


class RecordingEventBus:
    """Minimal in-memory event bus used for Behave assertions."""

    def __init__(self) -> None:
        self.events: list[DomainEvent] = []

    def emit(self, event: DomainEvent) -> None:
        self.events.append(event)

    def subscribe(
        self,
        event_type: EventType,
        handler: Callable[[DomainEvent], None],
    ) -> None:
        _ = (event_type, handler)
