Skip to content

Commit 3eaecb2

Browse files
committed
docs(service-analytics): cite ADR-0144 as landed — open item 12 and its ruling, D6 for consolidation
Claude-Session: https://claude.ai/code/session_01Utp6Ca8jzC2P7EAQvqjNBb Co-authored-by: Claude <noreply@anthropic.com>
1 parent 2aa89a8 commit 3eaecb2

4 files changed

Lines changed: 10 additions & 9 deletions

File tree

‎.changeset/27187-record-currency-analytics.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ Two compile-time refusals, `DATASET_INVALID` / 400, on the record mode alone, so
1818
- a measure `currency` over a record-mode amount, whose currency is per row;
1919
- 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.
2020

21-
The same two shapes over `fixed` fields only are not judged.
21+
The same two shapes over `fixed` fields only are not judged here; ADR-0144 open item 12 refuses them on a card of its own after this release.
2222

2323
⛔ Not released alone: this ships in the same release as the record currency mode, its write refusals and the per-row display.

‎packages/services/service-analytics/src/__tests__/record-currency-analytics.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ describe('[ADR-0144 M0-3] analytics over a record-currency amount', () => {
269269
expectRefused([{ name: 'total_usd', aggregate: 'sum', field: 'amount', currency: 'USD' }], 'total_usd');
270270
});
271271

272-
it('CONTROL: a measure currency over a fixed field is not judged, whatever its code (an ADR-0144 open item)', () => {
272+
it('CONTROL: a measure currency over a fixed field is not judged, whatever its code (ADR-0144 open item 12, its own card after R1)', () => {
273273
expect(compileRefusal([{ name: 'eur_as_jpy', aggregate: 'sum', field: 'amt_eur', currency: 'JPY' }])).toBeUndefined();
274274
expect(compileRefusal([{ name: 'eur', aggregate: 'sum', field: 'amt_eur', currency: 'EUR' }])).toBeUndefined();
275275
});
@@ -299,7 +299,7 @@ describe('[ADR-0144 M0-3] analytics over a record-currency amount', () => {
299299
);
300300
});
301301

302-
it('CONTROL: a derived measure over two different fixed codes is not judged (an ADR-0144 open item)', () => {
302+
it('CONTROL: a derived measure over two different fixed codes is not judged (ADR-0144 open item 12, its own card after R1)', () => {
303303
expect(compileRefusal([...base, { name: 'mixed', derived: { op: 'sum', of: ['usd', 'eur'] } }])).toBeUndefined();
304304
});
305305

‎packages/services/service-analytics/src/cube-record-currency-door.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
* `INVALID_FIELD` / 400 through `invalidMemberError` (ADR-0112), with the
5252
* column and its object attached, as the #21044 door attaches them: a verdict
5353
* about one member the request named. The words carry the prescription:
54-
* group by the code field. A consolidated total over the stored home-currency
55-
* amount is ADR-0144 D5's, which ships with the write-time projection.
54+
* group by the code field. A consolidated total aggregates the stored home
55+
* field instead (ADR-0144 D6), which the write-time projection (D5) fills.
5656
*/
5757

5858
import type { AnalyticsQuery } from '@objectstack/spec/contracts';

‎packages/services/service-analytics/src/measure-currency-coherence.ts‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@
1919
* explicit measure code or the tenant's. Non-monetary operands (a `count`)
2020
* are not compared, so an amount per invoice stays legal.
2121
*
22-
* ⛔ Not judged: the same two shapes over `fixed` / `dynamic` fields only — a
22+
* ⛔ Not judged here: the same two shapes over `fixed` fields only — a
2323
* measure `currency` contradicting a `fixed` field, a derived measure over two
24-
* different `fixed` codes. Refusing those would narrow what compiles today,
25-
* which neither ruling #27119 nor ADR-0144 decides; it is an ADR-0144 open item
26-
* for the maintainer.
24+
* different `fixed` codes. Refusing those narrows what compiles today, so
25+
* ADR-0144 open item 12 was ruled (6486427200 on #8345) to refuse them on a
26+
* card of its own after R1. A measure `currency` over a `dynamic` field stays
27+
* legal under either.
2728
*
2829
* ## The resolved currency, at compile
2930
*

0 commit comments

Comments
 (0)