Files
2019-07-18 17:36:36 +08:00

36 lines
1.0 KiB
PHP

<?php
namespace App\Classes\Modules\ControllersLogic\FreightForwarder;
use App\Classes\Modules\ControllerLogic\Exceptions\InternalServerErrorException;
use App\Classes\Modules\FreightForwarder\Services\DeletesServiceFees;
use App\Classes\ValueObjects\Constants\HttpStatus;
use Illuminate\Http\JsonResponse;
class DeleteServiceFeesLogic
{
/** @var DeletesServiceFees */
private $deletesServiceFees;
/**
* DeleteServiceFeesLogic constructor.
* @param DeletesServiceFees $deletesServiceFees
*/
public function __construct(DeletesServiceFees $deletesServiceFees)
{
$this->deletesServiceFees = $deletesServiceFees;
}
public function execute(String $serviceId){
try{
return $this->deletesServiceFees->execute($serviceId);
return new JsonResponse([],HttpStatus::REQUEST_ACCEPTED);
}catch(\Exception $exception){
throw new InternalServerErrorException("Failed to delete Customer Relation because{$exception->getMessage()}");
}
}
}