Create deposits, transfers and withdrawals. Also tests!

This commit is contained in:
James Cole
2014-07-15 20:58:35 +02:00
parent 1f4436cb75
commit 9687b5fb33
8 changed files with 701 additions and 5 deletions

View File

@@ -129,6 +129,9 @@ class EloquentAccountRepository implements AccountRepositoryInterface
public function createOrFindBeneficiary($name)
{
if (is_null($name) || strlen($name) == 0) {
return null;
}
$type = \AccountType::where('description', 'Beneficiary account')->first();
return $this->createOrFind($name, $type);
}
@@ -151,4 +154,12 @@ class EloquentAccountRepository implements AccountRepositoryInterface
return \Auth::user()->accounts()->where('name', 'like', '%' . $name . '%')->first();
}
public function getCashAccount()
{
$type = \AccountType::where('description','Cash account')->first();
$cash = \Auth::user()->accounts()->where('account_type_id',$type->id)->first();
return $cash;
}
}