feat: add duplicate transaction detection and display in transactions page, enhancing user experience with visual indicators for duplicates

This commit is contained in:
Julien Froidefond
2025-12-08 09:50:32 +01:00
parent cb8628ce39
commit ba4d112cb8
6 changed files with 223 additions and 55 deletions

View File

@@ -0,0 +1,20 @@
import { NextResponse } from "next/server";
import { transactionService } from "@/services/transaction.service";
import { requireAuth } from "@/lib/auth-utils";
export async function GET() {
const authError = await requireAuth();
if (authError) return authError;
try {
const duplicateIds = await transactionService.getDuplicateIds();
return NextResponse.json({ duplicateIds: Array.from(duplicateIds) });
} catch (error) {
console.error("Error finding duplicate IDs:", error);
return NextResponse.json(
{ error: "Failed to find duplicate IDs" },
{ status: 500 },
);
}
}