feat: enhance fund investment and redemption logging, and improve positions display
Build Images and Deploy / Update-PROD-Stack (push) Successful in 1m21s

This commit is contained in:
2026-03-20 19:47:59 -04:00
parent 9dd9cf5ed9
commit 840345d093
5 changed files with 115 additions and 5 deletions
+6
View File
@@ -43,6 +43,7 @@ model HedgeFund {
managers FundManager[]
investments FundInvestment[]
navHistory FundNavHistory[]
trades Trade[]
@@index([slug])
}
@@ -178,6 +179,8 @@ model Trade {
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
hashtagId String?
hashtag Hashtag? @relation(fields: [hashtagId], references: [id])
fundId String?
fund HedgeFund? @relation(fields: [fundId], references: [id], onDelete: SetNull)
type TradeType
shares Float
price Float // price per share at time of trade (or win amount for LOTTERY_WIN)
@@ -187,6 +190,7 @@ model Trade {
@@index([userId])
@@index([hashtagId])
@@index([fundId])
@@index([createdAt])
}
@@ -206,4 +210,6 @@ enum TradeType {
DONATION // keepHistory reset: user was in the green — donated their portfolio
BANKRUPTCY // keepHistory reset: user was in the red — debts cleared
ACCOUNT_OPEN // keepHistory reset: new $2000 account opening entry
FUND_INVEST // invested cash into a hedge fund
FUND_REDEEM // redeemed shares from a hedge fund
}