mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-29 01:13:59 +00:00
Code sync from Shipping Portal, independent deployment of Vue Polling, Performance Improvement and tweaking for better user experience
This commit is contained in:
@@ -3,14 +3,10 @@
|
||||
namespace App\Classes\Modules\Transactions\Processors;
|
||||
|
||||
use App\Classes\Modules\Transactions\Services\ListsTransactions;
|
||||
use App\Classes\Modules\Jobs\Services\CreatesJobResult;
|
||||
use App\Classes\Exceptions\MalformedRequestException;
|
||||
use App\Classes\Modules\Jobs\Processors\UpdateJobResultProcessor;
|
||||
use App\Classes\General\Helper;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use App\Classes\Modules\Jobs\DataTransferObjects\ListGenericJobObject;
|
||||
use Illuminate\Http\Resources\Json\ResourceCollection;
|
||||
use App\Http\Resources\TransactionResource;
|
||||
use App\Http\Resources\ListTransactionJobResource;
|
||||
|
||||
class ListTransactionsJobProcessor
|
||||
{
|
||||
@@ -18,33 +14,32 @@ class ListTransactionsJobProcessor
|
||||
/** @var ListsTransactions */
|
||||
private $listsTransactions;
|
||||
|
||||
/** @var CreatesJobResult */
|
||||
private $createsJobResult;
|
||||
/** @var UpdateJobResultProcessor */
|
||||
private $updateJobResultProcessor;
|
||||
|
||||
/**
|
||||
* ListTransactionsJobProcessor constructor.
|
||||
* @param ListsTransactions $listsTransactions
|
||||
* @param CreatesJobResult $createsJobResult
|
||||
* @param UpdateJobResultProcessor $updateJobResultProcessor
|
||||
*/
|
||||
public function __construct(ListsTransactions $listsTransactions, CreatesJobResult $createsJobResult)
|
||||
public function __construct(ListsTransactions $listsTransactions, UpdateJobResultProcessor $updateJobResultProcessor)
|
||||
{
|
||||
$this->listsTransactions = $listsTransactions;
|
||||
$this->createsJobResult = $createsJobResult;
|
||||
$this->updateJobResultProcessor = $updateJobResultProcessor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ListGenericJobObject $listGenericJobObject
|
||||
* @return null|object
|
||||
* @return void
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
* @throws \App\Classes\Exceptions\JobResourceNotFoundException
|
||||
*/
|
||||
public function execute(ListGenericJobObject $listGenericJobObject) {
|
||||
|
||||
$query = $this->listsTransactions->execute($this->listsTransactions->deserializeFilters($listGenericJobObject->getPayload()['filters']), ['page' => $listGenericJobObject->getPayload()['page']]);
|
||||
|
||||
$result = Helper::collectionResponse(TransactionResource::collection($query));
|
||||
|
||||
$create = $this->createsJobResult->execute($listGenericJobObject, json_encode($result));
|
||||
|
||||
return $create;
|
||||
$resultCurrent = Helper::collectionResponse(ListTransactionJobResource::collection($query));
|
||||
$this->updateJobResultProcessor->execute($listGenericJobObject, $resultCurrent);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user