Skip to content

Commit

Permalink
Merge pull request #153 from holtkamp/patch-ledger-account-booking
Browse files Browse the repository at this point in the history
Add LedgerAccountBooking Entity
  • Loading branch information
stephangroen authored Jun 22, 2018
2 parents 6e8df36 + 9990204 commit cba83d8
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Picqer/Financials/Moneybird/Entities/FinancialMutation.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
/**
* Class FinancialMutation
* @package Picqer\Financials\Moneybird\Entities
*
* @property LedgerAccountBooking[] $ledger_account_bookings
*/
class FinancialMutation extends Model {

Expand Down Expand Up @@ -46,6 +48,16 @@ class FinancialMutation extends Model {
*/
protected $endpoint = 'financial_mutations';

/**
* @var array
*/
protected $multipleNestedEntities = [
'ledger_account_bookings' => [
'entity' => 'LedgerAccountBooking',
'type' => self::NESTING_TYPE_ARRAY_OF_OBJECTS,
],
];

/**
* @param string $bookingType
* @param string | int $bookingId
Expand Down Expand Up @@ -80,4 +92,5 @@ public function linkToBooking($bookingType, $bookingId, $priceBase, $price = nul

return $this->connection->patch($this->endpoint . '/' . $this->id . '/link_booking', json_encode($parameters));
}

}
36 changes: 36 additions & 0 deletions src/Picqer/Financials/Moneybird/Entities/LedgerAccountBooking.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php namespace Picqer\Financials\Moneybird\Entities;

use Picqer\Financials\Moneybird\Actions\FindAll;
use Picqer\Financials\Moneybird\Actions\FindOne;
use Picqer\Financials\Moneybird\Actions\Removable;
use Picqer\Financials\Moneybird\Actions\Storable;
use Picqer\Financials\Moneybird\Model;

/**
* Class LedgerAccountBooking
* @package Picqer\Financials\Moneybird\Entities
*
* @property string $id
* @property string $administration_id
* @property string $ledger_account_id
* @property string $description
* @property string $price
* @property string $created_at
* @property string $updated_at
*/
class LedgerAccountBooking extends Model {

/**
* @var array
*/
protected $fillable = [
'id',
'administration_id',
'ledger_account_id',
'description',
'price',
'created_at',
'updated_at',
];

}

0 comments on commit cba83d8

Please sign in to comment.