"""Event definitions for the products and product_categories domains."""

from typing import List, Dict

PRODUCT_EVENTS: List[Dict] = [
    {
        "event_id": "product.created",
        "event_name": "Product Created",
        "description": (
            "Emitted when a new product is created by a merchant. "
            "Consumed by reporting and inventory listeners."
        ),
        "topic": "payment_events_products",
        "data_contract": {
            "product_id": "int — Product.id",
            "slug": "str — Product.slug",
            "merchant_id": "int — Merchant.id who owns the product",
        },
    },
    {
        "event_id": "product.updated",
        "event_name": "Product Updated",
        "description": (
            "Emitted when a product is updated by a merchant."
        ),
        "topic": "payment_events_products",
        "data_contract": {
            "product_id": "int — Product.id",
            "slug": "str — Product.slug",
            "merchant_id": "int",
        },
    },
    {
        "event_id": "product.deleted",
        "event_name": "Product Deleted",
        "description": (
            "Emitted when a product is soft-deleted by a merchant."
        ),
        "topic": "payment_events_products",
        "data_contract": {
            "slug": "str — Product.slug",
            "merchant_id": "int",
        },
    },
    {
        "event_id": "product_category.created",
        "event_name": "Product Category Created",
        "description": (
            "Emitted when a new product category is created by a merchant."
        ),
        "topic": "payment_events_products",
        "data_contract": {
            "category_id": "int — ProductCategory.id",
            "slug": "str — ProductCategory.slug",
            "merchant_id": "int",
        },
    },
    {
        "event_id": "product_category.updated",
        "event_name": "Product Category Updated",
        "description": (
            "Emitted when a product category is updated by a merchant."
        ),
        "topic": "payment_events_products",
        "data_contract": {
            "category_id": "int — ProductCategory.id",
            "merchant_id": "int",
        },
    },
    {
        "event_id": "product_category.deleted",
        "event_name": "Product Category Deleted",
        "description": (
            "Emitted when a product category is soft-deleted by a merchant."
        ),
        "topic": "payment_events_products",
        "data_contract": {
            "category_id": "int — ProductCategory.id",
            "merchant_id": "int",
        },
    },
]
