"""Event definitions for the customers domain."""

from typing import List, Dict

CUSTOMER_EVENTS: List[Dict] = [
    {
        "event_id": "customer.account_created",
        "event_name": "Customer Account Created",
        "description": (
            "Emitted when a customer creates a portal account via the HPP "
            "registration flow (POST /hpp/customer/register).  Consumed by the "
            "notifications listener to send a welcome + email-verification message."
        ),
        "topic": "payment_events_customers",
        "data_contract": {
            "user_id": "int — User.id of the newly created portal account",
            "email": "str — email address used to register",
            "merchant_id": "int — merchant whose portal the account belongs to",
        },
    },
    {
        "event_id": "customer.created",
        "event_name": "Customer Created",
        "description": (
            "Emitted when a new customer account is created by a merchant. "
            "Consumed by the notifications listener to send a welcome message."
        ),
        "topic": "payment_events_customers",
        "data_contract": {
            "customer_id": "str — Customer.customer_id (alphanumeric identifier)",
            "merchant_id": "int — Merchant.id who owns the customer",
            "email": "str | None — customer email if provided",
        },
    },
    {
        "event_id": "customer.updated",
        "event_name": "Customer Updated",
        "description": (
            "Emitted when a customer account is updated by a merchant."
        ),
        "topic": "payment_events_customers",
        "data_contract": {
            "customer_id": "str — Customer.customer_id",
            "merchant_id": "int",
            "updated_fields": "List[str] — names of the fields that were changed",
        },
    },
    {
        "event_id": "customer.activated",
        "event_name": "Customer Activated",
        "description": (
            "Emitted when a customer account is activated (or restored from soft-delete)."
        ),
        "topic": "payment_events_customers",
        "data_contract": {
            "customer_id": "str — Customer.customer_id",
            "merchant_id": "int | None",
        },
    },
    {
        "event_id": "customer.deactivated",
        "event_name": "Customer Deactivated",
        "description": (
            "Emitted when a customer account is deactivated."
        ),
        "topic": "payment_events_customers",
        "data_contract": {
            "customer_id": "str — Customer.customer_id",
            "merchant_id": "int | None",
        },
    },
    {
        "event_id": "customer.deleted",
        "event_name": "Customer Deleted",
        "description": (
            "Emitted when a customer account is soft-deleted."
        ),
        "topic": "payment_events_customers",
        "data_contract": {
            "customer_id": "str — Customer.customer_id",
            "merchant_id": "int | None",
        },
    },
]
