Optimize academy

This commit is contained in:
2026-06-09 13:16:01 +02:00
parent f89ee937c0
commit 5af95f6533
109 changed files with 6862 additions and 719 deletions

View File

@@ -179,8 +179,8 @@ test('upload finish updates queue item when batch item id is supplied', function
$item->refresh();
expect($item->status)->toBe('processing')
->and($item->processing_stage)->toBe('maturity_check');
expect($item->status)->toBe('needs_metadata')
->and($item->processing_stage)->toBe('finalized');
});
test('upload queue bulk publish only publishes ready items', function () {
@@ -394,6 +394,8 @@ test('upload queue item failure does not break the rest of the batch', function
});
test('upload queue processing states update correctly per item', function () {
config()->set('vision.upload.maturity.enabled', true);
$batch = UploadBatch::query()->create([
'user_id' => $this->user->id,
'name' => 'Processing batch',
@@ -439,6 +441,8 @@ test('upload queue processing states update correctly per item', function () {
});
test('upload queue publish readiness respects metadata and maturity review rules', function () {
config()->set('vision.upload.maturity.enabled', true);
$category = uploadQueueCategory();
$batch = UploadBatch::query()->create([
@@ -580,21 +584,23 @@ test('upload queue retry works for safe failure cases', function () {
'error_message' => 'Vision analysis timed out.',
]);
config()->set('vision.auto_tagging.enabled', false);
$this->postJson('/api/studio/upload-queue/items/' . $item->id . '/retry')
->assertOk()
->assertJsonPath('ok', true);
$item->refresh();
expect($item->status)->toBe('processing')
->and($item->processing_stage)->toBe('maturity_check')
expect($item->status)->toBe('ready')
->and($item->processing_stage)->toBe('finalized')
->and($item->error_code)->toBeNull()
->and($item->error_message)->toBeNull();
Queue::assertPushed(AutoTagArtworkJob::class);
Queue::assertPushed(DetectArtworkMaturityJob::class);
Queue::assertNotPushed(AutoTagArtworkJob::class);
Queue::assertNotPushed(DetectArtworkMaturityJob::class);
Queue::assertPushed(GenerateArtworkEmbeddingJob::class);
Queue::assertPushed(AnalyzeArtworkAiAssistJob::class);
Queue::assertNotPushed(AnalyzeArtworkAiAssistJob::class);
});
test('upload queue AI generation does not overwrite manual metadata silently', function () {