"""Common Pydantic schemas: standard API envelope + paginated response."""
from typing import Any, Generic, TypeVar

from pydantic import BaseModel

T = TypeVar("T")


class ApiResponse(BaseModel, Generic[T]):
    data: T
    message: str = "OK"
    statusCode: int = 200
    timestamp: str = ""


class PageData(BaseModel, Generic[T]):
    items: list[T]
    total: int
    page: int
    size: int
    pages: int


class ErrorResponse(BaseModel):
    error: str
    message: str
    statusCode: int
    timestamp: str
    path: str
