Some checks failed
CI/CD Pipeline / Code Quality & Linting (push) Has been cancelled
CI/CD Pipeline / Policy Validation (push) Has been cancelled
CI/CD Pipeline / Test Suite (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-coverage) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-extract) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-firm-connectors) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-forms) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-hmrc) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-ingestion) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-kg) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-normalize-map) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-ocr) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-rag-indexer) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-rag-retriever) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-reason) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (svc-rpa) (push) Has been cancelled
CI/CD Pipeline / Build Docker Images (ui-review) (push) Has been cancelled
CI/CD Pipeline / Security Scanning (svc-coverage) (push) Has been cancelled
CI/CD Pipeline / Security Scanning (svc-extract) (push) Has been cancelled
CI/CD Pipeline / Security Scanning (svc-kg) (push) Has been cancelled
CI/CD Pipeline / Security Scanning (svc-rag-retriever) (push) Has been cancelled
CI/CD Pipeline / Security Scanning (ui-review) (push) Has been cancelled
CI/CD Pipeline / Generate SBOM (push) Has been cancelled
CI/CD Pipeline / Deploy to Staging (push) Has been cancelled
CI/CD Pipeline / Deploy to Production (push) Has been cancelled
CI/CD Pipeline / Notifications (push) Has been cancelled
70 lines
2.6 KiB
Python
70 lines
2.6 KiB
Python
"""API response models."""
|
|
|
|
from datetime import datetime
|
|
from typing import Any
|
|
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
|
|
class DocumentUploadResponse(BaseModel):
|
|
"""Response model for document upload"""
|
|
|
|
doc_id: str = Field(..., description="Document identifier")
|
|
s3_url: str = Field(..., description="S3 URL")
|
|
checksum: str = Field(..., description="Document checksum")
|
|
|
|
|
|
class ExtractionResponse(BaseModel):
|
|
"""Response model for document extraction"""
|
|
|
|
extraction_id: str = Field(..., description="Extraction identifier")
|
|
confidence: float = Field(..., ge=0.0, le=1.0, description="Overall confidence")
|
|
extracted_fields: dict[str, Any] = Field(..., description="Extracted fields")
|
|
provenance: list[dict[str, Any]] = Field(..., description="Provenance information")
|
|
|
|
|
|
class RAGSearchResponse(BaseModel):
|
|
"""Response model for RAG search"""
|
|
|
|
chunks: list[dict[str, Any]] = Field(..., description="Retrieved chunks")
|
|
citations: list[dict[str, Any]] = Field(..., description="Source citations")
|
|
kg_hints: list[dict[str, Any]] = Field(..., description="Knowledge graph hints")
|
|
calibrated_confidence: float = Field(
|
|
..., ge=0.0, le=1.0, description="Calibrated confidence"
|
|
)
|
|
|
|
|
|
class ScheduleComputeResponse(BaseModel):
|
|
"""Response model for schedule computation"""
|
|
|
|
calculation_id: str = Field(..., description="Calculation identifier")
|
|
schedule: str = Field(..., description="Schedule identifier")
|
|
form_boxes: dict[str, dict[str, Any]] = Field(
|
|
..., description="Computed form boxes"
|
|
)
|
|
evidence_trail: list[dict[str, Any]] = Field(..., description="Evidence trail")
|
|
|
|
|
|
class HMRCSubmissionResponse(BaseModel):
|
|
"""Response model for HMRC submission"""
|
|
|
|
submission_id: str = Field(..., description="Submission identifier")
|
|
status: str = Field(..., description="Submission status")
|
|
hmrc_reference: str | None = Field(None, description="HMRC reference")
|
|
submission_timestamp: datetime = Field(..., description="Submission timestamp")
|
|
validation_results: dict[str, Any] = Field(..., description="Validation results")
|
|
|
|
|
|
class FirmSyncResponse(BaseModel):
|
|
"""Response from firm sync operation"""
|
|
|
|
model_config = ConfigDict(extra="forbid")
|
|
|
|
firm_id: str = Field(..., description="Firm identifier")
|
|
status: str = Field(..., description="Sync status: success, error, partial")
|
|
message: str = Field(..., description="Status message")
|
|
synced_entities: int = Field(default=0, description="Number of entities synced")
|
|
errors: list[str] = Field(
|
|
default_factory=list, description="List of errors encountered"
|
|
)
|