from __future__ import annotations

from datetime import datetime

from pydantic import BaseModel, ConfigDict, Field


class DocumentArchiveRead(BaseModel):
    archive_id: int
    document_type: str
    business_id: int
    document_no: str
    archive_version: int
    template_version: str
    file_format: str
    file_name: str
    status: str
    error_message: str | None = None
    created_at: datetime


class DocumentArchiveGenerateResult(BaseModel):
    business_id: int
    document_type: str
    document_no: str
    archive_status: str
    archive_version: int | None = None
    archive_error_message: str | None = None


class DocumentArchiveBatchDownloadRequest(BaseModel):
    model_config = ConfigDict(validate_default=True)

    document_type: str
    business_ids: list[int] = Field(default_factory=list, min_length=1)
