Code sync from Shipping Portal, independent deployment of Vue Polling, Performance Improvement and tweaking for better user experience

This commit is contained in:
Dillon Ngo
2023-12-30 18:35:17 +08:00
parent 6da337b9dc
commit bf5ea2b2f2
26 changed files with 809 additions and 178 deletions
@@ -4,9 +4,8 @@ namespace App\Classes\Modules\Jobs\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Jobs\Services\FetchesJobResult;
use App\Classes\Modules\Jobs\Processors\FetchesJobResultProcessor;
use App\Http\Resources\JobResultResource;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -23,16 +22,16 @@ class FetchJobResultLogic extends AbstractControllerLogic
];
}
/** @var FetchesJobResult */
private $fetchesJobResult;
/** @var FetchesJobResultProcessor */
private $fetchesJobResultProcessor;
/**
* FetchJobResultLogic constructor.
* @param FetchesJobResult $fetchesJobResult
* @param FetchesJobResultProcessor $fetchesJobResultProcessor
*/
public function __construct(FetchesJobResult $fetchesJobResult)
public function __construct(FetchesJobResultProcessor $fetchesJobResultProcessor)
{
$this->fetchesJobResult = $fetchesJobResult;
$this->fetchesJobResultProcessor = $fetchesJobResultProcessor;
}
@@ -45,10 +44,8 @@ class FetchJobResultLogic extends AbstractControllerLogic
*/
public function logic(Request $request) : JsonResponse
{
$query = $this->fetchesJobResult->execute(['job_id' => $request->route('job_id')]);
$query = $this->fetchesJobResultProcessor->execute($request);
return $this->resourceResponse(new JobResultResource($query));
}
}