feat: enhance fund investment and redemption logging, and improve positions display
Build Images and Deploy / Update-PROD-Stack (push) Successful in 1m21s
Build Images and Deploy / Update-PROD-Stack (push) Successful in 1m21s
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user