refactor: split pagination logic from response models

- Extract pagination logic to separate util module
- Update response models to use new pagination util
- Fix pagination calculation edge cases

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-05-03 22:57:21 +02:00
parent b2747381ec
commit fc57c83f79
4 changed files with 47 additions and 29 deletions

View File

@@ -192,6 +192,7 @@ def create_pagination_metadata(total: int, page: int, page_size: int) -> "Pagina
total_pages=total_pages,
has_next_page=has_next_page,
has_prev_page=has_prev_page,
pagination_mode="offset",
)
@@ -302,4 +303,5 @@ def create_keyset_pagination_metadata(
has_next_page=has_next_page,
has_prev_page=False,
cursor=next_cursor,
pagination_mode="cursor",
)