mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-28 17:03:59 +00:00
Grab service charge from setting for calculate supplier transaction
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\SegmentConstants\ControllersLogic;
|
||||
|
||||
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Segments\Services\FetchesConstant;
|
||||
use App\Http\Resources\ConstantResource;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class FetchSegmentConstantLogic extends AbstractControllerLogic
|
||||
{
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function notification():array {
|
||||
return [
|
||||
'title' => 'Retrieved Segment Constant',
|
||||
'message' => 'You have successfully retrieved a segment constant'
|
||||
];
|
||||
}
|
||||
|
||||
/** @var FetchesConstant */
|
||||
private $fetchesConstant;
|
||||
|
||||
/**
|
||||
* FetchSegmentLogic constructor.
|
||||
* @param FetchesConstant $fetchesConstant
|
||||
*/
|
||||
public function __construct(FetchesConstant $fetchesConstant)
|
||||
{
|
||||
$this->fetchesConstant = $fetchesConstant;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return JsonResponse
|
||||
* @throws \App\Classes\Exceptions\AccessForbiddenException
|
||||
* @throws \App\Classes\Exceptions\RequestValidationException
|
||||
*/
|
||||
public function logic(Request $request) : JsonResponse
|
||||
{
|
||||
$query = $this->fetchesConstant->execute(['id' => $request->route('id')]);
|
||||
|
||||
return $this->resourceResponse(new ConstantResource($query));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user