You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
636 B
25 lines
636 B
<?php
|
|
|
|
namespace App\Domains\Billing\Actions\Invoicing;
|
|
|
|
use App\Domains\Billing\DTOs\Invoicing\InvoiceDTO;
|
|
use App\Domains\Billing\Enums\Invoicing\InvoiceStatus;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Throwable;
|
|
|
|
class IssueInvoice
|
|
{
|
|
public function __construct(
|
|
protected UpdateInvoiceStatus $updateInvoiceStatus,
|
|
protected DraftInvoice $draftInvoice,
|
|
) {}
|
|
|
|
/**
|
|
* @throws Throwable
|
|
*/
|
|
public function execute(InvoiceDTO $invoiceDTO): void
|
|
{
|
|
$invoice= $this->draftInvoice->execute($invoiceDTO);
|
|
$this->updateInvoiceStatus->execute($invoice, InvoiceStatus::ISSUED);
|
|
}
|
|
}
|
|
|