Update: 2026-05-08 14:35:20

This commit is contained in:
Hamza-Ayed
2026-05-08 14:35:20 +03:00
parent b913ff25c8
commit 9295be081c

View File

@@ -132,20 +132,20 @@ try {
$db->commit(); $db->commit();
echo "Success: Created Invoice $invoiceId\n"; echo "Success: Created Invoice $invoiceId\n";
// Send silent push update for progress try {
$stmt = $db->prepare("SELECT total_images, processed_images, uploaded_by FROM invoice_batches WHERE id = ?"); // Send silent push update for progress
$stmt->execute([$batchId]); $stmt = $db->prepare("SELECT total_images, processed_images, uploaded_by FROM invoice_batches WHERE id = ?");
$currentBatch = $stmt->fetch(); $stmt->execute([$batchId]);
if ($currentBatch) { $currentBatch = $stmt->fetch();
$notifier = new NotificationService(); if ($currentBatch) {
$notifier->sendDataNotification($currentBatch['uploaded_by'], [ $notifier = new NotificationService();
'type' => 'batch_progress', $notifier->sendDataNotification($currentBatch['uploaded_by'], [
'batch_id' => $batchId, 'type' => 'batch_progress',
'processed' => $currentBatch['processed_images'], 'batch_id' => $batchId,
'total' => $currentBatch['total_images'] 'processed' => $currentBatch['processed_images'],
]); 'total' => $currentBatch['total_images']
} ]);
}
} catch (\Exception $pushErr) { } catch (\Exception $pushErr) {
echo "Push error: " . $pushErr->getMessage() . "\n"; echo "Push error: " . $pushErr->getMessage() . "\n";
} }