Update: 2026-05-07 01:14:37

This commit is contained in:
Hamza-Ayed
2026-05-07 01:14:37 +03:00
parent e36a078de2
commit 8a935dc362
5 changed files with 321 additions and 30 deletions

View File

@@ -47,19 +47,16 @@ if ($batch['total_images'] == 0) {
json_error('لا يمكن إنهاء دفعة فارغة', 400);
}
// 2. Mark as processing
// 2. Mark as done since AI processing is now synchronous
$stmt = $db->prepare("
UPDATE invoice_batches
SET status = 'processing', updated_at = NOW()
SET status = 'done', completed_at = NOW(), updated_at = NOW()
WHERE id = ?
");
$stmt->execute([$batchId]);
// In a real production environment, you would dispatch a job to a queue worker here.
// For now, the queue worker is a cron job that checks the `invoice_processing_queue` table.
json_success([
'batch_id' => $batchId,
'status' => 'processing',
'status' => 'done',
'total_images' => $batch['total_images']
], 'تم إنهاء الدفعة بنجاح وإرسالها للمعالجة');
], 'تم رفع ومعالجة الدفعة بنجاح');