Add INVESTMENT account type with manual portfolio value recording

This commit is contained in:
2026-04-21 11:32:50 -04:00
parent 0ea6a7c698
commit 0cf4612106
8 changed files with 147 additions and 16 deletions

View File

@@ -68,7 +68,7 @@ export default async function DashboardPage({ searchParams }: { searchParams: Se
if (isCurrentMonth) {
const accounts = await prisma.account.findMany({
where: { userId, isActive: true, type: 'BANK' },
where: { userId, isActive: true, type: { in: ['BANK', 'INVESTMENT'] } },
select: { id: true, name: true, currentBalanceCents: true },
orderBy: { name: 'asc' },
})
@@ -80,7 +80,7 @@ export default async function DashboardPage({ searchParams }: { searchParams: Se
FROM "BalanceSnapshot" bs
JOIN "Account" a ON bs."accountId" = a.id
WHERE a."userId" = ${userId}
AND a.type = 'BANK'
AND a.type IN ('BANK', 'INVESTMENT')
AND bs.year = ${year}
AND bs.month = ${month}
`