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);