"""Base schemas — shared response envelopes."""

from __future__ import annotations

from typing import Generic, TypeVar

from pydantic import BaseModel

T = TypeVar("T")


class MetaResponse(BaseModel):
    """Standard meta block for API responses."""

    total: int
    page: int = 1
    page_size: int = 20


class PaginatedResponse(BaseModel, Generic[T]):
    """Generic paginated envelope: ``{items, meta}``."""

    items: list[T]
    meta: MetaResponse