feat: add uncategorized transaction count and percentage to transactions page; adjust table height for better layout
This commit is contained in:
@@ -26,6 +26,7 @@ export interface TransactionsPaginatedResult {
|
||||
transactions: Transaction[];
|
||||
total: number;
|
||||
hasMore: boolean;
|
||||
uncategorizedCount: number;
|
||||
}
|
||||
|
||||
export const bankingService = {
|
||||
@@ -210,6 +211,15 @@ export const bankingService = {
|
||||
// Get total count
|
||||
const total = await prisma.transaction.count({ where });
|
||||
|
||||
// Get uncategorized count with same filters
|
||||
const uncategorizedWhere = {
|
||||
...where,
|
||||
categoryId: null,
|
||||
};
|
||||
const uncategorizedCount = await prisma.transaction.count({
|
||||
where: uncategorizedWhere,
|
||||
});
|
||||
|
||||
// Get paginated transactions
|
||||
const transactions = await prisma.transaction.findMany({
|
||||
where,
|
||||
@@ -252,6 +262,7 @@ export const bankingService = {
|
||||
transactions: transformedTransactions,
|
||||
total,
|
||||
hasMore: offset + limit < total,
|
||||
uncategorizedCount,
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user