"""Event definitions for the payment_methods domain."""

from typing import List, Dict

PAYMENT_METHOD_EVENTS: List[Dict] = [
    {
        "event_id": "payment_method.tokenized",
        "event_name": "Payment Method Tokenized",
        "description": (
            "Emitted after a payment method stub is written with "
            "PENDING_TOKENIZATION status.  Consumed by the payment_methods "
            "listener to call the active provider and hydrate card/ACH details."
        ),
        "topic": "payment_events_payment_methods",
        "emitted_by": "payment_methods/services.py",
        "consumed_by": ["payment_methods/listener.py"],
        "data_contract": {
            "payment_method_id": "int — internal PK of the PaymentMethod stub",
            "merchant_id": "int",
            "iframe_token": "str — raw iframe token from the provider",
            "payment_method_type": "str — 'card' | 'ach'",
        },
    },
    {
        "event_id": "payment_method.saved",
        "event_name": "Payment Method Saved",
        "description": (
            "Emitted after the payment_methods listener has successfully "
            "hydrated card/ACH details and set status to ACTIVE.  No "
            "downstream consumers at this time."
        ),
        "topic": "payment_events_payment_methods",
        "emitted_by": "payment_methods/listener.py",
        "consumed_by": [],
        "data_contract": {
            "payment_method_id": "int",
            "merchant_id": "int",
            "payment_method_type": "str — 'card' | 'ach'",
        },
    },
    {
        "event_id": "payment_method.deleted",
        "event_name": "Payment Method Deleted",
        "description": (
            "Emitted after a payment method is soft-deleted.  No "
            "downstream consumers at this time."
        ),
        "topic": "payment_events_payment_methods",
        "emitted_by": "payment_methods/router.py",
        "consumed_by": [],
        "data_contract": {
            "payment_method_id": "int",
            "merchant_id": "int",
        },
    },
]
