mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
44 lines
1.3 KiB
PHP
44 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Classes\Jobs;
|
|
|
|
use App\Classes\Modules\PackingLists\Processors\ListPackingListsJobProcessor;
|
|
use App\Classes\Modules\Jobs\DataTransferObjects\ListGenericJobObject;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
|
|
class ListPackingListsJob implements ShouldQueue
|
|
{
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
/** @var ListGenericJobObject */
|
|
private $listGenericJobObject;
|
|
|
|
/**
|
|
* ListPackingListsJob constructor.
|
|
* @param ListGenericJobObject $listGenericJobObject
|
|
*/
|
|
public function __construct(ListGenericJobObject $listGenericJobObject)
|
|
{
|
|
$this->listGenericJobObject = $listGenericJobObject;
|
|
}
|
|
|
|
public function handle()
|
|
{
|
|
$rawPayload = $this->job->payload();
|
|
if(isset($rawPayload['data']['commandName'])){
|
|
$this->listGenericJobObject->setJobCommandName($rawPayload['data']['commandName']);
|
|
}
|
|
|
|
if(isset($rawPayload['data']['command'])){
|
|
$this->listGenericJobObject->setJobCommand($rawPayload['data']['command']);
|
|
}
|
|
|
|
$result = (App()->make(ListPackingListsJobProcessor::class))->execute($this->listGenericJobObject);
|
|
}
|
|
}
|