"""Event definitions for the pricing_control domain (PRD-HWADM-002)."""

from typing import List, Dict

PRICING_EVENTS: List[Dict] = [
    {
        "event_id": "pricing.template.created",
        "event_name": "Pricing Template Created",
        "description": "Emitted when an admin creates a new pricing template.",
        "topic": "payment_events_pricing",
        "data_contract": {
            "template_id": "int",
            "name": "str",
            "pricing_type": "str",
            "billing_cycle": "str",
            "created_by_user_id": "int",
        },
    },
    {
        "event_id": "pricing.template.updated",
        "event_name": "Pricing Template Updated",
        "description": "Emitted when an admin edits a template (creates a new version).",
        "topic": "payment_events_pricing",
        "data_contract": {
            "new_template_id": "int",
            "parent_template_id": "int",
            "name": "str",
            "updated_by_user_id": "int",
        },
    },
    {
        "event_id": "pricing.template.assigned",
        "event_name": "Pricing Template Assigned",
        "description": "Emitted when a pricing template is assigned to one or more merchants.",
        "topic": "payment_events_pricing",
        "data_contract": {
            "template_id": "int",
            "merchant_id": "int",
            "effective_date": "str — ISO 8601",
            "assigned_by_user_id": "int",
        },
    },
    {
        "event_id": "pricing.billing.record.created",
        "event_name": "Platform Billing Record Created",
        "description": "Emitted when the monthly billing Celery task creates a BillingRecord.",
        "topic": "payment_events_pricing",
        "data_contract": {
            "billing_record_id": "int",
            "merchant_id": "int",
            "period_start": "str — ISO 8601",
            "period_end": "str — ISO 8601",
            "total_due_cents": "int",
        },
    },
    {
        "event_id": "pricing.billing.charge.succeeded",
        "event_name": "Platform Billing Charge Succeeded",
        "description": "Emitted when the platform successfully charges a merchant for their billing period.",
        "topic": "payment_events_pricing",
        "data_contract": {
            "billing_record_id": "int",
            "merchant_id": "int",
            "amount_cents": "int",
            "charge_txn_id": "str",
        },
    },
    {
        "event_id": "pricing.billing.charge.failed",
        "event_name": "Platform Billing Charge Failed",
        "description": "Emitted when a platform billing charge fails after all retries.",
        "topic": "payment_events_pricing",
        "data_contract": {
            "billing_record_id": "int",
            "merchant_id": "int",
            "retry_count": "int",
            "last_error": "str",
        },
    },
]
