updated pagination commit to carry

This commit is contained in:
2025-04-28 13:19:01 +03:00
parent ac344773c5
commit 2d418644bb
5 changed files with 228 additions and 179 deletions

View File

@@ -144,6 +144,18 @@ class Pagination:
self.orderField = "uu_id"
self.orderType = "asc"
@property
def next_available(self) -> bool:
if self.page < self.total_pages:
return True
return False
@property
def back_available(self) -> bool:
if self.page > 1:
return True
return False
@property
def as_dict(self) -> Dict[str, Any]:
"""Convert pagination state to dictionary format."""
@@ -157,6 +169,8 @@ class Pagination:
"pageCount": self.page_count,
"orderField": self.orderField,
"orderType": self.orderType,
"next": self.next_available,
"back": self.back_available,
}