From e5b493329a6b5b8e6fdf04f873e591546c42441d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Falc=C3=B3n?= Date: Mon, 1 Jun 2026 18:14:16 +0200 Subject: [PATCH] feat(currencies): add Colombian and Dominican peso (#471) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Adds **COP** (Colombian Peso) and **DOP** (Dominican Peso) to the supported currency list for both accounts and user primary currency. ## Compatibility Both are supported by the conversion API (fawazahmed0 currency-api): - 1 USD = 3686.83 COP - 1 USD = 58.74 DOP No migration needed — `currency_code` columns are plain strings and validation reads the whitelist from `config/currencies.php`. ## Changes - `config/currencies.php` — add COP + DOP (primary + account) - `resources/js/utils/currency.ts` — add `RD$` symbol for DOP - `tests/Feature/Settings/AccountTest.php` — acceptance tests for both ## Testing `php artisan test --filter="Colombian|Dominican"` → passing --- config/currencies.php | 18 ++++++++---- resources/js/utils/currency.ts | 1 + tests/Feature/Settings/AccountTest.php | 38 ++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 6 deletions(-) diff --git a/config/currencies.php b/config/currencies.php index aef176a9..13e5f44b 100644 --- a/config/currencies.php +++ b/config/currencies.php @@ -86,12 +86,6 @@ return [ 'allows_primary' => true, 'allows_account' => true, ], - [ - 'code' => 'COP', - 'name' => 'Colombian Peso', - 'allows_primary' => true, - 'allows_account' => true, - ], [ 'code' => 'PYG', 'name' => 'Paraguayan Guarani', @@ -122,6 +116,18 @@ return [ 'allows_primary' => true, 'allows_account' => true, ], + [ + 'code' => 'COP', + 'name' => 'Colombian Peso', + 'allows_primary' => true, + 'allows_account' => true, + ], + [ + 'code' => 'DOP', + 'name' => 'Dominican Peso', + 'allows_primary' => true, + 'allows_account' => true, + ], [ 'code' => 'SAR', 'name' => 'Saudi Riyal', diff --git a/resources/js/utils/currency.ts b/resources/js/utils/currency.ts index 5d535ebf..47526853 100644 --- a/resources/js/utils/currency.ts +++ b/resources/js/utils/currency.ts @@ -23,6 +23,7 @@ export function getCurrencySymbol(currencyCode: string): string { EUR: '€', GBP: '£', JPY: '¥', + DOP: 'RD$', }; return symbols[currencyCode] || currencyCode; } diff --git a/tests/Feature/Settings/AccountTest.php b/tests/Feature/Settings/AccountTest.php index 52131aae..2c82c733 100644 --- a/tests/Feature/Settings/AccountTest.php +++ b/tests/Feature/Settings/AccountTest.php @@ -132,6 +132,44 @@ it('accepts new latam currency when creating account', function () { ]); }); +it('accepts Colombian peso when creating account', function () { + actingAs($this->user); + + $response = $this->post(route('accounts.store'), [ + 'name' => 'Colombia Account', + 'bank_id' => $this->bank->id, + 'currency_code' => 'COP', + 'type' => AccountType::Checking->value, + ]); + + $response->assertRedirect(); + + assertDatabaseHas('accounts', [ + 'user_id' => $this->user->id, + 'bank_id' => $this->bank->id, + 'currency_code' => 'COP', + ]); +}); + +it('accepts Dominican peso when creating account', function () { + actingAs($this->user); + + $response = $this->post(route('accounts.store'), [ + 'name' => 'Dominican Account', + 'bank_id' => $this->bank->id, + 'currency_code' => 'DOP', + 'type' => AccountType::Checking->value, + ]); + + $response->assertRedirect(); + + assertDatabaseHas('accounts', [ + 'user_id' => $this->user->id, + 'bank_id' => $this->bank->id, + 'currency_code' => 'DOP', + ]); +}); + it('accepts Pakistani rupee when creating account', function () { actingAs($this->user);