diff --git a/docs/developer/events/customer.md b/docs/developer/events/customer.md index fec8765..a8512c2 100644 --- a/docs/developer/events/customer.md +++ b/docs/developer/events/customer.md @@ -11,7 +11,7 @@ This is triggered when a customer is created. | Name | Constant For Name | | --- | --- | -| billabear.customer.created | `BillaBear\Entity\Customer::NAME` | +| billabear.customer.created | `BillaBear\Event\Customer\CustomerCreated::NAME` | ### Event Class diff --git a/docs/developer/events/invoice.md b/docs/developer/events/invoice.md new file mode 100644 index 0000000..f755354 --- /dev/null +++ b/docs/developer/events/invoice.md @@ -0,0 +1,59 @@ +--- +title: BillaBear Invoice Events +sidebar_label: Invoice +sidebar_position: 2 +--- +Here is the information relating to events relating to Invoices + +## Invoice Created + +This is triggered when an invoice is created. + +| Name | Constant For Name | +| --- | --- | +| billabear.invoice.created | `BillaBear\Event\Invoice\InvoiceCreated::NAME` | + +### Event Class + +```php +namespace BillaBear\Event\Invoice; + +use BillaBear\Entity\Invoice; +use Symfony\Contracts\EventDispatcher\Event; + +class InvoiceCreated extends Event +{ + public const string NAME = 'billabear.invoice.created'; + + public function __construct(public readonly Invoice $invoice) + { + } +} +``` + +## Invoice Paid + +This is triggered when an invoice is paid. + +| Name | Constant For Name | +| --- | --- | +| billabear.invoice.paid | `BillaBear\Event\Invoice\InvoicePaid::NAME` | + +### Event Class + +```php +namespace BillaBear\Event\Invoice; + +use BillaBear\Entity\Invoice; +use Symfony\Contracts\EventDispatcher\Event; + +class InvoicePaid extends Event +{ + public const string NAME = 'billabear.invoice.paid'; + + public function __construct(public readonly Invoice $invoice) + { + } +} + +```