mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim.git
synced 2026-08-19 20:44:03 +00:00
38 lines
994 B
PHP
38 lines
994 B
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Orders\Processors;
|
|
|
|
|
|
use App\Classes\Modules\ControllerLogic\Exceptions\InternalServerErrorException;
|
|
use App\Classes\Modules\Orders\DataTransferObjects\OrderObject;
|
|
use App\Classes\Modules\Orders\DataTransferObjects\StepObject;
|
|
use App\Classes\Modules\Orders\Services\Processors\updatesStep;
|
|
use App\Classes\ValueObjects\Constants\HttpStatus;
|
|
use Illuminate\Http\JsonResponse;
|
|
|
|
class ShipOrder
|
|
{
|
|
|
|
use updatesStep;
|
|
|
|
/**
|
|
* @param OrderObject $order
|
|
* @param StepObject $step
|
|
* @return JsonResponse
|
|
* @throws InternalServerErrorException
|
|
*/
|
|
public function execute(OrderObject $order, StepObject $step){
|
|
|
|
try {
|
|
|
|
$this->completeStep($order, $step);
|
|
return new JsonResponse(null, HttpStatus::REQUEST_ACCEPTED);
|
|
|
|
} catch (\Exception $exception) {
|
|
throw new InternalServerErrorException("Failed to update order step because {$exception->getMessage()}");
|
|
}
|
|
|
|
}
|
|
|
|
|
|
} |