Laravel Vapor - Renamed a file to fit its purpose (code sync from shipping portal)

This commit is contained in:
Dillon Ngo
2024-07-01 13:26:00 +08:00
parent 328417c8cf
commit a4010fcac2
12 changed files with 71 additions and 71 deletions
@@ -6,7 +6,7 @@ namespace App\Classes\Modules\Jobs\Processors;
use App\Classes\Modules\Jobs\Services\UpdatesJobResult;
use App\Classes\Modules\Jobs\Services\FetchesJobResult;
use App\Classes\Exceptions\JobResourceNotFoundException;
use App\Classes\Modules\Jobs\DataTransferObjects\ListGenericJobObject;
use App\Classes\Modules\Jobs\DataTransferObjects\JobSubmissionObject;
use App\Classes\Modules\Jobs\DataTransferObjects\UpdateJobResultObject;
class UpdateJobResultProcessor
@@ -30,14 +30,14 @@ class UpdateJobResultProcessor
}
/**
* @param ListGenericJobObject $listGenericJobObject
* @param JobSubmissionObject $jobSubmissionObject
* @param array $resultCurrent
* @return void
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\JobResourceNotFoundException
*/
public function execute(ListGenericJobObject $listGenericJobObject, $resultCurrent) {
$jobResultCurrent = $this->fetchesJobResult->execute(['job_id' => $listGenericJobObject->getJobId()]);
public function execute(JobSubmissionObject $jobSubmissionObject, $resultCurrent) {
$jobResultCurrent = $this->fetchesJobResult->execute(['job_id' => $jobSubmissionObject->getJobId()]);
$resultCurrentJson = json_encode($resultCurrent);
$resultSignatureCurrent = md5($resultCurrentJson);
@@ -45,10 +45,10 @@ class UpdateJobResultProcessor
$jobResultExisting = $this->fetchesJobResult->execute(['request_signature' => $jobResultCurrent->request_signature, 'result_not_null' => true, 'order_by_id_desc' => true]);
$resultSignatureExisting = $jobResultExisting->result_signature;
//if($resultSignatureExisting != $resultSignatureCurrent){
$this->updateJobResult($jobResultCurrent, $resultCurrentJson, $resultSignatureCurrent, $listGenericJobObject->getJobCommandName(), $listGenericJobObject->getJobCommand());
$this->updateJobResult($jobResultCurrent, $resultCurrentJson, $resultSignatureCurrent, $jobSubmissionObject->getJobCommandName(), $jobSubmissionObject->getJobCommand());
//}
} catch (JobResourceNotFoundException $exception){
$this->updateJobResult($jobResultCurrent, $resultCurrentJson, $resultSignatureCurrent, $listGenericJobObject->getJobCommandName(), $listGenericJobObject->getJobCommand());
$this->updateJobResult($jobResultCurrent, $resultCurrentJson, $resultSignatureCurrent, $jobSubmissionObject->getJobCommandName(), $jobSubmissionObject->getJobCommand());
}
}