You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 507ed8f
Browse filesBrowse the repository at this point in the historyBrowse files
fix(service-analytics): the compile guards judge record-mode amounts only — the fixed-only arms are not R1's to narrow; the two chain pins restored, the changeset back to widening / added
Copy file name to clipboardExpand all lines: .changeset/27187-record-currency-analytics.md
+7-9Lines changed: 7 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,23 +3,21 @@
3
3
'@objectstack/service-analytics': minor
4
4
---
5
5
6
-
feat(spec,service-analytics): analytics over a record-currency amount — grouped answers name a per-row currency, an ungrouped amount aggregate is refused, and two compile-time measure-currency guards (ADR-0144 D2, D6)
6
+
feat(spec,service-analytics): analytics over a record-currency amount — grouped answers name a per-row currency, an ungrouped amount aggregate is refused, and two compile-time guards on record-mode measures (ADR-0144 D2, D6)
7
7
8
-
Clause-②: yes (narrowing)
9
-
Metadata-protocol: narrowed
8
+
Clause-②: yes (widening)
9
+
Metadata-protocol: added
10
10
11
11
A measure column over a `currencyMode: 'record'` amount now carries `fields[].currencyField` on a `queryDataset` answer: the name of the dimension column that groups by the amount's code field. Each row's currency is that row's value of it, and the column carries no `currency`. Before, a breakdown by currency labelled every group with one code.
12
12
13
13
-`AnalyticsResult.fields[].currencyField` (`@objectstack/spec/contracts`) and the same key on `AnalyticsResultResponseSchema` (`@objectstack/spec/api`).
14
14
- The cube door refuses a `sum`, `avg`, `min` or `max` over a record-mode amount whose query does not group by the code field, with `INVALID_FIELD` / 400 naming the measure, the field and its object. A `totals` grouping that drops the code, the grand total included, is refused the same way. `count` reads no amount and is served.
15
15
16
-
**BREAKING** (`@objectstack/service-analytics`): two compile-time refusals, `DATASET_INVALID` / 400, for dataset metadata that compiled before and printed a wrong label or a wrong number.
16
+
Two compile-time refusals, `DATASET_INVALID` / 400, on the record mode alone, so nothing that compiled before is refused:
17
17
18
-
-A measure `currency`that contradicts its field: a code other than the `fixed` field's own, or any code over a record-mode amount. The column printed the field's amounts under the measure's code. A code equal to the `fixed` field's is still accepted, and a measure `currency` over a `dynamic` field is not judged.
19
-
-A derived measure whose monetary operands are in currencies that provably differ (two different codes, or a record-mode amount against anything but itself), for every op. The derived value combined bare numbers in two currencies and carried no currency at all. A count operand is not compared, so a revenue-per-deal ratio still compiles.
18
+
-a measure `currency` over a record-mode amount, whose currencyis per row;
19
+
-a derived measure that combines a record-mode amount with an operand in another currency (another code field, a `fixed` code, an explicit code or the tenant's), for every op. A count operand is not compared, so an amount-per-invoice ratio still compiles.
20
20
21
-
Each refusal names the measure and says what to delete or change. No in-tree dataset declares either shape.
22
-
23
-
<!-- adr-0087: not-required (no-migration-prescription) the two refusals reject a contradiction in a dataset's own measures at compile and name the fix in their message; there is no stored shape to convert and no key is removed -->
21
+
The same two shapes over `fixed` fields only are not judged.
24
22
25
23
⛔ Not released alone: this ships in the same release as the record currency mode, its write refusals and the per-row display.
0 commit comments