From 62502c746c3a47774162cfa4d4841eade8efac0e Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 9 Sep 2023 15:12:24 +0200 Subject: [PATCH] Stringify IDs for #7944 --- .ci/php-cs-fixer/composer.lock | 12 ++--- .../Autocomplete/AccountController.php | 2 +- .../Controllers/Summary/BasicController.php | 16 +++---- .../Autocomplete/AccountController.php | 2 +- .../Controllers/Chart/AccountController.php | 2 +- .../Controllers/Chart/BalanceController.php | 16 +++---- .../V2/Controllers/Chart/BudgetController.php | 8 ++-- .../Controllers/Chart/CategoryController.php | 4 +- .../Controllers/Summary/BasicController.php | 24 +++++----- .../Events/Model/BudgetLimitHandler.php | 10 ++-- .../Category/OperationsRepository.php | 46 +++++++++---------- 11 files changed, 71 insertions(+), 71 deletions(-) diff --git a/.ci/php-cs-fixer/composer.lock b/.ci/php-cs-fixer/composer.lock index 8706691e71..94cac8ac65 100644 --- a/.ci/php-cs-fixer/composer.lock +++ b/.ci/php-cs-fixer/composer.lock @@ -226,16 +226,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.25.0", + "version": "v3.26.1", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "9025b7d2b6e1d90a63d0ac0905018ce5d03ec88d" + "reference": "d023ba6684055f6ea1da1352d8a02baca0426983" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/9025b7d2b6e1d90a63d0ac0905018ce5d03ec88d", - "reference": "9025b7d2b6e1d90a63d0ac0905018ce5d03ec88d", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/d023ba6684055f6ea1da1352d8a02baca0426983", + "reference": "d023ba6684055f6ea1da1352d8a02baca0426983", "shasum": "" }, "require": { @@ -309,7 +309,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.25.0" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.26.1" }, "funding": [ { @@ -317,7 +317,7 @@ "type": "github" } ], - "time": "2023-08-31T21:27:18+00:00" + "time": "2023-09-08T19:09:07+00:00" }, { "name": "psr/container", diff --git a/app/Api/V1/Controllers/Autocomplete/AccountController.php b/app/Api/V1/Controllers/Autocomplete/AccountController.php index 8847b8ff4b..25cee01da6 100644 --- a/app/Api/V1/Controllers/Autocomplete/AccountController.php +++ b/app/Api/V1/Controllers/Autocomplete/AccountController.php @@ -105,7 +105,7 @@ class AccountController extends Controller 'name' => $account->name, 'name_with_balance' => $nameWithBalance, 'type' => $account->accountType->type, - 'currency_id' => $currency->id, + 'currency_id' => (string)$currency->id, 'currency_name' => $currency->name, 'currency_code' => $currency->code, 'currency_symbol' => $currency->symbol, diff --git a/app/Api/V1/Controllers/Summary/BasicController.php b/app/Api/V1/Controllers/Summary/BasicController.php index 6cf94eacd7..7e4e5bdb8c 100644 --- a/app/Api/V1/Controllers/Summary/BasicController.php +++ b/app/Api/V1/Controllers/Summary/BasicController.php @@ -190,7 +190,7 @@ class BasicController extends Controller 'key' => sprintf('balance-in-%s', $currency->code), 'title' => trans('firefly.box_balance_in_currency', ['currency' => $currency->symbol]), 'monetary_value' => $sums[$currencyId] ?? '0', - 'currency_id' => $currency->id, + 'currency_id' => (string)$currency->id, 'currency_code' => $currency->code, 'currency_symbol' => $currency->symbol, 'currency_decimal_places' => $currency->decimal_places, @@ -203,7 +203,7 @@ class BasicController extends Controller 'key' => sprintf('spent-in-%s', $currency->code), 'title' => trans('firefly.box_spent_in_currency', ['currency' => $currency->symbol]), 'monetary_value' => $expenses[$currencyId] ?? '0', - 'currency_id' => $currency->id, + 'currency_id' => (string)$currency->id, 'currency_code' => $currency->code, 'currency_symbol' => $currency->symbol, 'currency_decimal_places' => $currency->decimal_places, @@ -215,7 +215,7 @@ class BasicController extends Controller 'key' => sprintf('earned-in-%s', $currency->code), 'title' => trans('firefly.box_earned_in_currency', ['currency' => $currency->symbol]), 'monetary_value' => $incomes[$currencyId] ?? '0', - 'currency_id' => $currency->id, + 'currency_id' => (string)$currency->id, 'currency_code' => $currency->code, 'currency_symbol' => $currency->symbol, 'currency_decimal_places' => $currency->decimal_places, @@ -253,7 +253,7 @@ class BasicController extends Controller 'key' => sprintf('bills-paid-in-%s', $info['code']), 'title' => trans('firefly.box_bill_paid_in_currency', ['currency' => $info['symbol']]), 'monetary_value' => $amount, - 'currency_id' => $info['id'], + 'currency_id' => (string)$info['id'], 'currency_code' => $info['code'], 'currency_symbol' => $info['symbol'], 'currency_decimal_places' => $info['decimal_places'], @@ -272,7 +272,7 @@ class BasicController extends Controller 'key' => sprintf('bills-unpaid-in-%s', $info['code']), 'title' => trans('firefly.box_bill_unpaid_in_currency', ['currency' => $info['symbol']]), 'monetary_value' => $amount, - 'currency_id' => $info['id'], + 'currency_id' => (string)$info['id'], 'currency_code' => $info['code'], 'currency_symbol' => $info['symbol'], 'currency_decimal_places' => $info['decimal_places'], @@ -302,7 +302,7 @@ class BasicController extends Controller foreach ($spent as $row) { // either an amount was budgeted or 0 is available. - $amount = $available[$row['currency_id']] ?? '0'; + $amount = (string)($available[$row['currency_id']] ?? '0'); $spentInCurrency = $row['sum']; $leftToSpend = bcadd($amount, $spentInCurrency); @@ -316,7 +316,7 @@ class BasicController extends Controller 'key' => sprintf('left-to-spend-in-%s', $row['currency_code']), 'title' => trans('firefly.box_left_to_spend_in_currency', ['currency' => $row['currency_symbol']]), 'monetary_value' => $leftToSpend, - 'currency_id' => $row['currency_id'], + 'currency_id' => (string)$row['currency_id'], 'currency_code' => $row['currency_code'], 'currency_symbol' => $row['currency_symbol'], 'currency_decimal_places' => $row['currency_decimal_places'], @@ -381,7 +381,7 @@ class BasicController extends Controller 'key' => sprintf('net-worth-in-%s', $currency->code), 'title' => trans('firefly.box_net_worth_in_currency', ['currency' => $currency->symbol]), 'monetary_value' => $amount, - 'currency_id' => $currency->id, + 'currency_id' => (string)$currency->id, 'currency_code' => $currency->code, 'currency_symbol' => $currency->symbol, 'currency_decimal_places' => $currency->decimal_places, diff --git a/app/Api/V2/Controllers/Autocomplete/AccountController.php b/app/Api/V2/Controllers/Autocomplete/AccountController.php index 011895326e..62fbfc914b 100644 --- a/app/Api/V2/Controllers/Autocomplete/AccountController.php +++ b/app/Api/V2/Controllers/Autocomplete/AccountController.php @@ -104,7 +104,7 @@ class AccountController extends Controller 'name' => $account->name, 'name_with_balance' => $nameWithBalance, 'type' => $account->accountType->type, - 'currency_id' => $currency->id, + 'currency_id' => (string)$currency->id, 'currency_name' => $currency->name, 'currency_code' => $currency->code, 'currency_symbol' => $currency->symbol, diff --git a/app/Api/V2/Controllers/Chart/AccountController.php b/app/Api/V2/Controllers/Chart/AccountController.php index 330171cb23..92d728a9b7 100644 --- a/app/Api/V2/Controllers/Chart/AccountController.php +++ b/app/Api/V2/Controllers/Chart/AccountController.php @@ -114,7 +114,7 @@ class AccountController extends Controller 'currency_decimal_places' => $currency->decimal_places, // the default currency of the user (could be the same!) - 'native_id' => (int)$default->id, + 'native_id' => (string)$default->id, 'native_code' => $default->code, 'native_symbol' => $default->symbol, 'native_decimal_places' => (int)$default->decimal_places, diff --git a/app/Api/V2/Controllers/Chart/BalanceController.php b/app/Api/V2/Controllers/Chart/BalanceController.php index 0756ffe99c..ea94b4821c 100644 --- a/app/Api/V2/Controllers/Chart/BalanceController.php +++ b/app/Api/V2/Controllers/Chart/BalanceController.php @@ -112,12 +112,12 @@ class BalanceController extends Controller // set array for default currency (even if unused later on) $defaultCurrencyId = (int)$default->id; $data[$defaultCurrencyId] = [ - 'currency_id' => $defaultCurrencyId, + 'currency_id' => (string)$defaultCurrencyId, 'currency_symbol' => $default->symbol, 'currency_code' => $default->code, 'currency_name' => $default->name, 'currency_decimal_places' => (int)$default->decimal_places, - 'native_id' => $defaultCurrencyId, + 'native_id' => (string)$defaultCurrencyId, 'native_symbol' => $default->symbol, 'native_code' => $default->code, 'native_name' => $default->name, @@ -138,13 +138,13 @@ class BalanceController extends Controller // set the array with monetary info, if it does not exist. $data[$currencyId] = $data[$currencyId] ?? [ - 'currency_id' => $currencyId, + 'currency_id' => (string)$currencyId, 'currency_symbol' => $journal['currency_symbol'], 'currency_code' => $journal['currency_code'], 'currency_name' => $journal['currency_name'], 'currency_decimal_places' => $journal['currency_decimal_places'], // native currency info (could be the same) - 'native_id' => (int)$default->id, + 'native_id' => (string)$default->id, 'native_code' => $default->code, 'native_symbol' => $default->symbol, 'native_decimal_places' => (int)$default->decimal_places, @@ -203,11 +203,11 @@ class BalanceController extends Controller // income and expense array prepped: $income = [ 'label' => 'earned', - 'currency_id' => $currency['currency_id'], + 'currency_id' => (string)$currency['currency_id'], 'currency_symbol' => $currency['currency_symbol'], 'currency_code' => $currency['currency_code'], 'currency_decimal_places' => $currency['currency_decimal_places'], - 'native_id' => $currency['native_id'], + 'native_id' => (string)$currency['native_id'], 'native_symbol' => $currency['native_symbol'], 'native_code' => $currency['native_code'], 'native_decimal_places' => $currency['native_decimal_places'], @@ -219,11 +219,11 @@ class BalanceController extends Controller ]; $expense = [ 'label' => 'spent', - 'currency_id' => $currency['currency_id'], + 'currency_id' => (string)$currency['currency_id'], 'currency_symbol' => $currency['currency_symbol'], 'currency_code' => $currency['currency_code'], 'currency_decimal_places' => $currency['currency_decimal_places'], - 'native_id' => $currency['native_id'], + 'native_id' => (string)$currency['native_id'], 'native_symbol' => $currency['native_symbol'], 'native_code' => $currency['native_code'], 'native_decimal_places' => $currency['native_decimal_places'], diff --git a/app/Api/V2/Controllers/Chart/BudgetController.php b/app/Api/V2/Controllers/Chart/BudgetController.php index 83d2d93939..d3c22a813e 100644 --- a/app/Api/V2/Controllers/Chart/BudgetController.php +++ b/app/Api/V2/Controllers/Chart/BudgetController.php @@ -128,11 +128,11 @@ class BudgetController extends Controller foreach ($rows as $row) { $current = [ 'label' => $budget->name, - 'currency_id' => $row['currency_id'], + 'currency_id' => (string)$row['currency_id'], 'currency_code' => $row['currency_code'], 'currency_name' => $row['currency_name'], 'currency_decimal_places' => $row['currency_decimal_places'], - 'native_id' => $row['native_id'], + 'native_id' => (string)$row['native_id'], 'native_code' => $row['native_code'], 'native_name' => $row['native_name'], 'native_decimal_places' => $row['native_decimal_places'], @@ -199,12 +199,12 @@ class BudgetController extends Controller foreach ($array as $currencyId => $block) { $this->currencies[$currencyId] = $this->currencies[$currencyId] ?? TransactionCurrency::find($currencyId); $return[$currencyId] = $return[$currencyId] ?? [ - 'currency_id' => $currencyId, + 'currency_id' => (string)$currencyId, 'currency_code' => $block['currency_code'], 'currency_name' => $block['currency_name'], 'currency_symbol' => $block['currency_symbol'], 'currency_decimal_places' => (int)$block['currency_decimal_places'], - 'native_id' => (int)$this->currency->id, + 'native_id' => (string)$this->currency->id, 'native_code' => $this->currency->code, 'native_name' => $this->currency->name, 'native_symbol' => $this->currency->symbol, diff --git a/app/Api/V2/Controllers/Chart/CategoryController.php b/app/Api/V2/Controllers/Chart/CategoryController.php index e17c5df129..dc43bb284f 100644 --- a/app/Api/V2/Controllers/Chart/CategoryController.php +++ b/app/Api/V2/Controllers/Chart/CategoryController.php @@ -103,12 +103,12 @@ class CategoryController extends Controller // create arrays $return[$key] = $return[$key] ?? [ 'label' => $categoryName, - 'currency_id' => (int)$currency->id, + 'currency_id' => (string)$currency->id, 'currency_code' => $currency->code, 'currency_name' => $currency->name, 'currency_symbol' => $currency->symbol, 'currency_decimal_places' => (int)$currency->decimal_places, - 'native_id' => (int)$default->id, + 'native_id' => (string)$default->id, 'native_code' => $default->code, 'native_name' => $default->name, 'native_symbol' => $default->symbol, diff --git a/app/Api/V2/Controllers/Summary/BasicController.php b/app/Api/V2/Controllers/Summary/BasicController.php index 35b82e13fa..25eca36e4b 100644 --- a/app/Api/V2/Controllers/Summary/BasicController.php +++ b/app/Api/V2/Controllers/Summary/BasicController.php @@ -220,7 +220,7 @@ class BasicController extends Controller $return[] = [ 'key' => 'balance-in-native', 'value' => $sums['native'], - 'currency_id' => $default->id, + 'currency_id' => (string)$default->id, 'currency_code' => $default->code, 'currency_symbol' => $default->symbol, 'currency_decimal_places' => $default->decimal_places, @@ -228,7 +228,7 @@ class BasicController extends Controller $return[] = [ 'key' => 'spent-in-native', 'value' => $expenses['native'], - 'currency_id' => $default->id, + 'currency_id' => (string)$default->id, 'currency_code' => $default->code, 'currency_symbol' => $default->symbol, 'currency_decimal_places' => $default->decimal_places, @@ -236,7 +236,7 @@ class BasicController extends Controller $return[] = [ 'key' => 'earned-in-native', 'value' => $incomes['native'], - 'currency_id' => $default->id, + 'currency_id' => (string)$default->id, 'currency_code' => $default->code, 'currency_symbol' => $default->symbol, 'currency_decimal_places' => $default->decimal_places, @@ -255,7 +255,7 @@ class BasicController extends Controller $return[] = [ 'key' => sprintf('balance-in-%s', $currency->code), 'value' => $sums[$currencyId] ?? '0', - 'currency_id' => $currency->id, + 'currency_id' => (string)$currency->id, 'currency_code' => $currency->code, 'currency_symbol' => $currency->symbol, 'currency_decimal_places' => $currency->decimal_places, @@ -263,7 +263,7 @@ class BasicController extends Controller $return[] = [ 'key' => sprintf('spent-in-%s', $currency->code), 'value' => $expenses[$currencyId] ?? '0', - 'currency_id' => $currency->id, + 'currency_id' => (string)$currency->id, 'currency_code' => $currency->code, 'currency_symbol' => $currency->symbol, 'currency_decimal_places' => $currency->decimal_places, @@ -271,7 +271,7 @@ class BasicController extends Controller $return[] = [ 'key' => sprintf('earned-in-%s', $currency->code), 'value' => $incomes[$currencyId] ?? '0', - 'currency_id' => $currency->id, + 'currency_id' => (string)$currency->id, 'currency_code' => $currency->code, 'currency_symbol' => $currency->symbol, 'currency_decimal_places' => $currency->decimal_places, @@ -305,7 +305,7 @@ class BasicController extends Controller $return[] = [ 'key' => sprintf('bills-paid-in-%s', $info['currency_code']), 'value' => $amount, - 'currency_id' => $info['currency_id'], + 'currency_id' => (string)$info['currency_id'], 'currency_code' => $info['currency_code'], 'currency_symbol' => $info['currency_symbol'], 'currency_decimal_places' => $info['currency_decimal_places'], @@ -313,7 +313,7 @@ class BasicController extends Controller $return[] = [ 'key' => 'bills-paid-in-native', 'value' => $nativeAmount, - 'currency_id' => $info['native_id'], + 'currency_id' => (string)$info['native_id'], 'currency_code' => $info['native_code'], 'currency_symbol' => $info['native_symbol'], 'currency_decimal_places' => $info['native_decimal_places'], @@ -329,7 +329,7 @@ class BasicController extends Controller $return[] = [ 'key' => sprintf('bills-unpaid-in-%s', $info['currency_code']), 'value' => $amount, - 'currency_id' => $info['currency_id'], + 'currency_id' => (string)$info['currency_id'], 'currency_code' => $info['currency_code'], 'currency_symbol' => $info['currency_symbol'], 'currency_decimal_places' => $info['currency_decimal_places'], @@ -337,7 +337,7 @@ class BasicController extends Controller $return[] = [ 'key' => 'bills-unpaid-in-native', 'value' => $nativeAmount, - 'currency_id' => $info['native_id'], + 'currency_id' => (string)$info['native_id'], 'currency_code' => $info['native_code'], 'currency_symbol' => $info['native_symbol'], 'currency_decimal_places' => $info['native_decimal_places'], @@ -504,7 +504,7 @@ class BasicController extends Controller $return[] = [ 'key' => 'net-worth-in-native', 'value' => $netWorthSet['native']['balance'], - 'currency_id' => $netWorthSet['native']['currency_id'], + 'currency_id' => (string)$netWorthSet['native']['currency_id'], 'currency_code' => $netWorthSet['native']['currency_code'], 'currency_symbol' => $netWorthSet['native']['currency_symbol'], 'currency_decimal_places' => $netWorthSet['native']['currency_decimal_places'], @@ -516,7 +516,7 @@ class BasicController extends Controller $return[] = [ 'key' => sprintf('net-worth-in-%s', $data['currency_code']), 'value' => $data['balance'], - 'currency_id' => $data['currency_id'], + 'currency_id' => (string)$data['currency_id'], 'currency_code' => $data['currency_code'], 'currency_symbol' => $data['currency_symbol'], 'currency_decimal_places' => $data['currency_decimal_places'], diff --git a/app/Handlers/Events/Model/BudgetLimitHandler.php b/app/Handlers/Events/Model/BudgetLimitHandler.php index 31d09c4293..8abe31998a 100644 --- a/app/Handlers/Events/Model/BudgetLimitHandler.php +++ b/app/Handlers/Events/Model/BudgetLimitHandler.php @@ -95,7 +95,7 @@ class BudgetLimitHandler $start = app('navigation')->startOfPeriod($budgetLimit->start_date, $viewRange); $end = app('navigation')->startOfPeriod($budgetLimit->end_date, $viewRange); $end = app('navigation')->endOfPeriod($end, $viewRange); - + // limit period in total is: $limitPeriod = Period::make($start, $end, precision: Precision::DAY(), boundaries: Boundaries::EXCLUDE_NONE()); app('log')->debug(sprintf('Limit period is from %s to %s', $start->format('Y-m-d'), $end->format('Y-m-d'))); @@ -184,8 +184,8 @@ class BudgetLimitHandler ); // overlap in days: $limitPeriod = Period::make( - $budgetLimit->start_date, - $budgetLimit->end_date, + $budgetLimit->start_date, + $budgetLimit->end_date, precision : Precision::DAY(), boundaries: Boundaries::EXCLUDE_NONE() ); @@ -230,8 +230,8 @@ class BudgetLimitHandler return '0'; } $limitPeriod = Period::make( - $budgetLimit->start_date, - $budgetLimit->end_date, + $budgetLimit->start_date, + $budgetLimit->end_date, precision : Precision::DAY(), boundaries: Boundaries::EXCLUDE_NONE() ); diff --git a/app/Repositories/Category/OperationsRepository.php b/app/Repositories/Category/OperationsRepository.php index 5f917cb081..9211a0d060 100644 --- a/app/Repositories/Category/OperationsRepository.php +++ b/app/Repositories/Category/OperationsRepository.php @@ -83,7 +83,7 @@ class OperationsRepository implements OperationsRepositoryInterface // info about the currency: $array[$currencyId] = $array[$currencyId] ?? [ 'categories' => [], - 'currency_id' => $currencyId, + 'currency_id' => (string)$currencyId, 'currency_name' => $journal['currency_name'], 'currency_symbol' => $journal['currency_symbol'], 'currency_code' => $journal['currency_code'], @@ -92,7 +92,7 @@ class OperationsRepository implements OperationsRepositoryInterface // info about the categories: $array[$currencyId]['categories'][$categoryId] = $array[$currencyId]['categories'][$categoryId] ?? [ - 'id' => $categoryId, + 'id' => (string)$categoryId, 'name' => $categoryName, 'transaction_journals' => [], ]; @@ -103,13 +103,13 @@ class OperationsRepository implements OperationsRepositoryInterface $array[$currencyId]['categories'][$categoryId]['transaction_journals'][$journalId] = [ 'amount' => app('steam')->negative($journal['amount']), 'date' => $journal['date'], - 'source_account_id' => $journal['source_account_id'], + 'source_account_id' => (string)$journal['source_account_id'], 'budget_name' => $journal['budget_name'], 'source_account_name' => $journal['source_account_name'], - 'destination_account_id' => $journal['destination_account_id'], + 'destination_account_id' => (string)$journal['destination_account_id'], 'destination_account_name' => $journal['destination_account_name'], 'description' => $journal['description'], - 'transaction_group_id' => $journal['transaction_group_id'], + 'transaction_group_id' => (string)$journal['transaction_group_id'], ]; } @@ -179,7 +179,7 @@ class OperationsRepository implements OperationsRepositoryInterface // info about the currency: $array[$currencyId] = $array[$currencyId] ?? [ 'categories' => [], - 'currency_id' => $currencyId, + 'currency_id' => (string)$currencyId, 'currency_name' => $journal['currency_name'], 'currency_symbol' => $journal['currency_symbol'], 'currency_code' => $journal['currency_code'], @@ -188,7 +188,7 @@ class OperationsRepository implements OperationsRepositoryInterface // info about the categories: $array[$currencyId]['categories'][$categoryId] = $array[$currencyId]['categories'][$categoryId] ?? [ - 'id' => $categoryId, + 'id' => (string)$categoryId, 'name' => $categoryName, 'transaction_journals' => [], ]; @@ -199,12 +199,12 @@ class OperationsRepository implements OperationsRepositoryInterface $array[$currencyId]['categories'][$categoryId]['transaction_journals'][$journalId] = [ 'amount' => app('steam')->positive($journal['amount']), 'date' => $journal['date'], - 'source_account_id' => $journal['source_account_id'], - 'destination_account_id' => $journal['destination_account_id'], + 'source_account_id' => (string)$journal['source_account_id'], + 'destination_account_id' => (string)$journal['destination_account_id'], 'source_account_name' => $journal['source_account_name'], 'destination_account_name' => $journal['destination_account_name'], 'description' => $journal['description'], - 'transaction_group_id' => $journal['transaction_group_id'], + 'transaction_group_id' => (string)$journal['transaction_group_id'], ]; } @@ -243,7 +243,7 @@ class OperationsRepository implements OperationsRepositoryInterface // info about the currency: $array[$currencyId] = $array[$currencyId] ?? [ 'categories' => [], - 'currency_id' => $currencyId, + 'currency_id' => (string)$currencyId, 'currency_name' => $journal['currency_name'], 'currency_symbol' => $journal['currency_symbol'], 'currency_code' => $journal['currency_code'], @@ -252,7 +252,7 @@ class OperationsRepository implements OperationsRepositoryInterface // info about the categories: $array[$currencyId]['categories'][$categoryId] = $array[$currencyId]['categories'][$categoryId] ?? [ - 'id' => $categoryId, + 'id' => (string)$categoryId, 'name' => $categoryName, 'transaction_journals' => [], ]; @@ -263,13 +263,13 @@ class OperationsRepository implements OperationsRepositoryInterface $array[$currencyId]['categories'][$categoryId]['transaction_journals'][$journalId] = [ 'amount' => app('steam')->positive($journal['amount']), 'date' => $journal['date'], - 'source_account_id' => $journal['source_account_id'], + 'source_account_id' => (string)$journal['source_account_id'], 'category_name' => $journal['category_name'], 'source_account_name' => $journal['source_account_name'], - 'destination_account_id' => $journal['destination_account_id'], + 'destination_account_id' => (string)$journal['destination_account_id'], 'destination_account_name' => $journal['destination_account_name'], 'description' => $journal['description'], - 'transaction_group_id' => $journal['transaction_group_id'], + 'transaction_group_id' => (string)$journal['transaction_group_id'], ]; } @@ -308,7 +308,7 @@ class OperationsRepository implements OperationsRepositoryInterface // info about the currency: $array[$currencyId] = $array[$currencyId] ?? [ 'categories' => [], - 'currency_id' => $currencyId, + 'currency_id' => (string)$currencyId, 'currency_name' => $journal['currency_name'], 'currency_symbol' => $journal['currency_symbol'], 'currency_code' => $journal['currency_code'], @@ -317,7 +317,7 @@ class OperationsRepository implements OperationsRepositoryInterface // info about the categories: $array[$currencyId]['categories'][$categoryId] = $array[$currencyId]['categories'][$categoryId] ?? [ - 'id' => $categoryId, + 'id' => (string)$categoryId, 'name' => $categoryName, 'transaction_journals' => [], ]; @@ -328,13 +328,13 @@ class OperationsRepository implements OperationsRepositoryInterface $array[$currencyId]['categories'][$categoryId]['transaction_journals'][$journalId] = [ 'amount' => app('steam')->negative($journal['amount']), 'date' => $journal['date'], - 'source_account_id' => $journal['source_account_id'], + 'source_account_id' => (string)$journal['source_account_id'], 'category_name' => $journal['category_name'], 'source_account_name' => $journal['source_account_name'], - 'destination_account_id' => $journal['destination_account_id'], + 'destination_account_id' => (string)$journal['destination_account_id'], 'destination_account_name' => $journal['destination_account_name'], 'description' => $journal['description'], - 'transaction_group_id' => $journal['transaction_group_id'], + 'transaction_group_id' => (string)$journal['transaction_group_id'], ]; } @@ -373,7 +373,7 @@ class OperationsRepository implements OperationsRepositoryInterface $currencyId = (int)$journal['currency_id']; $array[$currencyId] = $array[$currencyId] ?? [ 'sum' => '0', - 'currency_id' => $currencyId, + 'currency_id' => (string)$currencyId, 'currency_name' => $journal['currency_name'], 'currency_symbol' => $journal['currency_symbol'], 'currency_code' => $journal['currency_code'], @@ -416,7 +416,7 @@ class OperationsRepository implements OperationsRepositoryInterface $currencyId = (int)$journal['currency_id']; $array[$currencyId] = $array[$currencyId] ?? [ 'sum' => '0', - 'currency_id' => $currencyId, + 'currency_id' => (string)$currencyId, 'currency_name' => $journal['currency_name'], 'currency_symbol' => $journal['currency_symbol'], 'currency_code' => $journal['currency_code'], @@ -459,7 +459,7 @@ class OperationsRepository implements OperationsRepositoryInterface $currencyId = (int)$journal['currency_id']; $array[$currencyId] = $array[$currencyId] ?? [ 'sum' => '0', - 'currency_id' => $currencyId, + 'currency_id' => (string)$currencyId, 'currency_name' => $journal['currency_name'], 'currency_symbol' => $journal['currency_symbol'], 'currency_code' => $journal['currency_code'],