Initial commit of document-service

This commit is contained in:
2026-04-23 16:20:58 -05:00
commit 51d60f0032
30 changed files with 4357 additions and 0 deletions

30
app/models.py Normal file
View File

@@ -0,0 +1,30 @@
from pydantic import BaseModel, Field
from datetime import datetime
from typing import Optional
from app.enums import DocumentType
class DocumentMetadata(BaseModel):
document_id: str = Field(..., description="UUID of the document")
org_id: str = Field(..., description="Organization ID")
document_type: DocumentType = Field(..., description="Type of document")
filename: str = Field(..., description="Original filename")
content_type: str = Field(..., description="MIME type")
file_size: int = Field(..., description="File size in bytes")
s3_key: str = Field(..., description="S3 key for the document")
created_at: datetime = Field(default_factory=datetime.utcnow)
updated_at: datetime = Field(default_factory=datetime.utcnow)
class UploadResponse(BaseModel):
document_id: str
metadata: DocumentMetadata
download_url: str
class DownloadUrlResponse(BaseModel):
download_url: str
s3_key: str
expires_in: int
class FieldsResponse(BaseModel):
document_id: str
document_type: DocumentType
fields: list[dict]