Complete accounts and bills end point.

This commit is contained in:
James Cole
2018-12-09 13:09:43 +01:00
parent 108d43f967
commit 97f6e68164
7 changed files with 299 additions and 25 deletions

View File

@@ -386,6 +386,16 @@ class AccountRepository implements AccountRepositoryInterface
return $journal->date->format('Y-m-d');
}
/**
* @param Account $account
*
* @return Collection
*/
public function getPiggyBanks(Account $account): Collection
{
return $account->piggyBanks()->get();
}
/**
* @param Account $account
*
@@ -416,6 +426,18 @@ class AccountRepository implements AccountRepositoryInterface
return $account;
}
/**
* @param Account $account
*
* @return bool
*/
public function isAsset(Account $account): bool
{
$type = $account->accountType->type;
return AccountType::ASSET === $type || AccountType::DEFAULT === $type;
}
/**
* @param Account $account
*