Merge branch 'main' into develop

This commit is contained in:
James Cole 2025-01-03 08:17:57 +01:00
commit 2ef3a33fbf
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80
5 changed files with 28 additions and 4 deletions

View File

@ -314,6 +314,7 @@ jobs:
git push origin $releaseName git push origin $releaseName
gh release create $releaseName -p --verify-tag \ gh release create $releaseName -p --verify-tag \
-t "Development release for $(date +'%Y-%m-%d')" \ -t "Development release for $(date +'%Y-%m-%d')" \
--latest=false \
-F output.txt -F output.txt
fi fi
@ -327,6 +328,7 @@ jobs:
git push origin $releaseName git push origin $releaseName
gh release create $releaseName -p --verify-tag \ gh release create $releaseName -p --verify-tag \
-t "Branch release for $(date +'%Y-%m-%d')" \ -t "Branch release for $(date +'%Y-%m-%d')" \
--latest=false \
-F output.txt -F output.txt
fi fi
@ -352,7 +354,18 @@ jobs:
echo 'MAIN (real) release' echo 'MAIN (real) release'
git tag -a $releaseName -m "Here be changelog" git tag -a $releaseName -m "Here be changelog"
git push origin $releaseName 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 # add archive files to release
gh release upload $releaseName $zipName gh release upload $releaseName $zipName

View File

@ -397,6 +397,9 @@ class BudgetController extends Controller
foreach ($journals as $journal) { foreach ($journals as $journal) {
$key = sprintf('%d-%d', $journal['destination_account_id'], $journal['currency_id']); $key = sprintf('%d-%d', $journal['destination_account_id'], $journal['currency_id']);
$amount = $journal['amount']; $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 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) { if ($this->convertToNative && $journal['currency_id'] !== $this->defaultCurrency->id && $journal['foreign_currency_id'] !== $this->defaultCurrency->id) {

View File

@ -53,7 +53,11 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
public function destroyAll(): void public function destroyAll(): void
{ {
Log::channel('audit')->info('Delete all piggy banks through destroyAll'); 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 public function findPiggyBank(?int $piggyBankId, ?string $piggyBankName): ?PiggyBank

View File

@ -100,7 +100,7 @@ final class CurrencyControllerTest extends TestCase
$this->actingAs($user); $this->actingAs($user);
// create test data // create test data
$this->createTestCurrencies(10, true); $this->createTestCurrencies(9, true);
// test API // test API
$response = $this->get(route('api.v1.autocomplete.currencies'), ['Accept' => 'application/json']); $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 = $this->get(route('api.v1.autocomplete.currencies'), ['Accept' => 'application/json']);
$response->assertStatus(200); $response->assertStatus(200);
$response->assertHeader('Content-Type', 'application/json'); $response->assertHeader('Content-Type', 'application/json');
$response->assertJsonCount(0); $response->assertJsonCount(1); // always connects to EUR.
} }
public function testGivenAuthenticatedRequestWhenCallingTheCurrenciesEndpointWithQueryThenReturnsCurrenciesWithLimit(): void public function testGivenAuthenticatedRequestWhenCallingTheCurrenciesEndpointWithQueryThenReturnsCurrenciesWithLimit(): void

View File

@ -23,8 +23,10 @@ declare(strict_types=1);
namespace Tests\integration; namespace Tests\integration;
use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Models\UserGroup; use FireflyIII\Models\UserGroup;
use FireflyIII\User; use FireflyIII\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase; use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
use Tests\integration\Traits\CollectsValues; use Tests\integration\Traits\CollectsValues;
@ -35,8 +37,10 @@ abstract class TestCase extends BaseTestCase
{ {
use CollectsValues; use CollectsValues;
use CreatesApplication; use CreatesApplication;
use RefreshDatabase;
protected const MAX_ITERATIONS = 2; protected const MAX_ITERATIONS = 2;
protected $seed = true;
public function dateRangeProvider(): array public function dateRangeProvider(): array
{ {