Przeglądaj źródła

feat(currency): add Philippine Peso (PHP, ₱)

Adds PHP to CURRENCY_SYMBOLS, which feeds both getCurrencySymbol() and the
Settings currency dropdown. Backend stores the code string and needs no change.
maziggy 1 miesiąc temu
rodzic
commit
6b3dd63513

+ 10 - 2
frontend/src/__tests__/utils/currency.test.ts

@@ -34,6 +34,10 @@ describe('getCurrencySymbol', () => {
     expect(getCurrencySymbol('BZD')).toBe('BZ$');
     expect(getCurrencySymbol('BZD')).toBe('BZ$');
   });
   });
 
 
+  it('returns ₱ for PHP', () => {
+    expect(getCurrencySymbol('PHP')).toBe('₱');
+  });
+
   it('returns the code itself for unknown currencies', () => {
   it('returns the code itself for unknown currencies', () => {
     expect(getCurrencySymbol('XYZ')).toBe('XYZ');
     expect(getCurrencySymbol('XYZ')).toBe('XYZ');
   });
   });
@@ -61,7 +65,11 @@ describe('SUPPORTED_CURRENCIES', () => {
     expect(SUPPORTED_CURRENCIES.find((c) => c.code === 'IDR')).toBeDefined();
     expect(SUPPORTED_CURRENCIES.find((c) => c.code === 'IDR')).toBeDefined();
   });
   });
 
 
-  it('has 31 entries', () => {
-    expect(SUPPORTED_CURRENCIES).toHaveLength(31);
+  it('contains PHP', () => {
+    expect(SUPPORTED_CURRENCIES.find((c) => c.code === 'PHP')).toEqual({ code: 'PHP', label: 'PHP (₱)' });
+  });
+
+  it('has 32 entries', () => {
+    expect(SUPPORTED_CURRENCIES).toHaveLength(32);
   });
   });
 });
 });

+ 1 - 0
frontend/src/utils/currency.ts

@@ -30,6 +30,7 @@ const CURRENCY_SYMBOLS: Record<string, string> = {
   ILS: '₪',
   ILS: '₪',
   UAH: '₴',
   UAH: '₴',
   IDR: 'Rp',
   IDR: 'Rp',
+  PHP: '₱',
 };
 };
 
 
 export function getCurrencySymbol(currencyCode: string): string {
 export function getCurrencySymbol(currencyCode: string): string {

Plik diff jest za duży
+ 0 - 0
static/assets/index-K1HnBuZh.js


+ 1 - 1
static/index.html

@@ -26,7 +26,7 @@
 
 
     <!-- Splash screens for iOS -->
     <!-- Splash screens for iOS -->
     <link rel="apple-touch-startup-image" href="/img/android-chrome-512x512.png" />
     <link rel="apple-touch-startup-image" href="/img/android-chrome-512x512.png" />
-    <script type="module" crossorigin src="/assets/index-D8XeZXKl.js"></script>
+    <script type="module" crossorigin src="/assets/index-K1HnBuZh.js"></script>
     <link rel="stylesheet" crossorigin href="/assets/index-blSspT6K.css">
     <link rel="stylesheet" crossorigin href="/assets/index-blSspT6K.css">
   </head>
   </head>
   <body>
   <body>

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików