Skip to content

[finding] field-level currency is rejected with no pointer to currencyConfig.defaultCurrency — the natural spelling gets history, not a prescription #8163

Description

@huangyiirene

Found while implementing #7918 (currency precision vs ISO 4217 digits). Recorded, not claimed.

Measured

FieldSchema is strict, and a field-level currency key is not declared, so writing the natural spelling is rejected — but the rejection carries only the surface history line, with no suggestion and no prescription:

Unrecognized key(s) on this field: `currency`. Until #4001 closed this shape these were
dropped silently — the field was still created, minus whatever the key was meant to
constrain, protect or compute.

Measured against the built spec at main 37b82ed (FieldSchema.safeParse({ name: 'amount', label: 'Amount', type: 'currency', currency: 'JPY' })). Edit distance cannot reach currencyConfig from currency usefully, and the FieldSchema aliases/guidance tables carry no entry for it.

Why the spelling is not hypothetical

Fix shape (one line of judgement, not a rename)

The right target is a NESTED key, so an aliases rename entry does not fit — this is the storageNotNull-style guidance prose case on FieldSchema's strict-object options, e.g.:

currency is not a field key — a fixed currency is declared as currencyConfig: { currencyMode: 'fixed', defaultCurrency: 'JPY' }. A field without one uses the tenant default at runtime.

Same class as #7887 (a key family with no vocabulary to point an author at). Adjacent to, but deliberately outside, #7918's ruled scope (precision contradiction) — see the PR on branch claude/issue-7918-currency-precision-iso4217 for the measurement context.


Generated by Claude Code

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions