diff --git a/app/Services/CSV/Conversion/Routine/PseudoTransactionProcessor.php b/app/Services/CSV/Conversion/Routine/PseudoTransactionProcessor.php index 49edaf2a..7ac5b7ad 100644 --- a/app/Services/CSV/Conversion/Routine/PseudoTransactionProcessor.php +++ b/app/Services/CSV/Conversion/Routine/PseudoTransactionProcessor.php @@ -47,7 +47,7 @@ class PseudoTransactionProcessor use ProgressInformation; private Account $defaultAccount; - private TransactionCurrency $defaultCurrency; + private TransactionCurrency $primaryCurrency; private array $tasks; /** @@ -59,7 +59,7 @@ class PseudoTransactionProcessor { $this->tasks = config('csv.transaction_tasks'); $this->getDefaultAccount($defaultAccountId); - $this->getDefaultCurrency(); + $this->getPrimaryCurrency(); } /** @@ -101,7 +101,7 @@ class PseudoTransactionProcessor /** * @throws ImporterErrorException */ - private function getDefaultCurrency(): void + private function getPrimaryCurrency(): void { $url = SecretManager::getBaseUrl(); $token = SecretManager::getAccessToken(); @@ -109,18 +109,18 @@ class PseudoTransactionProcessor $currencyRequest = new GetCurrencyRequest($url, $token); $currencyRequest->setVerify(config('importer.connection.verify')); $currencyRequest->setTimeOut(config('importer.connection.timeout')); - $currencyRequest->setCode('default'); + $currencyRequest->setCode('primary'); try { /** @var GetCurrencyResponse $result */ $result = $currencyRequest->get(); - $this->defaultCurrency = $result->getCurrency(); + $this->primaryCurrency = $result->getCurrency(); } catch (ApiHttpException $e) { Log::error(sprintf('[%s]: %s', config('importer.version'), $e->getMessage())); - throw new ImporterErrorException('The default currency could not be loaded.'); + throw new ImporterErrorException('The primary currency could not be loaded.'); } - Log::debug(sprintf('Currency found, default currency is assumed to be "%s" (#%d)', $this->defaultCurrency->code, $this->defaultCurrency->id)); + Log::debug(sprintf('Currency found, default currency is assumed to be "%s" (#%d)', $this->primaryCurrency->code, $this->primaryCurrency->id)); } public function processPseudo(array $lines): array @@ -152,7 +152,7 @@ class PseudoTransactionProcessor $object->setAccount($this->defaultAccount); } if ($object->requiresTransactionCurrency()) { - $object->setTransactionCurrency($this->defaultCurrency); + $object->setTransactionCurrency($this->primaryCurrency); } $line = $object->process($line); diff --git a/app/Services/CSV/Conversion/Task/Accounts.php b/app/Services/CSV/Conversion/Task/Accounts.php index e4d11364..349868d7 100644 --- a/app/Services/CSV/Conversion/Task/Accounts.php +++ b/app/Services/CSV/Conversion/Task/Accounts.php @@ -679,7 +679,7 @@ class Accounts extends AbstractTask } /** - * Returns true if the task requires the default currency of the user. + * Returns true if the task requires the primary currency of the user. */ public function requiresTransactionCurrency(): bool { diff --git a/app/Services/CSV/Conversion/Task/Amount.php b/app/Services/CSV/Conversion/Task/Amount.php index f05d399d..eb95f9b2 100644 --- a/app/Services/CSV/Conversion/Task/Amount.php +++ b/app/Services/CSV/Conversion/Task/Amount.php @@ -147,7 +147,7 @@ class Amount extends AbstractTask } /** - * Returns true if the task requires the default currency of the user. + * Returns true if the task requires the primary currency of the user. */ public function requiresTransactionCurrency(): bool { diff --git a/app/Services/CSV/Conversion/Task/Currency.php b/app/Services/CSV/Conversion/Task/Currency.php index 834e1104..999b3680 100644 --- a/app/Services/CSV/Conversion/Task/Currency.php +++ b/app/Services/CSV/Conversion/Task/Currency.php @@ -63,7 +63,7 @@ class Currency extends AbstractTask } /** - * Returns true if the task requires the default currency of the user. + * Returns true if the task requires the primary currency of the user. */ public function requiresTransactionCurrency(): bool { diff --git a/app/Services/CSV/Conversion/Task/EmptyAccounts.php b/app/Services/CSV/Conversion/Task/EmptyAccounts.php index 4e068967..f4dc3438 100644 --- a/app/Services/CSV/Conversion/Task/EmptyAccounts.php +++ b/app/Services/CSV/Conversion/Task/EmptyAccounts.php @@ -82,7 +82,7 @@ class EmptyAccounts extends AbstractTask } /** - * Returns true if the task requires the default currency of the user. + * Returns true if the task requires the primary currency of the user. */ public function requiresTransactionCurrency(): bool { diff --git a/app/Services/CSV/Conversion/Task/EmptyDescription.php b/app/Services/CSV/Conversion/Task/EmptyDescription.php index cbe11f6b..6f262457 100644 --- a/app/Services/CSV/Conversion/Task/EmptyDescription.php +++ b/app/Services/CSV/Conversion/Task/EmptyDescription.php @@ -58,7 +58,7 @@ class EmptyDescription extends AbstractTask } /** - * Returns true if the task requires the default currency of the user. + * Returns true if the task requires the primary currency of the user. */ public function requiresTransactionCurrency(): bool { diff --git a/app/Services/CSV/Conversion/Task/Tags.php b/app/Services/CSV/Conversion/Task/Tags.php index 81c156e6..2c306eb3 100644 --- a/app/Services/CSV/Conversion/Task/Tags.php +++ b/app/Services/CSV/Conversion/Task/Tags.php @@ -59,7 +59,7 @@ class Tags extends AbstractTask } /** - * Returns true if the task requires the default currency of the user. + * Returns true if the task requires the primary currency of the user. */ public function requiresTransactionCurrency(): bool { diff --git a/app/Services/CSV/Conversion/Task/TaskInterface.php b/app/Services/CSV/Conversion/Task/TaskInterface.php index dff4fc76..e9625f3b 100644 --- a/app/Services/CSV/Conversion/Task/TaskInterface.php +++ b/app/Services/CSV/Conversion/Task/TaskInterface.php @@ -41,7 +41,7 @@ interface TaskInterface public function requiresDefaultAccount(): bool; /** - * Returns true if the task requires the default currency of the user. + * Returns true if the task requires the primary currency of the user. */ public function requiresTransactionCurrency(): bool; diff --git a/app/Services/SimpleFIN/Conversion/AccountMapper.php b/app/Services/SimpleFIN/Conversion/AccountMapper.php index 2006ff8c..ff3c7940 100644 --- a/app/Services/SimpleFIN/Conversion/AccountMapper.php +++ b/app/Services/SimpleFIN/Conversion/AccountMapper.php @@ -290,7 +290,7 @@ class AccountMapper // 2. Fall back to SimpleFIN account currency $currency = $simplefinAccount->getCurrency(); if ($simplefinAccount->isCustomCurrency()) { - // For custom currencies, default to user's base currency or EUR + // For custom currencies, default to user's primary currency or EUR return 'EUR'; // Could be made configurable } diff --git a/config/importer.php b/config/importer.php index e6f04aba..7cff93a8 100644 --- a/config/importer.php +++ b/config/importer.php @@ -69,7 +69,7 @@ return [ 'ignore_not_found_transactions' => env('IGNORE_NOT_FOUND_TRANSACTIONS', false), 'namespace' => 'c40dcba2-411d-11ec-973a-0242ac130003', 'use_cache' => env('USE_CACHE', false), - 'minimum_version' => '6.3.0', + 'minimum_version' => '6.3.2', 'cache_api_calls' => false, 'ignored_files' => ['.gitignore'], 'tracker_site_id' => env('TRACKER_SITE_ID', ''),