mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-07 06:31:22 +00:00
Finish up bunq import routine.
This commit is contained in:
@@ -302,4 +302,5 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
|
||||
return $journal;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -66,6 +66,7 @@ interface AccountRepositoryInterface
|
||||
* @param string $number
|
||||
* @param array $types
|
||||
*
|
||||
* @deprecated
|
||||
* @return Account
|
||||
*/
|
||||
public function findByAccountNumber(string $number, array $types): Account;
|
||||
@@ -74,14 +75,24 @@ interface AccountRepositoryInterface
|
||||
* @param string $iban
|
||||
* @param array $types
|
||||
*
|
||||
* @deprecated
|
||||
* @return Account
|
||||
*/
|
||||
public function findByIban(string $iban, array $types): Account;
|
||||
|
||||
/**
|
||||
* @param string $iban
|
||||
* @param array $types
|
||||
*
|
||||
* @return Account|null
|
||||
*/
|
||||
public function findByIbanNull(string $iban, array $types): ?Account;
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @param array $types
|
||||
*
|
||||
* @deprecated
|
||||
* @return Account|null
|
||||
*/
|
||||
public function findByName(string $name, array $types): ?Account;
|
||||
|
||||
@@ -41,6 +41,7 @@ trait FindAccountsTrait
|
||||
/**
|
||||
* @param $accountId
|
||||
*
|
||||
* @deprecated
|
||||
* @return Account
|
||||
*/
|
||||
public function find(int $accountId): Account
|
||||
@@ -58,6 +59,7 @@ trait FindAccountsTrait
|
||||
* @param string $number
|
||||
* @param array $types
|
||||
*
|
||||
*
|
||||
* @deprecated
|
||||
* @return Account
|
||||
*/
|
||||
@@ -109,10 +111,37 @@ trait FindAccountsTrait
|
||||
return new Account;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $iban
|
||||
* @param array $types
|
||||
*
|
||||
* @return Account|null
|
||||
*/
|
||||
public function findByIbanNull(string $iban, array $types): ?Account
|
||||
{
|
||||
$query = $this->user->accounts()->where('iban', '!=', '')->whereNotNull('iban');
|
||||
|
||||
if (count($types) > 0) {
|
||||
$query->leftJoin('account_types', 'accounts.account_type_id', '=', 'account_types.id');
|
||||
$query->whereIn('account_types.type', $types);
|
||||
}
|
||||
|
||||
$accounts = $query->get(['accounts.*']);
|
||||
/** @var Account $account */
|
||||
foreach ($accounts as $account) {
|
||||
if ($account->iban === $iban) {
|
||||
return $account;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @param array $types
|
||||
*
|
||||
* @deprecated
|
||||
* @return Account|null
|
||||
*/
|
||||
public function findByName(string $name, array $types): ?Account
|
||||
|
||||
Reference in New Issue
Block a user