mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
44 lines
1.2 KiB
PHP
44 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Classes\Jobs\Commands\V2;
|
|
|
|
use App\Classes\Modules\Bookings\Processors\RegenerateInvoiceBookingProcessor;
|
|
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\Models\Booking;
|
|
use Illuminate\Support\Facades\Log;
|
|
|
|
|
|
class ProcessBookingForEInvoiceV2CommandJob implements ShouldQueue
|
|
{
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
/** @var Booking */
|
|
private $booking;
|
|
|
|
/**
|
|
* ProcessBookingForEInvoiceV2CommandJob constructor.
|
|
* @param Booking $booking
|
|
*/
|
|
public function __construct(Booking $booking)
|
|
{
|
|
$this->booking = $booking;
|
|
}
|
|
|
|
public function handle()
|
|
{
|
|
Log::info(Carbon::now() . ': Start job - Processing single booking for E-Invoice.');
|
|
$start = new Carbon();
|
|
|
|
(App()->make(RegenerateInvoiceBookingProcessor::class))->execute($this->booking);
|
|
|
|
$end = new Carbon();
|
|
$elapsedTime = $start->diff($end)->format('%H:%I:%S');
|
|
Log::info(Carbon::now() . ': End job - Processing single booking for E-Invoice. ElapsedTime: ' . $elapsedTime . '.');
|
|
}
|
|
}
|