From 7237ed7cbb18dfe1b1aba589f211af26c7640142 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 11 Oct 2026 06:58:10 +0000 Subject: [PATCH] docs(skills): field-types rule states a formula's five returnType members and the currencyConfig a currency formula carries The objectstack-data field-types rule taught returnType as a four-member set and its formula example said (no 'currency'); @objectstack/spec declares five members, and a 'currency' formula carries its own currencyConfig. Both sites now state the five-member set and name the carrier. The example's CEL comment, which restated the table cell, is removed to pay the skill token ratchet. Co-authored-by: Claude Claude-Session: https://claude.ai/code/session_011u73oxZ5X95qrARPTeoU6v --- .changeset/22743-field-types-currency-returntype.md | 9 +++++++++ skills/objectstack-data/rules/field-types.md | 6 +++--- 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 .changeset/22743-field-types-currency-returntype.md diff --git a/.changeset/22743-field-types-currency-returntype.md b/.changeset/22743-field-types-currency-returntype.md new file mode 100644 index 00000000000..a2eb0c57637 --- /dev/null +++ b/.changeset/22743-field-types-currency-returntype.md @@ -0,0 +1,9 @@ +--- +'@objectstack/skills': patch +--- + +fix(skills): the `objectstack-data` field-types rule names all five formula `returnType` members, `'currency'` included, and the `currencyConfig` a currency formula carries (#22743) + +Clause-②: no + +`skills/objectstack-data/rules/field-types.md` taught a formula's `returnType` as the four-member set `'number' | 'text' | 'boolean' | 'date'`, and its formula example said `(no 'currency')`. `@objectstack/spec`'s `FieldSchema.returnType` is the five-member enum `'number' | 'text' | 'boolean' | 'date' | 'currency'`, and a formula whose `returnType` is `'currency'` carries its currency in its own `currencyConfig` — `CurrencyConfigSchema`, the same shape a `currency` field declares; absent, the mode is `dynamic`, the tenant default currency. The `formula` table row and the formula example now both state the five-member set and name `currencyConfig` as the carrier. The example's `CEL — record. prefixes required` comment, which restated the table cell above it, is removed to pay the skill's token ratchet. Nothing is said about how a currency formula renders. diff --git a/skills/objectstack-data/rules/field-types.md b/skills/objectstack-data/rules/field-types.md index 762a116e6a7..e1aa71ad634 100644 --- a/skills/objectstack-data/rules/field-types.md +++ b/skills/objectstack-data/rules/field-types.md @@ -126,7 +126,7 @@ Stored as JSON on the parent row — no separate table / FK: | Type | When to Use | Config | |:-----|:------------|:-------| -| `formula` | Computed from an expression referencing other fields | `expression` (CEL, `record.` prefixes), `returnType` (`'number' \| 'text' \| 'boolean' \| 'date'`) | +| `formula` | Computed from an expression referencing other fields | `expression` (CEL, `record.` prefixes), `returnType` (`'number' \| 'text' \| 'boolean' \| 'date' \| 'currency'`); `'currency'` carries its own `currencyConfig` | | `summary` | Roll-up aggregation from child records | `summaryOperations` ({ object, field, function, relationshipField?, filter? }) | | `autonumber` | Auto-incrementing display format ({0000} counter + optional date / {field} tokens, resets per scope) | `format` (shorthand) / `autonumberFormat` (canonical) — e.g., `"CASE-{0000}"`, `"AD{YYYYMMDD}{0000}"` | @@ -249,8 +249,8 @@ import { F } from '@objectstack/spec'; const total = { type: 'formula', - expression: F`record.amount * record.tax_rate`, // CEL — `record.` prefixes required - returnType: 'number', // 'number' | 'text' | 'boolean' | 'date' (no 'currency') + expression: F`record.amount * record.tax_rate`, + returnType: 'number', // 'number' | 'text' | 'boolean' | 'date' | 'currency' (money; own currencyConfig) }; ```