feat(matching-runs): add per-run aggregate stats and UI display

- Admin list endpoint returns totalSuggestions, assignedCount, aggregatedNotFoundCount per run
- UI: show Total/Matched/Not found columns using fresh aggregates
- Add anchor link Run #ID and wording 'Pairs created in this run'
This commit is contained in:
Radosław Gierwiało
2025-11-30 13:43:05 +01:00
parent a9ad25eb38
commit 621511fccf
3 changed files with 46 additions and 4 deletions

View File

@@ -0,0 +1,13 @@
-- Add origin_run_id column to recording_suggestions
ALTER TABLE "recording_suggestions" ADD COLUMN "origin_run_id" INTEGER;
-- Add foreign key to matching_runs
ALTER TABLE "recording_suggestions"
ADD CONSTRAINT "recording_suggestions_origin_run_id_fkey"
FOREIGN KEY ("origin_run_id") REFERENCES "matching_runs"("id")
ON DELETE SET NULL ON UPDATE CASCADE;
-- Simple index to support joins by origin_run_id
CREATE INDEX IF NOT EXISTS "recording_suggestions_origin_run_id_idx"
ON "recording_suggestions"("origin_run_id");