Skip to content

Commit c4fd39f

Browse files
authored
fix(service-settings): drop hard-coded USD platform default for workspace currency (#2672)
Remove default: 'USD' from the localization manifest's currency setting. A code-less currency amount now renders as a plain number unless the field declares its own code or the workspace sets a default currency — the platform no longer invents USD for amounts that never named a currency. Migration: workspaces relying on the implicit default should set Settings → Localization → Default currency explicitly.
1 parent 3fd3576 commit c4fd39f

3 files changed

Lines changed: 20 additions & 3 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'@objectstack/service-settings': minor
3+
---
4+
5+
Localization: drop the hard-coded `USD` platform default for the workspace **Default currency** setting.
6+
7+
Previously the `localization.currency` setting defaulted to `'USD'`, and that value was applied to any `currency`-typed field that omits its own code — so every code-less amount surfaced a `$`/`US$` symbol even when nothing (field, measure, or workspace) actually named a currency. The setting now has **no platform default**: a code-less currency amount renders as a plain number unless the workspace explicitly picks a default currency (or the field declares its own).
8+
9+
Migration: a workspace that relied on the implicit USD default and wants to keep showing `$` should set **Settings → Localization → Default currency** to `USD` explicitly. Fields/measures that declare their own currency code are unaffected.

packages/services/service-settings/src/manifests/localization.manifest.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ describe('localizationSettingsManifest', () => {
2121
const byKey = (k: string) => specs.find((s) => s.key === k);
2222
expect(byKey('timezone').default).toBe('UTC');
2323
expect(byKey('locale').default).toBe('en-US');
24-
expect(byKey('currency').default).toBe('USD');
24+
// No platform default currency: a code-less currency field renders as a
25+
// plain number unless the workspace explicitly sets one (avoids surfacing
26+
// an unwanted "$"/"US$" on every amount that omits its own code).
27+
expect(byKey('currency').default).toBeUndefined();
2528
expect(byKey('date_format').default).toBe('YYYY-MM-DD');
2629
expect(byKey('first_day_of_week').default).toBe('monday');
2730
expect(byKey('fiscal_year_start').default).toBe('january');

packages/services/service-settings/src/manifests/localization.manifest.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,13 @@ export const localizationSettingsManifest: SettingsManifest = {
111111
// ── Finance ───────────────────────────────────────────────────────────
112112
{ type: 'group', id: 'finance', label: 'Finance', required: false },
113113
{
114-
type: 'select', key: 'currency', label: 'Default currency', required: false, default: 'USD',
115-
description: 'ISO 4217 code applied when a currency field omits its own.',
114+
type: 'select', key: 'currency', label: 'Default currency', required: false,
115+
// No platform default: when a currency field omits its own code AND the
116+
// workspace has not set a default here, amounts render as plain numbers
117+
// rather than inheriting a guessed symbol (previously hard-defaulted to
118+
// 'USD', which surfaced an unwanted "$"/"US$" on every code-less amount).
119+
// A workspace can still pick a default to apply org-wide.
120+
description: 'ISO 4217 code applied when a currency field omits its own. Leave unset to render code-less amounts as plain numbers.',
116121
options: [
117122
{ value: 'USD', label: 'USD — US Dollar' },
118123
{ value: 'EUR', label: 'EUR — Euro' },

0 commit comments

Comments
 (0)