"""Data model definitions for mykb."""

from pydantic import BaseModel, ConfigDict


class CollectionConfig(BaseModel):
    source: str = 'obsidian'  # source type, default obsidian for backward compat
    path: str = ''  # obsidian uses this, other sources may not
    mask: str = '**/*.md'
    exclude: list[str] = []
    description: str = ''
    model_config = ConfigDict(extra='allow')


class MykbDocument(BaseModel):
    """Meilisearch document schema."""

    id: str  # "{collection}_{content_hash}_{chunk_idx}"
    collection: str
    source_path: str  # relative path within collection
    source_uri: str  # obsidian:// URI or file:// URI
    title: str
    content: str
    chunk_index: int
    category: str  # "note" | "journal" | "reference" etc.
    tags: list[str] = []
    created_at: str | None = None
    modified_at: str | None = None
