from datetime import datetime from typing import Optional from pydantic import BaseModel, ConfigDict, Field from app.models.enums import DocumentStatus from app.utils.time import utc_now class Document(BaseModel): """ Represents a textbook uploaded to the knowledge base. """ model_config = ConfigDict( populate_by_name=True, validate_assignment=True, ) document_id: str filename: str original_filename: str file_path: str title: str subject: str standard: int language: str = "en" total_pages: int = 0 total_chunks: int = 0 status: DocumentStatus = DocumentStatus.PENDING embedding_model: str collection_name: str uploaded_by: Optional[str] = None created_at: datetime = Field(default_factory=utc_now) updated_at: datetime = Field(default_factory=utc_now)