fix(vikon): handle numeric status codes from VIKON API (1=completed, -1=failed)

This commit is contained in:
F4ilji
2026-07-05 10:46:02 +05:00
parent 2bf2f4a861
commit 3d9982e5be
2 changed files with 12 additions and 11 deletions
@@ -21,7 +21,7 @@ class PollPartStatusTask
);
$body = $response->json();
$status = $body['status'] ?? 'unknown';
$status = $body['status'] ?? -2;
Log::info('Vikon poll part status', [
'operation' => $operationIdentity,
@@ -29,14 +29,15 @@ class PollPartStatusTask
'attempt' => $attempt + 1,
]);
if ($status === 'completed') {
// VIKON API returns numeric status: -1 = failed, 1 = completed
if ($status === 1) {
return ['status' => 'completed'];
}
if ($status === 'failed') {
if ($status === -1) {
return [
'status' => 'failed',
'error' => $body['message'] ?? 'Unknown error',
'error' => $body['message'] ?? 'Generation failed on server',
];
}