feat: Add InvestorInsightCache model and implement caching for investor insights

This commit is contained in:
bolade
2025-10-17 23:15:57 +01:00
parent 390ecee9ed
commit 228a67cc49
9 changed files with 233 additions and 162 deletions
+21
View File
@@ -311,3 +311,24 @@ class ProjectTable(Base, TimestampMixin):
companies = relationship(
"CompanyTable", secondary=project_company_association, back_populates="projects"
)
class InvestorInsightCache(Base, TimestampMixin):
__tablename__ = "investor_insight_cache"
id = Column(Integer, primary_key=True, index=True)
investor_id = Column(
Integer, ForeignKey("investors.id"), nullable=False, unique=True
)
# Cached insights
investment_pattern_analysis = Column(Text, nullable=False)
market_position = Column(Text, nullable=False)
# Cache management
last_refreshed = Column(
DateTime(timezone=True), server_default=func.now(), nullable=False
)
# Relationship to investor
investor = relationship("InvestorTable")