from datetime import datetime

from pydantic import BaseModel, Field


class CreateDatabaseBackupRequest(BaseModel):
    reason: str | None = Field(default="manual", max_length=120)


class RestoreDatabaseBackupRequest(BaseModel):
    confirmation: str = Field(min_length=1, max_length=200)


class DatabaseBackupOut(BaseModel):
    filename: str
    database_type: str
    created_at: datetime
    size_bytes: int
    size_label: str
    reason: str | None = None
    note: str | None = None


class RestoreDatabaseBackupOut(BaseModel):
    restored_backup: DatabaseBackupOut
    pre_restore_backup: DatabaseBackupOut
