arbret/backend/schemas/pagination.py

16 lines
313 B
Python
Raw Normal View History

2025-12-26 20:04:46 +01:00
from typing import Generic, TypeVar
from pydantic import BaseModel
RecordT = TypeVar("RecordT", bound=BaseModel)
class PaginatedResponse(BaseModel, Generic[RecordT]):
"""Generic paginated response wrapper."""
records: list[RecordT]
total: int
page: int
per_page: int
total_pages: int