Skip to content

Commit

Permalink
Add invoice event docs
Browse files Browse the repository at this point in the history
  • Loading branch information
that-guy-iain committed Dec 14, 2024
1 parent b3c3751 commit 850ff2f
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/developer/events/customer.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
59 changes: 59 additions & 0 deletions docs/developer/events/invoice.md
Original file line number Diff line number Diff line change
@@ -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)
{
}
}

```

0 comments on commit 850ff2f

Please sign in to comment.