Skip to content

[finding] validation-rules.mdx says a currency value is stored as a { value, currency } pair — it is a bare number #10589

Description

@os-elon

Found by the docs audit of the first-run path (#10563).

What is wrong

content/docs/data-modeling/validation-rules.mdx:147 states:

Default constraints: Stored as { value, currency } pair. Precision
defaults to 2 decimal places.

A currency value is a bare number. packages/spec/src/data/field-value.zod.ts:52-55:

/** Value is a finite numeric scalar. `currency` IS a bare number (see header). */exportconstNUMERIC_VALUE_TYPES: ReadonlySet<string>=newSet(['number','currency','percent','rating','slider','progress','summary',]asconstsatisfiesreadonlyFieldType[]);

valueSchemaFor (same file, line 412) returns z.number().finite() for every
member of that set. There is no { value, currency } envelope anywhere on the
value path; the per-record currency code is a separate concern carried by
currencyConfig (currencyMode: 'dynamic' | 'fixed', defaultCurrency), which
the same table two rows above documents correctly.

The sibling page does not carry the error: content/docs/data-modeling/field-types.mdx:147-162
documents currency with the same currencyConfig table and makes no stored-shape
claim.

Back-link: #10563

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions