Fix AI suggestions not displaying after job completion

BREAKING CHANGE: AI assignment job now stores suggestions in database

- Add suggestionsJson column to AssignmentJob table
- Store enriched suggestions when job completes
- Update getAISuggestions to retrieve stored suggestions instead of regenerating
- Filter out already-assigned pairs from stored suggestions

Previously, the background job generated suggestions but discarded them,
and getAISuggestions tried to regenerate from scratch (causing infinite loading).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-05 14:38:43 +01:00
parent e3e3fa9da4
commit 3abfccb22a
3 changed files with 73 additions and 76 deletions

View File

@@ -1105,6 +1105,7 @@ model AssignmentJob {
currentBatch Int @default(0)
processedCount Int @default(0)
suggestionsCount Int @default(0)
suggestionsJson Json? @db.JsonB // Stores the AI-generated suggestions
errorMessage String? @db.Text
startedAt DateTime?
completedAt DateTime?