30 lines
580 B
Python
30 lines
580 B
Python
"""Typed results returned by all command handlers."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass, field
|
|
from typing import Any
|
|
|
|
from app.cad_agent.domain.errors import WorkflowError
|
|
|
|
|
|
@dataclass(frozen=True, slots=True)
|
|
class Accepted:
|
|
payload: dict[str, Any] = field(default_factory=dict)
|
|
|
|
|
|
@dataclass(frozen=True, slots=True)
|
|
class Rejected:
|
|
error: WorkflowError
|
|
|
|
|
|
@dataclass(frozen=True, slots=True)
|
|
class Waiting:
|
|
error: WorkflowError
|
|
|
|
|
|
@dataclass(frozen=True, slots=True)
|
|
class FailedInternal:
|
|
correlation_id: str
|
|
message: str
|