feat: implement lottery win feature and update related components
Build Images and Deploy / Update-PROD-Stack (push) Successful in 1m18s

This commit is contained in:
2026-03-18 18:56:11 -04:00
parent af5484f0cd
commit 6b32b28af1
7 changed files with 82 additions and 85 deletions
+5 -4
View File
@@ -105,13 +105,13 @@ model Trade {
id String @id @default(cuid())
userId String
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
hashtagId String
hashtag Hashtag @relation(fields: [hashtagId], references: [id])
hashtagId String?
hashtag Hashtag? @relation(fields: [hashtagId], references: [id])
type TradeType
shares Float
price Float // price per share at time of trade
price Float // price per share at time of trade (or win amount for LOTTERY_WIN)
total Float // cost/proceeds of the trade
profit Float @default(0) // realized P&L (for SELL trades)
profit Float @default(0) // realized P&L (for SELL trades and LOTTERY_WIN)
createdAt DateTime @default(now())
@@index([userId])
@@ -129,4 +129,5 @@ enum TradeType {
SELL_LONG
BUY_SHORT
SELL_SHORT
LOTTERY_WIN
}