lighter change - luck totals
Build Images and Deploy / Update-PROD-Stack (push) Successful in 1m22s

This commit is contained in:
2026-03-19 02:00:28 -04:00
parent 6bfbfcc8a0
commit 249909f3de
2 changed files with 13 additions and 1 deletions
+12
View File
@@ -71,6 +71,13 @@ export default async function ProfilePage({ params }: Props) {
.filter((t) => t.type === 'SELL_LONG' || t.type === 'SELL_SHORT')
.reduce((sum, t) => sum + t.profit, 0)
const lotteryAggregate = await prisma.trade.aggregate({
where: { userId: user.id, type: 'LOTTERY_WIN' },
_sum: { profit: true },
_count: true,
})
const lotteryWinnings = lotteryAggregate._sum.profit ?? 0
const lotteryCount = lotteryAggregate._count
return (
<div className="max-w-4xl mx-auto space-y-8">
{/* Header */}
@@ -108,6 +115,11 @@ export default async function ProfilePage({ params }: Props) {
<div className="text-right">
<p className="text-3xl font-bold">{formatCurrency(totalValue)}</p>
<p className="text-sm text-slate-400">total portfolio value</p>
{lotteryCount > 0 && (
<p className="text-xs text-amber-400 mt-1">
🎰 {formatCurrency(lotteryWinnings)} from Lucky Dip ({lotteryCount} spin{lotteryCount !== 1 ? 's' : ''})
</p>
)}
</div>
</div>
+1 -1
View File
File diff suppressed because one or more lines are too long