feat(matching-runs): attach origin_run_id to new suggestions and expose pairs-per-run API

- Extend saveMatchingResults(eventId, suggestions, runId) and set originRunId
- Scheduler/Admin run-now: always pass runId
- Admin API: GET /api/admin/events/:slug/matching-runs/:runId/suggestions
- Prisma: add compound index on (origin_run_id, status)
- Frontend: add getRunSuggestions, expand row in MatchingRunsSection with 'Pairs created in this run' wording
This commit is contained in:
Radosław Gierwiało
2025-11-30 13:37:32 +01:00
parent 7e2a196f99
commit a9ad25eb38
7 changed files with 188 additions and 24 deletions

View File

@@ -286,6 +286,7 @@ model RecordingSuggestion {
heatId Int @unique @map("heat_id") // One suggestion per heat
recorderId Int? @map("recorder_id") // NULL if no match found
status String @default("pending") @db.VarChar(20) // 'pending', 'accepted', 'rejected', 'not_found'
originRunId Int? @map("origin_run_id")
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
@@ -294,9 +295,11 @@ model RecordingSuggestion {
heat EventUserHeat @relation(fields: [heatId], references: [id], onDelete: Cascade)
recorder User? @relation("RecorderAssignments", fields: [recorderId], references: [id])
match Match? // Link to created match (if suggestion was accepted)
originRun MatchingRun? @relation(fields: [originRunId], references: [id])
@@index([eventId])
@@index([recorderId])
@@index([originRunId])
@@map("recording_suggestions")
}