"""Request / response models for catalog-related routes.""" from datetime import datetime from pydantic import BaseModel, Field class CatalogRebuildRequest(BaseModel): user_id: str class CatalogRebuildResponse(BaseModel): user_id: str sources_rebuilt: int class CatalogIndexEntry(BaseModel): """One row in the per-user catalog index — used by the refresher to decide which sources to rebuild and by the UI to list registered sources. """ source_id: str = Field(..., description="Stable internal source identifier.") source_type: str = Field(..., description="schema | tabular | unstructured.") name: str = Field(..., description="Display name (DB name or filename).") location_ref: str = Field(..., description="URI: dbclient://… or az_blob://…") table_count: int = Field(..., description="Number of tables/sheets in this source.") updated_at: datetime = Field(..., description="Last time this source was (re)introspected.")