feat(server): GET /auth/me/localization — tenant regional defaults for every user#2122
Merged
Merged
Conversation
…r every user
Phase 2a of unifying currency. The `localization` settings (currency/locale/
timezone) are gated to `setup.access`, and `discovery` is static/context-free —
so a regular user's client has no way to learn the tenant's default currency or
locale to format values consistently.
This adds `GET /api/v1/auth/me/localization`, returning the resolved
`{ currency, locale, timezone }` off the request ExecutionContext (the same
values #2119 wired in) to every AUTHENTICATED user — without the setup.access
gate on the underlying settings. A thin passthrough of `resolveCtx(c)`; the
ctx resolution itself is covered by resolve-execution-context tests.
Unblocks the objectui client (Phase 2): a LocalizationProvider can fetch this
once and feed a single currency/number formatter the tenant default + locale,
replacing ~20 ad-hoc per-site currency-resolution paths.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 5 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
xuyushun441-sys
added a commit
that referenced
this pull request
Jun 21, 2026
…ode; showcase demo (#2123) * docs(currency): document the field→tenant resolution chain; fix currencyMode; showcase demo Follows the currency-resolution work (#2102/#2119/#2121/#2122). Brings the skills + showcase in line with the now-implemented chain. - objectstack-ui SKILL: document `DatasetMeasure.currency` (ISO 4217) and its resolution order (measure → field `currencyConfig` → tenant default). - objectstack-data field-types: FIX a real doc bug — `currencyMode` was documented as `'multi'/'single'`, the schema is `'fixed'/'dynamic'`; add a "Currency resolution (ADR-0053)" note (field default → tenant default → plain number, never a hardcoded `$`). - objectstack-i18n SKILL: note the workspace regional defaults (timezone / locale / currency) — the `localization` settings, resolved onto ExecutionContext and exposed at `/auth/me/localization`. - showcase: declare a fixed `currencyConfig.defaultCurrency` on field-zoo's currency field (demonstrates + smoke-covers the symbol path); refresh the chart-gallery `budget`/`spent` comment, which claimed an unspecified-currency amount "must not show a $" — now it falls back to the tenant default. Verified: app-showcase builds (field + dataset parse); check:skill-docs in sync. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(showcase): currencyConfig requires precision (typecheck) --------- Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 2a — expose regional defaults to the client
The
localizationsettings (currency / locale / timezone) are gated tosetup.access, and thediscoveryendpoint is static / context-free. So a regular user's client has no way to learn the tenant's default currency or locale to format values consistently — which is why every objectui currency renderer falls back to a hardcoded$/¥/USDor a bare number (see the cross-repo currency audit).This adds
GET /api/v1/auth/me/localization→{ authenticated, currency, locale, timezone }resolved off the requestExecutionContext(the values #2119 wired in), exposed to every authenticated user without thesetup.accessgate on the underlying settings.Why
It's the prerequisite for Phase 2 (objectui): a
LocalizationProviderfetches this once and feeds a single currency/number formatter the tenant default + locale, replacing the ~20 ad-hoc per-site currency-resolution paths (2 divergentformatCurrency, 3 Intl locales, hardcoded symbols).Notes
resolveCtx(c); the ctx resolution (incl. currency) is covered byresolve-execution-contexttests (feat(runtime): resolve tenant default currency onto ExecutionContext #2119). The hono-plugin test harness has no/me-route integration fixture, so no bespoke route test is added.🤖 Generated with Claude Code