Currencies can now be enabled and disabled.

This commit is contained in:
James Cole
2018-11-10 10:04:46 +01:00
parent daa8aa5c9d
commit e491dda229
25 changed files with 457 additions and 51 deletions

View File

@@ -39,7 +39,7 @@ interface CurrencyRepositoryInterface
*
* @return bool
*/
public function canDeleteCurrency(TransactionCurrency $currency): bool;
public function currencyInUse(TransactionCurrency $currency): bool;
/**
* @param TransactionCurrency $currency
@@ -55,6 +55,38 @@ interface CurrencyRepositoryInterface
*/
public function destroy(TransactionCurrency $currency): bool;
/**
* Disables a currency
*
* @param TransactionCurrency $currency
*/
public function disable(TransactionCurrency $currency): void;
/**
* Enables a currency
*
* @param TransactionCurrency $currency
*/
public function enable(TransactionCurrency $currency): void;
/**
* Find by ID, return NULL if not found.
*
* @param int $currencyId
*
* @return TransactionCurrency|null
*/
public function find(int $currencyId): ?TransactionCurrency;
/**
* Find by currency code, return NULL if unfound.
*
* @param string $currencyCode
*
* @return TransactionCurrency|null
*/
public function findByCode(string $currencyCode): ?TransactionCurrency;
/**
* Find by currency code, return NULL if unfound.
*
@@ -64,6 +96,15 @@ interface CurrencyRepositoryInterface
*/
public function findByCodeNull(string $currencyCode): ?TransactionCurrency;
/**
* Find by currency name.
*
* @param string $currencyName
*
* @return TransactionCurrency
*/
public function findByName(string $currencyName): ?TransactionCurrency;
/**
* Find by currency name.
*
@@ -73,6 +114,15 @@ interface CurrencyRepositoryInterface
*/
public function findByNameNull(string $currencyName): ?TransactionCurrency;
/**
* Find by currency symbol.
*
* @param string $currencySymbol
*
* @return TransactionCurrency
*/
public function findBySymbol(string $currencySymbol): ?TransactionCurrency;
/**
* Find by currency symbol.
*
@@ -96,6 +146,11 @@ interface CurrencyRepositoryInterface
*/
public function get(): Collection;
/**
* @return Collection
*/
public function getAll(): Collection;
/**
* @param array $ids
*