feat: Implement pagination for companies, investors, and projects endpoints

This commit is contained in:
bolade
2025-10-08 10:25:52 +01:00
parent 26a1197db0
commit faf92a3b47
4 changed files with 190 additions and 37 deletions
+17 -1
View File
@@ -1,9 +1,12 @@
from datetime import datetime
from enum import Enum
from typing import Any, List, Optional
from typing import Any, Generic, List, Optional, TypeVar
from pydantic import BaseModel
# Generic type for pagination
T = TypeVar("T")
class InvestmentStage(str, Enum):
SEED = "SEED"
@@ -184,3 +187,16 @@ class InvestorFundList(BaseModel):
"""List of investor-fund combinations"""
investor_funds: List[InvestorFundData]
class PaginatedResponse(BaseModel, Generic[T]):
"""Generic paginated response schema"""
items: List[T]
total: int
page: int
page_size: int
total_pages: int
class Config:
from_attributes = True