"""This module holds merchant related event definitions"""

from typing import List, Dict

MERCHANT_EVENTS: List[Dict] = [
    {
        "event_id": "merchants.created",
        "event_name": "Merchant Created",
        "description": (
            "Event triggered when a new merchant is created.  Used for "
            "initializing merchant settings, sending welcome messages, and "
            "performing any necessary setup actions related to the new merchant."
        ),
        "topic": "payment_events_merchants",
        "data_contract": {
            "merchant_id": "int",
            "email": "str — primary merchant email address",
            "name": "str — merchant business name",
        },
    },
    {
        "event_id": "merchants.updated",
        "event_name": "Merchant Updated",
        "description": (
            "Event triggered when a merchant's details are updated.  Used for "
            "logging update activity, notifying relevant services of the changes, "
            "and ensuring data consistency across systems."
        ),
        "topic": "payment_events_merchants",
        "data_contract": {
            "merchant_id": "int",
            "changed_fields": "dict — map of field_name → new_value",
        },
    },
    {
        "event_id": "merchants.provider_switched",
        "event_name": "Merchant Provider Switched",
        "description": (
            "Emitted when the active payment provider for a merchant is "
            "changed.  Useful for audit trails and provider migration tracking."
        ),
        "topic": "payment_events_merchants",
        "data_contract": {
            "merchant_id": "int",
            "old_provider_slug": "str | None — previous active provider slug",
            "new_provider_slug": "str — newly activated provider slug",
            "switched_at": "ISO8601 datetime — when the switch occurred",
        },
    },
]