"""Event definitions for the files domain."""

from typing import List, Dict

FILE_EVENTS: List[Dict] = [
    {
        "event_id": "file.uploaded",
        "event_name": "File Uploaded",
        "description": (
            "Emitted after a file is successfully persisted in the database "
            "and uploaded to storage.  No downstream consumers at this time."
        ),
        "topic": "payment_events_files",
        "emitted_by": "files/file_services.py",
        "consumed_by": [],
        "data_contract": {
            "file_id": "int — internal PK of the File record",
            "merchant_id": "int | None",
            "file_type": "str — e.g. 'document' | 'thumbnail'",
            "s3_key": "str | None — S3 object key if CDN is S3",
            "path": "str — storage path",
        },
    },
    {
        "event_id": "file.deleted",
        "event_name": "File Deleted",
        "description": (
            "Emitted after a File record is soft-deleted (deleted_at set).  "
            "Consumed by the files listener to asynchronously purge the "
            "physical file from S3 or the local filesystem."
        ),
        "topic": "payment_events_files",
        "emitted_by": "files/file_services.py",
        "consumed_by": ["files/listener.py"],
        "data_contract": {
            "file_id": "int — internal PK of the File record",
            "merchant_id": "int | None",
            "s3_key": "str | None — S3 object key; None for local filesystem files",
            "upload_path": "str — full filesystem/CDN path used by remove_file_single()",
        },
    },
]
