"""
DSMS Gateway — Pydantic request/response models.
"""

from typing import Optional
from pydantic import BaseModel


class DocumentMetadata(BaseModel):
    """Metadaten für gespeicherte Dokumente"""
    document_type: str  # 'legal_document', 'consent_record', 'audit_log'
    document_id: Optional[str] = None
    version: Optional[str] = None
    language: Optional[str] = "de"
    created_at: Optional[str] = None
    checksum: Optional[str] = None
    encrypted: bool = False
    parent_cid: Optional[str] = None  # CID of previous version (version chain)
    tenant_id: Optional[str] = None


class StoredDocument(BaseModel):
    """Antwort nach erfolgreichem Speichern"""
    cid: str  # Content Identifier (IPFS Hash)
    size: int
    metadata: DocumentMetadata
    gateway_url: str
    timestamp: str


class DocumentList(BaseModel):
    """Liste der gespeicherten Dokumente"""
    documents: list
    total: int
