<?php

namespace App\Jobs;

use App\Services\InvoiceService;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Queue\Queueable;
use Illuminate\Support\Facades\Log;

class CreateRenewalInvoices implements ShouldQueue
{
    use Queueable;

    /**
     * Create a new job instance.
     */
    public function __construct()
    {
        //
    }

    /**
     * Execute the job.
     */
    public function handle(InvoiceService $invoiceService): void
    {

        try {
            $createdInvoices = $invoiceService->createRenewalInvoicesForExpiringLicenses();


        } catch (\Exception $e) {
            // CreateRenewalInvoices job failed

            throw $e;
        }
    }
}
