feat: Enhance data models and sorting logic for investors and projects

This commit is contained in:
bolade
2025-11-11 13:09:30 +01:00
parent 0e4763bf4f
commit 5e83734acf
6 changed files with 129 additions and 35 deletions
+2 -2
View File
@@ -258,10 +258,10 @@ Return ONLY the SQL query, no explanations or markdown.""",
else None
)
# Get top 3 sectors from fund (id and name only)
# Get top 3 sectors from fund (id and name only) - sorted alphabetically
fund_sectors = [
SectorMinimal(id=sector.id, name=sector.name)
for sector in (fund.sectors[:3] if fund.sectors else [])
for sector in sorted(fund.sectors[:3] if fund.sectors else [], key=lambda s: s.name)
]
investment_response = InvestmentResponse(