diff --git a/app/db/__pycache__/db.cpython-312.pyc b/app/db/__pycache__/db.cpython-312.pyc index 87ca129..c852d80 100644 Binary files a/app/db/__pycache__/db.cpython-312.pyc and b/app/db/__pycache__/db.cpython-312.pyc differ diff --git a/app/db/db.py b/app/db/db.py index 184edf1..ca7870b 100644 --- a/app/db/db.py +++ b/app/db/db.py @@ -14,7 +14,7 @@ Base = declarative_base() # Get absolute path to the preprocessor database # APP_DIR = Path(__file__).parent.parent # PREPROCESSOR_DB = APP_DIR.parent / "preprocessor" / "version_two.db" -DATABASE_URL = os.getenv("DATABASE_URL", "sqlite:///./version_two.db") +DATABASE_URL = os.getenv("DATABASE_URL", "sqlite:///./investors.db") # Create engine engine = create_engine(DATABASE_URL, echo=False) diff --git a/app/routers/__pycache__/investors.cpython-312.pyc b/app/routers/__pycache__/investors.cpython-312.pyc index 1e64e4f..f98ebd5 100644 Binary files a/app/routers/__pycache__/investors.cpython-312.pyc and b/app/routers/__pycache__/investors.cpython-312.pyc differ diff --git a/app/routers/investors.py b/app/routers/investors.py index 951e04f..7537b94 100644 --- a/app/routers/investors.py +++ b/app/routers/investors.py @@ -18,22 +18,24 @@ router = APIRouter(tags=["Investor Routes"]) class InvestorCreate(BaseModel): name: str description: Optional[str] = None + website: Optional[str] = None + headquarters: Optional[str] = None aum: int check_size_lower: int check_size_upper: int geographic_focus: str - stage_focus: InvestmentStage number_of_investments: int = 0 class InvestorUpdate(BaseModel): name: Optional[str] = None description: Optional[str] = None + website: Optional[str] = None + headquarters: Optional[str] = None aum: Optional[int] = None check_size_lower: Optional[int] = None check_size_upper: Optional[int] = None geographic_focus: Optional[str] = None - stage_focus: Optional[InvestmentStage] = None number_of_investments: Optional[int] = None @@ -155,8 +157,9 @@ def filter_investors( ) # Apply filters - if stage: - query = query.filter(InvestorTable.stage_focus == stage) + # Note: stage filtering is now done at fund level via fund.investment_stages + # if stage: + # query = query.filter(InvestorTable.stage_focus == stage) if min_check_size is not None: query = query.filter(InvestorTable.check_size_lower >= min_check_size) @@ -413,9 +416,10 @@ def find_similar_investors( for candidate in candidates: score = 0 - # Stage focus match (30 points) - if candidate.stage_focus == target_investor.stage_focus: - score += 30 + # Stage focus match is now handled at fund level + # Skip stage matching at investor level since stage_focus no longer exists + # if candidate.stage_focus == target_investor.stage_focus: + # score += 30 # Geographic focus match (20 points for exact, 10 for partial) if candidate.geographic_focus and target_investor.geographic_focus: diff --git a/app/schemas/__pycache__/router_schemas.cpython-312.pyc b/app/schemas/__pycache__/router_schemas.cpython-312.pyc index 65ff42c..69fb8c4 100644 Binary files a/app/schemas/__pycache__/router_schemas.cpython-312.pyc and b/app/schemas/__pycache__/router_schemas.cpython-312.pyc differ diff --git a/app/schemas/router_schemas.py b/app/schemas/router_schemas.py index e43382f..e9ad155 100644 --- a/app/schemas/router_schemas.py +++ b/app/schemas/router_schemas.py @@ -1,6 +1,6 @@ from datetime import datetime from enum import Enum -from typing import List, Optional +from typing import Any, List, Optional from pydantic import BaseModel @@ -89,11 +89,20 @@ class InvestorSchema(BaseModel): id: int name: str description: Optional[str] + website: Optional[str] = None + headquarters: Optional[str] = None aum: int | None + aum_as_of_date: str | None = None + aum_source_url: str | None = None check_size_lower: int | None check_size_upper: int | None geographic_focus: str | None - stage_focus: InvestmentStage + investment_thesis: Any = ( + None # Flexible JSON field - can be list, dict, or list of dicts + ) + portfolio_highlights: Any = ( + None # Flexible JSON field - can be list, dict, or list of dicts + ) number_of_investments: int | None created_at: Optional[datetime] = None updated_at: Optional[datetime] = None @@ -131,8 +140,8 @@ class InvestorFundData(BaseModel): aum: int | None aum_as_of_date: str | None aum_source_url: str | None - investment_thesis: List[str] | None - portfolio_highlights: List[str] | None + investment_thesis: Any = None # Flexible JSON field + portfolio_highlights: Any = None # Flexible JSON field number_of_investments: int | None # Fund fields diff --git a/investors.db b/investors.db new file mode 100644 index 0000000..721e448 Binary files /dev/null and b/investors.db differ