Initial commit of document-service
This commit is contained in:
30
app/models.py
Normal file
30
app/models.py
Normal 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]
|
||||
Reference in New Issue
Block a user