Expose per-product forecast errors

This commit is contained in:
gitea_admin committed 2026-09-06 08:56:50 +02:00
1 parent 1639960ab6
commit cc5661146c
2 files changed
+4 -2

No files matched your search

+2 -1
View File
@@ -187,7 +187,7 @@ function run_lager_stock_lot_forecast(PDO $pdo): array
$asOfDate = new DateTimeImmutable('today', new DateTimeZone('Europe/Zurich'));
$result = [
'status' => 'done', 'total_products' => 0, 'processed_products' => 0,
'failed_products' => 0, 'failed_product_ids' => [],
'failed_products' => 0, 'failed_product_ids' => [], 'errors' => [],
];
try {
@@ -208,6 +208,7 @@ function run_lager_stock_lot_forecast(PDO $pdo): array
} catch (Throwable $error) {
$result['failed_products']++;
$result['failed_product_ids'][] = $productId;
$result['errors'][] = ['product_id' => $productId, 'message' => $error->getMessage()];
}
}
if ($result['failed_products'] > 0) {