05/31 Phase 1: initial codes

This commit is contained in:
2026-05-31 10:03:28 -04:00
parent b0a5ce5399
commit b0c0bd363b
35 changed files with 2871 additions and 164 deletions
+18
View File
@@ -0,0 +1,18 @@
from app.extensions import db
from datetime import datetime
class NetWorthSnapshot(db.Model):
__tablename__ = 'net_worth_snapshots'
id = db.Column(db.Integer, primary_key=True)
snapshot_date = db.Column(db.Date, nullable=False, unique=True, index=True)
total_assets = db.Column(db.Numeric(15, 2), nullable=False, default=0)
total_liabilities = db.Column(db.Numeric(15, 2), nullable=False, default=0)
net_worth = db.Column(db.Numeric(15, 2), nullable=False, default=0)
account_balances = db.Column(db.JSON, nullable=True) # snapshot of each account balance
investment_value = db.Column(db.Numeric(15, 2), default=0)
created_at = db.Column(db.DateTime, default=datetime.utcnow)
def __repr__(self):
return f'<NetWorthSnapshot {self.snapshot_date} nw={self.net_worth}>'