feat: add ReconcileDateRangeCard to settings page; enhance date picker layout in statistics and transaction filters components
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 1m24s

This commit is contained in:
Julien Froidefond
2025-12-20 12:05:30 +01:00
parent 8b81dfe8c0
commit 53798176a0
7 changed files with 439 additions and 70 deletions

View File

@@ -245,4 +245,32 @@ export const transactionService = {
duplicatesFound: duplicatesToDelete.length,
};
},
async reconcileByDateRange(
startDate: string | undefined,
endDate: string,
reconciled: boolean = true,
): Promise<{ updatedCount: number }> {
// Update all transactions in the date range
// If startDate is not provided, use a very old date to include all transactions up to endDate
const whereClause: {
date: { lte: string; gte?: string };
isReconciled: boolean;
} = {
date: {
lte: endDate,
...(startDate && { gte: startDate }),
},
isReconciled: !reconciled, // Only update transactions that don't already have the target state
};
const result = await prisma.transaction.updateMany({
where: whereClause,
data: {
isReconciled: reconciled,
},
});
return { updatedCount: result.count };
},
};