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:
@@ -0,0 +1,11 @@
|
||||
-- Add suggestionsJson column to AssignmentJob to store AI-generated suggestions
|
||||
|
||||
DO $$
|
||||
BEGIN
|
||||
IF NOT EXISTS (
|
||||
SELECT 1 FROM information_schema.columns
|
||||
WHERE table_name = 'AssignmentJob' AND column_name = 'suggestionsJson'
|
||||
) THEN
|
||||
ALTER TABLE "AssignmentJob" ADD COLUMN "suggestionsJson" JSONB;
|
||||
END IF;
|
||||
END $$;
|
||||
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user