From cfa61fd23cc9b7888755684d24ede3f6a35863cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Falc=C3=B3n?= Date: Thu, 28 May 2026 09:46:09 +0200 Subject: [PATCH] feat: add PKR currency support (#443) ## Summary - Add Pakistani Rupee (PKR) to supported primary and account currencies - Cover PKR account creation and profile currency selection ## Tests - vendor/bin/pint --dirty --format agent - php artisan test --compact tests/Feature/Settings/AccountTest.php tests/Feature/Settings/ProfileUpdateTest.php --- config/currencies.php | 6 ++++++ tests/Feature/Settings/AccountTest.php | 19 +++++++++++++++++++ tests/Feature/Settings/ProfileUpdateTest.php | 19 +++++++++++++++++++ 3 files changed, 44 insertions(+) diff --git a/config/currencies.php b/config/currencies.php index 1b9f1d19..7da5b083 100644 --- a/config/currencies.php +++ b/config/currencies.php @@ -56,6 +56,12 @@ return [ 'allows_primary' => true, 'allows_account' => true, ], + [ + 'code' => 'PKR', + 'name' => 'Pakistani Rupee', + 'allows_primary' => true, + 'allows_account' => true, + ], [ 'code' => 'MXN', 'name' => 'Mexican Peso', diff --git a/tests/Feature/Settings/AccountTest.php b/tests/Feature/Settings/AccountTest.php index d5ee43d9..8bb26f79 100644 --- a/tests/Feature/Settings/AccountTest.php +++ b/tests/Feature/Settings/AccountTest.php @@ -132,6 +132,25 @@ it('accepts new latam currency when creating account', function () { ]); }); +it('accepts Pakistani rupee when creating account', function () { + actingAs($this->user); + + $response = $this->post(route('accounts.store'), [ + 'name' => 'Pakistan Account', + 'bank_id' => $this->bank->id, + 'currency_code' => 'PKR', + 'type' => AccountType::Checking->value, + ]); + + $response->assertRedirect(); + + assertDatabaseHas('accounts', [ + 'user_id' => $this->user->id, + 'bank_id' => $this->bank->id, + 'currency_code' => 'PKR', + ]); +}); + it('accepts bitcoin when creating account', function () { actingAs($this->user); diff --git a/tests/Feature/Settings/ProfileUpdateTest.php b/tests/Feature/Settings/ProfileUpdateTest.php index ed2a79ba..f1abc12a 100644 --- a/tests/Feature/Settings/ProfileUpdateTest.php +++ b/tests/Feature/Settings/ProfileUpdateTest.php @@ -53,6 +53,25 @@ test('profile accepts new latam primary currency', function () { expect($user->refresh()->currency_code)->toBe('ARS'); }); +test('profile accepts Pakistani rupee as primary currency', function () { + $user = User::factory()->create(); + + $response = $this + ->actingAs($user) + ->patch(route('profile.update'), [ + 'name' => 'Test User', + 'email' => 'test@example.com', + 'currency_code' => 'PKR', + 'month_start_day' => 1, + ]); + + $response + ->assertSessionHasNoErrors() + ->assertRedirect(route('account.edit')); + + expect($user->refresh()->currency_code)->toBe('PKR'); +}); + test('profile rejects bitcoin as primary currency', function () { $user = User::factory()->create();