"""Pydantic schemas for sync status and log."""
from pydantic import BaseModel
from datetime import datetime
from typing import Any


class SyncStatus(BaseModel):
    last_sync: datetime | None = None
    items_processed: int = 0
    status: str = "never"


class SyncLogEntry(BaseModel):
    id: int
    sync_type: str
    status: str
    items_processed: int
    items_failed: int
    error_message: str | None = None
    started_at: datetime
    completed_at: datetime | None = None

    model_config = {"from_attributes": True}


class SyncTriggerResponse(BaseModel):
    sync_id: int
    status: str
