Skip to content

Commit 7237ed7

Browse files
committed
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011u73oxZ5X95qrARPTeoU6v
1 parent a2e94c2 commit 7237ed7

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
fix(skills): the `objectstack-data` field-types rule names all five formula `returnType` members, `'currency'` included, and the `currencyConfig` a currency formula carries (#22743)
6+
7+
Clause-②: no
8+
9+
`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.

‎skills/objectstack-data/rules/field-types.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Stored as JSON on the parent row — no separate table / FK:
126126

127127
| Type | When to Use | Config |
128128
|:-----|:------------|:-------|
129-
| `formula` | Computed from an expression referencing other fields | `expression` (CEL, `record.` prefixes), `returnType` (`'number' \| 'text' \| 'boolean' \| 'date'`) |
129+
| `formula` | Computed from an expression referencing other fields | `expression` (CEL, `record.` prefixes), `returnType` (`'number' \| 'text' \| 'boolean' \| 'date' \| 'currency'`); `'currency'` carries its own `currencyConfig` |
130130
| `summary` | Roll-up aggregation from child records | `summaryOperations` ({ object, field, function, relationshipField?, filter? }) |
131131
| `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}"` |
132132

@@ -249,8 +249,8 @@ import { F } from '@objectstack/spec';
249249

250250
const total = {
251251
type: 'formula',
252-
expression: F`record.amount * record.tax_rate`, // CEL — `record.` prefixes required
253-
returnType: 'number', // 'number' | 'text' | 'boolean' | 'date' (no 'currency')
252+
expression: F`record.amount * record.tax_rate`,
253+
returnType: 'number', // 'number' | 'text' | 'boolean' | 'date' | 'currency' (money; own currencyConfig)
254254
};
255255
```
256256

0 commit comments

Comments
 (0)