Add INVESTMENT account type with manual portfolio value recording
This commit is contained in:
@@ -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}
|
||||
`
|
||||
|
||||
Reference in New Issue
Block a user