# retoor <retoor@molodetz.nl>

from __future__ import annotations

from typing import Any, Optional

from pydantic import BaseModel, ConfigDict


class _Out(BaseModel):
    model_config = ConfigDict(extra="ignore")


class ActionResult(_Out):
    ok: bool = True
    redirect: Optional[str] = None
    data: Optional[Any] = None


class ErrorOut(_Out):
    error: dict


class ValidationErrorOut(_Out):
    error: str = "validation"
    fields: dict = {}
    messages: list = []
