mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
52 lines
1.6 KiB
PHP
52 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Orders\ControllersLogic;
|
|
|
|
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
|
use App\Classes\Modules\Orders\Processors\ApproveChangeOrderAddressProcessor;
|
|
use App\Http\Resources\AddressResource;
|
|
use App\Http\Resources\OrderResource;
|
|
use App\Transformers\AddressTransformer;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\JsonResponse;
|
|
|
|
class ApproveChangeOrderAddressLogic extends AbstractControllerLogic
|
|
{
|
|
/**
|
|
* @return array
|
|
*/
|
|
protected function notification(): array
|
|
{
|
|
return [
|
|
'title' => 'Change Order Address Approval',
|
|
'message' => 'You have successfully change the order address'
|
|
];
|
|
}
|
|
|
|
/** @var ApproveChangeOrderAddressProcessor */
|
|
private $approveChangeOrderAddressProcessor;
|
|
|
|
/**
|
|
* ApproveChangeOrderAddressLogic constructor.
|
|
* @param ApproveChangeOrderAddressProcessor $approveChangeOrderAddressProcessor
|
|
*/
|
|
|
|
public function __construct(ApproveChangeOrderAddressProcessor $approveChangeOrderAddressProcessor)
|
|
{
|
|
$this->approveChangeOrderAddressProcessor = $approveChangeOrderAddressProcessor;
|
|
}
|
|
|
|
public function logic(Request $request): JsonResponse
|
|
{
|
|
$address = $this->approveChangeOrderAddressProcessor->execute($request);
|
|
|
|
|
|
//load address with no relationships
|
|
/* return fractal()
|
|
->item($address, new AddressTransformer())
|
|
->respond(200, [], JSON_PRETTY_PRINT);*/
|
|
|
|
return $this->resourceResponse(new AddressResource($address));
|
|
}
|
|
}
|