feat(analytics): propagate a measure's declared currency to the result field#2102
Merged
Conversation
…t field A dataset measure could declare a `format` (carried onto the analytics result field so the client renders "$616,000"), but there was NO way to declare a currency CODE. The analytics result enrichment set `label` + `format` on each measure field but never `currency` — so the client's currency-aware formatting (Intl symbol from a declared currency, ADR-0021; objectui DatasetWidget/report renderer) could never fire against real data: every amount fell back to a plain number or a "$" literal baked into `format`, regardless of the actual currency. This adds the missing link, symmetric with `format`: - spec: `DatasetMeasure.currency` (ISO 4217, optional) — declared on the semantic layer when the aggregated field is a fixed-currency amount. - service-analytics: carry `measure.currency` onto the result field alongside `label`/`format`, so the renderer gets a real currency code. - example (app-crm): `opportunity_metrics` total/avg amount now declare `currency: 'USD'` (and drop the legacy `$` from `format`) so the pipeline reports render a locale-correct symbol via Intl. Tests: service-analytics 138 passed (+1: a measure's declared currency rides onto its result field). Spec builds; the new field is additive + optional. 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 2 package(s): 91 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
This was referenced Jun 21, 2026
Merged
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>
os-zhuang
added a commit
that referenced
this pull request
Jun 30, 2026
…s) (#2471) Pins the vendored @objectstack/console to objectui d23d6ebfa so the served console includes the kind:'react' renderer + the full HTML tag set for kind:'html' (objectui #2105). Carries two small list inline-edit toggles (#2102/#2103) since the previous pin. Activates the CRM Workbench showcase page (ADR-0081) in the real serving path. 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.
The gap
A dataset measure can declare a
format(carried onto the analytics result field so the client renders$616,000), but there was no way to declare a currency CODE. The result enrichment inanalytics-servicesetlabel+formaton each measure field but nevercurrency:So the client's currency-aware formatting (Intl symbol from a declared currency — ADR-0021; objectui
DatasetWidgetand the dataset report renderer) could never fire against real data. Every amount fell back to a plain number, or to a$literal baked intoformat— regardless of the actual currency. The client feature was effectively inert end-to-end.(Found while verifying the objectui dataset-render currency work — no example ever rendered an
Intlcurrency symbol, which traced back to here.)The fix — symmetric with
formatDatasetMeasure.currency(ISO 4217, optional). Declared on the semantic layer when the aggregated field is a fixed-currency amount.measure.currencyonto the result field alongsidelabel/format.opportunity_metricstotal/avg amount now declarecurrency: 'USD'(and drop the legacy$fromformat), so the pipeline reports render a locale-correct symbol via Intl.Tests
service-analytics→ 138 passed (+1: a measure's declared currency rides onto its result field).Notes
tscwarnings inservice-analyticstest files (timezone, unusedDriverCapabilities) are untouched by this PR.🤖 Generated with Claude Code