mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
56 lines
1.2 KiB
PHP
56 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Transactions\ControllersLogic;
|
|
|
|
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
|
use App\Classes\Modules\Transactions\Services\FetchPayments;
|
|
use App\Classes\Modules\Transactions\Services\ListsTransactions;
|
|
use App\Http\Resources\InvoiceResource;
|
|
use Illuminate\Http\JsonResponse;
|
|
use Illuminate\Http\Request;
|
|
class FetchInvoiceLogic extends AbstractControllerLogic
|
|
{
|
|
/**
|
|
* ListTransactionsLogic constructor.
|
|
* @param FetchPayments $fetchPayments
|
|
*/
|
|
public function __construct(FetchPayments $fetchPayments)
|
|
{
|
|
$this->fetchPayments = $fetchPayments;
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
protected function notification():array {
|
|
return [
|
|
'title' => 'Retrieved Transactions',
|
|
'message' => 'You have successfully retrieved a list of transactions'
|
|
];
|
|
}
|
|
|
|
/** @var FetchPayments */
|
|
private $fetchPayments;
|
|
|
|
|
|
|
|
public function logic(Request $request) : JsonResponse
|
|
{
|
|
|
|
$query = $this->fetchPayments->execute($this->fetchPayments->deserializeFilters($request->input('filters')));
|
|
|
|
return $this->collectionResponse(InvoiceResource::collection($query));
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
?>
|