feat: Update investor report generation and HTML template to include fund details and improve data handling

This commit is contained in:
bolade
2025-10-21 10:48:58 +01:00
parent 63d8e57e57
commit 483c2cc114
10 changed files with 289 additions and 135 deletions
Binary file not shown.
+12 -15
View File
@@ -52,7 +52,6 @@ async def generate_investor_report(
"website": investor.website,
"headquarters": investor.headquarters,
"aum": investor.aum,
"geographic_focus": investor.geographic_focus,
"portfolio_highlights": investor.portfolio_highlights or [],
"investment_thesis": investor.investment_thesis or [],
"sectors": [sector.name for sector in investor.sectors],
@@ -65,24 +64,22 @@ async def generate_investor_report(
}
for member in investor.team_members
],
"check_size_lower": None,
"check_size_upper": None,
"investment_stages": [],
"funds": [],
}
# Get check sizes and stages from funds
# Get all funds with their data
if investor.funds:
# Use the first fund's data or aggregate
fund = investor.funds[0]
investor_data["check_size_lower"] = fund.check_size_lower
investor_data["check_size_upper"] = fund.check_size_upper
# Aggregate all investment stages from all funds
stages = set()
for fund in investor.funds:
for stage in fund.investment_stages:
stages.add(stage.name)
investor_data["investment_stages"] = list(stages)
fund_data = {
"fund_name": fund.fund_name,
"fund_size": fund.fund_size,
"check_size_lower": fund.check_size_lower,
"check_size_upper": fund.check_size_upper,
"geographic_focus": fund.geographic_focus,
"investment_stages": [stage.name for stage in fund.investment_stages],
"sectors": [sector.name for sector in fund.sectors],
}
investor_data["funds"].append(fund_data)
# Fetch project data if project_id is provided
project_data = None