M3 Integration fixes
This commit is contained in:
@@ -16,31 +16,31 @@ class M3CallCloseAPIController extends Controller
|
||||
{
|
||||
self::configureTimeouts();
|
||||
$params = self::validatedParams($request);
|
||||
$response = null;
|
||||
|
||||
if ($params === null) {
|
||||
Log::channel('dailyCron')->error('Manifest CloseAPI: Manifest, company and warehouse must be defined.');
|
||||
|
||||
return self::errorResponse('Manifest CloseAPI: Manifest, company and warehouse must be defined.');
|
||||
}
|
||||
|
||||
try {
|
||||
$records = self::findOpenManifestRecords($params);
|
||||
if ($records->isEmpty()) {
|
||||
Log::channel('dailyCron')->info('Manifest CloseAPI: No records found in ICM705M1.');
|
||||
|
||||
return self::errorResponse('Manifest CloseAPI: No records found in ICM705M1.');
|
||||
$response = self::errorResponse('Manifest CloseAPI: Manifest, company and warehouse must be defined.');
|
||||
} else {
|
||||
try {
|
||||
$records = self::findOpenManifestRecords($params);
|
||||
if ($records->isEmpty()) {
|
||||
Log::channel('dailyCron')->info('Manifest CloseAPI: No records found in ICM705M1.');
|
||||
$response = self::errorResponse('Manifest CloseAPI: No records found in ICM705M1.');
|
||||
} else {
|
||||
$response = self::submitManifest($records->first(), $params['SHUSER']);
|
||||
}
|
||||
} catch (\Throwable $exception) {
|
||||
Log::error($exception);
|
||||
$response = response()->json([
|
||||
'code' => '500',
|
||||
'status' => 'Error',
|
||||
'message' => 'Manifest Closing failed unexpectedly.',
|
||||
], 500);
|
||||
}
|
||||
|
||||
return self::submitManifest($records->first(), $params['SHUSER']);
|
||||
} catch (\Throwable $exception) {
|
||||
Log::error($exception);
|
||||
|
||||
return response()->json([
|
||||
'code' => '500',
|
||||
'status' => 'Error',
|
||||
'message' => 'Manifest Closing failed unexpectedly.',
|
||||
], 500);
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
private static function configureTimeouts(): void
|
||||
|
||||
Reference in New Issue
Block a user