mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-26 16:04:11 +00:00
45 lines
1.4 KiB
PHP
45 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Classes\Jobs\Commands\V2;
|
|
|
|
use Carbon\Carbon;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
use Illuminate\Queue\SerializesModels;
|
|
use App\Classes\Modules\Orders\Services\ListsOrders;
|
|
use App\Classes\Modules\Transactions\Processors\CheckStorageInvoiceTransactionProcessor;
|
|
use App\Classes\ValueObjects\Constants\OrderType;
|
|
use Illuminate\Support\Facades\Log;
|
|
|
|
class CheckStorageInvoicesSingleOrderV2CommandJob implements ShouldQueue
|
|
{
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
protected $order;
|
|
|
|
public function __construct($order)
|
|
{
|
|
$this->order = $order;
|
|
}
|
|
|
|
public function handle()
|
|
{
|
|
Log::info(Carbon::now() . ': Start job - Check single order for storage invoice.');
|
|
$start = new Carbon();
|
|
|
|
try{
|
|
Log::info("Processing Order - ID: {$this->order->id}, Reference: {$this->order->reference}");
|
|
(App()->make(CheckStorageInvoiceTransactionProcessor::class))->executeOrder($this->order);
|
|
}
|
|
catch(\Exception $ex){
|
|
Log::info('Exception '.$ex->getMessage());
|
|
}
|
|
|
|
$end = new Carbon();
|
|
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
|
Log::info(Carbon::now() . ': End job - Check single order for storage invoice. ElapsedTime: ' . $elapsedTime . '.');
|
|
}
|
|
}
|