Add ability to include invoice invitations via API
This commit is contained in:
parent
2478ec59a4
commit
91d44dd301
1 changed files with 10 additions and 0 deletions
|
|
@ -25,12 +25,22 @@ class InvoiceTransformer extends EntityTransformer
|
|||
'payments'
|
||||
];
|
||||
|
||||
protected $availableIncludes = [
|
||||
'invitations',
|
||||
];
|
||||
|
||||
public function includeInvoiceItems(Invoice $invoice)
|
||||
{
|
||||
$transformer = new InvoiceItemTransformer($this->account, $this->serializer);
|
||||
return $this->includeCollection($invoice->invoice_items, $transformer, ENTITY_INVOICE_ITEMS);
|
||||
}
|
||||
|
||||
public function includeInvitations(Invoice $invoice)
|
||||
{
|
||||
$transformer = new InvoiceItemTransformer($this->account, $this->serializer);
|
||||
return $this->includeCollection($invoice->invitations, $transformer, ENTITY_INVITATION);
|
||||
}
|
||||
|
||||
public function includePayments(Invoice $invoice)
|
||||
{
|
||||
$transformer = new PaymentTransformer($this->account, $this->serializer);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue