TorbatYar/backend/services/workspace/app/providers/contracts.py
Mortezakoohjani a483b47369 feat(workspace): complete production workspace and content operations
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-12 11:54:17 +03:30

30 lines
741 B
Python

"""External integration contracts. Workspace does not own blobs or notification delivery."""
from dataclasses import dataclass
@dataclass(frozen=True)
class FileStorageContract:
available: bool
status: str
mode: str = "reference_only"
@dataclass(frozen=True)
class NotificationContract:
available: bool
status: str
mode: str = "persisted_only"
def file_storage_state(base_url: str | None) -> FileStorageContract:
ready = bool(base_url)
return FileStorageContract(
available=ready,
status="ready" if ready else "unavailable",
)
def notification_state() -> NotificationContract:
return NotificationContract(available=False, status="persisted_only")