from __future__ import annotations

from typing import Any, Dict, Optional

from receipts.base import BaseReceipt
from receipts.compat.pyd import Field


class LabelRequest(BaseReceipt):
    """Lightweight receipt documenting a manual label request."""

    receipt_type: str = "LabelRequest"
    domain: str = Field(description="Domain of the refusal triggering the request.")
    asset_id: str = Field(description="Asset identifier linked to the refusal.")
    target_receipt_id: str = Field(description="RefusalStone receipt identifier awaiting review.")
    cohort_keys: Dict[str, Any] = Field(
        default_factory=dict,
        description="Structured cohort metadata (e.g., slate_id, cohort hashes).",
    )
    refusal_type: Optional[str] = Field(
        default=None,
        description="Typed refusal classification used for routing.",
    )
    recourse_hint: Optional[str] = Field(
        default=None,
        description="Operator-facing hint describing the quickest unblocker.",
    )
    source: str = Field(default="guardian", description="Subsystem emitting the request.")
    metadata: Dict[str, Any] = Field(default_factory=dict, description="Additional structured context.")
