people endpoints and super user events built

This commit is contained in:
2025-04-13 17:28:20 +03:00
parent c3b7556e7e
commit 9a4696af77
363 changed files with 3270 additions and 264289 deletions

View File

@@ -6,6 +6,8 @@ adding convenience methods for accessing data and managing query state.
"""
from typing import Any, Dict, Optional, TypeVar, Generic, Union
from pydantic import BaseModel
from sqlalchemy.orm import Query
@@ -107,3 +109,19 @@ class PostgresResponse(Generic[T]):
"count": self.count,
"data": self.data.get_dict() if self.data else {},
}
class EndpointResponse(BaseModel):
completed: bool = True
message: str = "Success"
pagination_result: Any
@property
def response(self):
"""Convert response to dictionary format."""
return {
"completed": self.completed,
"message": self.message,
"data": self.pagination_result.data,
"pagination": self.pagination_result.pagination.as_dict(),
}