diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fb702f8e33..fb1234092a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -314,6 +314,7 @@ jobs: git push origin $releaseName gh release create $releaseName -p --verify-tag \ -t "Development release for $(date +'%Y-%m-%d')" \ + --latest=false \ -F output.txt fi @@ -327,6 +328,7 @@ jobs: git push origin $releaseName gh release create $releaseName -p --verify-tag \ -t "Branch release for $(date +'%Y-%m-%d')" \ + --latest=false \ -F output.txt fi @@ -352,7 +354,18 @@ jobs: echo 'MAIN (real) release' git tag -a $releaseName -m "Here be changelog" git push origin $releaseName - gh release create $releaseName -F output.txt -t "$releaseName" --verify-tag + + # do not tag as latest when alpha or beta. + if [[ "$version" == *alpha* ]] || [[ "$version" == *beta* ]]; then + echo 'Mark alpha or beta as NOT the latest.' + gh release create $releaseName -F output.txt -t "$releaseName" --verify-tag --latest=false + fi + + # tag as latest when NOT alpha or beta. + if [[ "$version" != *alpha* ]] && [[ "$version" != *beta* ]]; then + echo 'Mark prod as the latest.' + gh release create $releaseName -F output.txt -t "$releaseName" --verify-tag + fi # add archive files to release gh release upload $releaseName $zipName diff --git a/app/Http/Controllers/Chart/BudgetController.php b/app/Http/Controllers/Chart/BudgetController.php index 2ae6db7a63..e017f322c1 100644 --- a/app/Http/Controllers/Chart/BudgetController.php +++ b/app/Http/Controllers/Chart/BudgetController.php @@ -397,6 +397,9 @@ class BudgetController extends Controller foreach ($journals as $journal) { $key = sprintf('%d-%d', $journal['destination_account_id'], $journal['currency_id']); $amount = $journal['amount']; + $symbol = $journal['currency_symbol']; + $code = $journal['currency_code']; + $name = $journal['currency_name']; // if convert to native, use the native things, unless it's the foreign amount which is in the native currency. if ($this->convertToNative && $journal['currency_id'] !== $this->defaultCurrency->id && $journal['foreign_currency_id'] !== $this->defaultCurrency->id) { diff --git a/app/Repositories/PiggyBank/PiggyBankRepository.php b/app/Repositories/PiggyBank/PiggyBankRepository.php index 3376f11c1c..3f5d987fdb 100644 --- a/app/Repositories/PiggyBank/PiggyBankRepository.php +++ b/app/Repositories/PiggyBank/PiggyBankRepository.php @@ -53,7 +53,11 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface public function destroyAll(): void { Log::channel('audit')->info('Delete all piggy banks through destroyAll'); - $this->user->piggyBanks()->delete(); + + PiggyBank::leftJoin('account_piggy_bank', 'account_piggy_bank.piggy_bank_id', '=', 'piggy_banks.id') + ->leftJoin('accounts', 'accounts.id', '=', 'account_piggy_bank.account_id') + ->where('accounts.user_id', $this->user->id) + ->delete(); } public function findPiggyBank(?int $piggyBankId, ?string $piggyBankName): ?PiggyBank diff --git a/tests/integration/Api/Autocomplete/CurrencyControllerTest.php b/tests/integration/Api/Autocomplete/CurrencyControllerTest.php index 577dd57ac7..6b61462192 100644 --- a/tests/integration/Api/Autocomplete/CurrencyControllerTest.php +++ b/tests/integration/Api/Autocomplete/CurrencyControllerTest.php @@ -100,7 +100,7 @@ final class CurrencyControllerTest extends TestCase $this->actingAs($user); // create test data - $this->createTestCurrencies(10, true); + $this->createTestCurrencies(9, true); // test API $response = $this->get(route('api.v1.autocomplete.currencies'), ['Accept' => 'application/json']); @@ -134,7 +134,7 @@ final class CurrencyControllerTest extends TestCase $response = $this->get(route('api.v1.autocomplete.currencies'), ['Accept' => 'application/json']); $response->assertStatus(200); $response->assertHeader('Content-Type', 'application/json'); - $response->assertJsonCount(0); + $response->assertJsonCount(1); // always connects to EUR. } public function testGivenAuthenticatedRequestWhenCallingTheCurrenciesEndpointWithQueryThenReturnsCurrenciesWithLimit(): void diff --git a/tests/integration/TestCase.php b/tests/integration/TestCase.php index 6be5deece5..a1feed229d 100644 --- a/tests/integration/TestCase.php +++ b/tests/integration/TestCase.php @@ -23,8 +23,10 @@ declare(strict_types=1); namespace Tests\integration; +use FireflyIII\Models\TransactionCurrency; use FireflyIII\Models\UserGroup; use FireflyIII\User; +use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\TestCase as BaseTestCase; use Tests\integration\Traits\CollectsValues; @@ -35,8 +37,10 @@ abstract class TestCase extends BaseTestCase { use CollectsValues; use CreatesApplication; + use RefreshDatabase; protected const MAX_ITERATIONS = 2; + protected $seed = true; public function dateRangeProvider(): array {