feat: Update investor report generation and HTML template to include fund details and improve data handling
This commit is contained in:
Binary file not shown.
+12
-15
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user