from pydantic import BaseModel, field_validator


class PaymentWebhookRequest(BaseModel):
    ticket_id: int
    idempotency_key: str
    status: str

    @field_validator("status")
    @classmethod
    def status_must_be_success(cls, v: str) -> str:
        if v != "success":
            raise ValueError("Only 'success' status is accepted")
        return v
