Implement currency routes.

This commit is contained in:
James Cole
2021-03-06 21:39:29 +01:00
parent fa5d33caf5
commit b11e3145c5
11 changed files with 501 additions and 354 deletions

View File

@@ -28,6 +28,7 @@ use Log;
/**
* Class CurrencyUpdateService
*
* @codeCoverageIgnore
*/
class CurrencyUpdateService
@@ -50,6 +51,9 @@ class CurrencyUpdateService
*/
public function update(TransactionCurrency $currency, array $data): TransactionCurrency
{
$data['code'] = '' === (string)$data['code'] ? $currency->code : $data['code'];
$data['symbol'] = '' === (string)$data['symbol'] ? $currency->code : $data['symbol'];
$data['name'] = '' === (string)$data['name'] ? $currency->code : $data['name'];
$currency->code = $data['code'];
$currency->symbol = $data['symbol'];
$currency->name = $data['name'];