Skip to content

Commit 7411f9b

Browse files
feat(spec, platform-objects): the standard unit table and the organization unit object sys_unit (ADR-0158 U1-U3) (#35581)
<!-- claude-projects-attribution: {"github_login":"os-bill"} --> _Requested by **Bill** · [project thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wgEpYDjddvdg2ymktFMmNiYa)_ Fixes #35488 Refs #35465 Refs #35466 Clause-②: yes (widening) Metadata-protocol: none ## 维护者速读 - 管理员在设置的「配置」下多一个「计量单位」页,可以登记本组织自己的单位(比如编码“BOX_12”、名称“12 只装箱”),所有成员都能看到它的名称;平台同时内置一张约四十个国际标准单位的表(公斤、米、升、小时、件、箱等),目前还没有任何字段使用它们。 - 这是“计量单位”第一期的地基,后面的数量字段声明单位、保存时校验单位、按单位显示等卡片都会用到它;同时定下了单位表收哪些单位、新对象归哪个包、以及删除后的单位编码能不能重新启用这三个待决问题。 - 只有组织管理员能新增或修改单位,成员只能查看;单位不能真正删除,只能停用,停用后不能恢复,同一编码也不能再建一次,以免旧数据的含义被改掉;这个改动可以直接撤回,因为还没有地方读取这些数据。 - 需要你做的:无。“停用后不能恢复、编码不能重新启用”这条规则由席位在合同评审中裁决。 ## 席位核对 (seat check) - **Ruled, executed as ruled.** U1 closed constant, not a `ValueDomainSchema` member (pinned: it keeps 3 members). U2 piece `H87`; `C62` and `EA` absent from the table and refused as org codes. U3 `sys_unit` org-owned, `organization_id` injected (census reach `in`, tenant field `organization_id`; the integration test reads it stamped), zero shipped rows (pinned on the manifest), org codes at least 4 characters or containing `_`. Members read it. L1: ratio written only by an org admin or owner, field history on every column, code and dimension refused on change. L2: one `label` column. U6/L4/OI10: `decimal_places` (0 to 12) on the row. - **One reading the seat should confirm.** L1 says "delete allowed" and OI2 says "delete: org admin"; the brief's OI11 recommendation and its example mechanism ("a soft-retire flag instead of a hard delete") are how this PR spells that delete: an org admin retires the row (`retired`, one way). There is no hard delete through the data API or Setup. If the seat reads L1 as requiring a physical delete, OI11 as recommended cannot hold and this needs a ruling. - **Settled here (ADR-0158 amended, dated notes).** OI1 membership: 41 codes over mass, length, area, volume, time, count and package, each ratio an exact decimal string with scale at most 12 and a named source. OI2: owner `platform-objects`, field list, grants. OI11: a deleted code stays retired; mechanism and pins listed in the ADR note. - **One file beyond the first claim (amended 7015603132).** `packages/cli/test/connect-agent-both-halves-wire.pin.test.ts`: Test Core 1/10 went red on `298bbb987` because that pin counts the Setup tree at 31, and the new `nav_units_of_measure` entry makes it 32. `c890bf191` sets both counts to 32 and asserts the entry is present. - **Fences held.** No `unitConfig`, no field key, no write-path membership check, no renderer, no #35498 setting. - **Deviation from the brief's wording.** The brief lists the dimension as "piece"; the table names it `count` (base `H87`, with `PR` and `DZN` as multiples), because a pair and a dozen are counts, not pieces. The reasoning is in the ADR OI1 note. ## What changes - `@objectstack/spec` (`@objectstack/spec/data`): `STANDARD_UNITS` (41 UN/ECE Rec 20 codes), `UNIT_DIMENSIONS`, `UNIT_DIMENSION_BASE_CODES` (`KGM`, `MTR`, `MTK`, `MTQ`, `SEC`, `H87`), `ORGANIZATION_UNIT_CODE_PATTERN`; `sys_unit` joins `PLATFORM_OBJECTS_BY_PACKAGE['platform-objects']`. The api-surface and export-origins files are regenerated. - `@objectstack/platform-objects`: `sys_unit` (code, label, dimension, ratio scale 12, decimal_places, retired), its rules (namespace format; code, dimension and retired one way; ratio required except on `package` and refused on `package`), the org-scoped unique key on `code`, `apiMethods` `get list create update bulk`, Setup → Configuration → Units of Measure, and the translation bundles (zh-CN translated; the other locales take the generator's English fill). - `@objectstack/plugin-security`: `member_default` reads `sys_unit` (no create, edit or delete). - `@objectstack/cli`: the organization-ownership inventory lists `sys_unit` as attributed. - `scripts/platform-object-tenancy-census.json` is regenerated (104 registered, 53 in reach). First files to read, by risk: 1. `packages/platform-objects/src/system/sys-unit.object.ts`, the `validations` block and `enable.apiMethods`: these carry L1 and OI11. 2. `packages/plugins/plugin-security/src/objects/default-permission-sets.ts`, the `sys_unit` row in `member_default`. 3. `packages/spec/src/data/standard-units.ts`, the ratio table. Two-minute check: `pnpm --filter @objectstack/plugin-security exec vitest run --maxWorkers=2 src/default-permission-sets.unit-of-measure.integration.test.ts` should print 14 passed. It boots a real stack and shows a member reading but refused writes, an admin writing, refused codes, immutability refusals, and re-creating a retired code refused with 409. ## Tests All tests below ran on head `298bbb987`, with the tree byte-identical to the commit. <details><summary>Package suites (under the verify lock, `set -e`)</summary> - `@objectstack/spec`: `src/data/standard-units.test.ts`, `src/data/api-methods-batch-conformance.test.ts`, `platform-object-names`, `platform-tool-names` and `value-domain`: Test Files 5 passed (5), Tests 67 passed (67). - `@objectstack/platform-objects` full suite: Test Files 125 passed (125), Tests 2092 passed (2092). - `@objectstack/cli` unit layer, inventory tests: Test Files 1 passed (1), Tests 26 passed (26). The integration layer is left to CI because the diff does not touch it. - `@objectstack/plugin-security` full suite: Test Files 282 passed (282), Tests 7050 passed, 45 skipped (7095). This includes the new `default-permission-sets.unit-of-measure.integration.test.ts` (14). - Typecheck: `spec`, `platform-objects` and `plugin-security` gave VERDICT command-exit 0. `cli` gave VERDICT command-exit 0. </details> ## Acceptance notes - **Engine-level delete is not refused.** `apiMethods` closes the data API, and Setup offers no Delete, but a delete issued to the engine below the REST door is not refused. No platform path issues one, and whether an automation could is not measured. This is recorded in the ADR OI11 note. - **`bulk` is granted.** The apiMethods batch conformance ratchet requires it wherever single-record writes are granted. A batch admits only granted child verbs, so a batched delete is still refused; this is pinned in `sys-unit.object.test.ts`. - **Locale fill.** Only zh-CN carries translated `sys_unit` strings. The other nine locales carry the generator's English fill (nav labels are translated in all eleven). - **Un-retire is refused.** This is a rule, not a grant, so an organization that retires a code by mistake cannot bring it back; it names a new code. This is the open question to the seat. ## Verification All readings below are on head `298bbb987`. <details><summary>Derived gate families (110) and the --ran reconciliation</summary> - `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 110 families from the tree at `298bbb987`. Each family was run, and the exit code was captured before any pipe: 110 exited 0, none exited non-zero. This includes `check:dual-build-cjs-loads` (124 entry points across 72 packages load) and `check:i18n-coverage` ("14 config(s), 423 baselined untranslated string(s), none new"). - `--ran` printed: "Run reconciliation — 110 derived, 110 run, 0 NOT-MEASURED, 0 UNRUN." </details> <details><summary>Overlap check</summary> - `node scripts/pm/overlap-check.mjs` against origin/main `cf6bb70e2d` merges cleanly, and so do PRs #35510 and #34223, which share files: "VERDICT clean exit 0". </details> <details><summary>Not measured locally</summary> - `check:dev-prereqs` (a local-only family) exits 1 with "The workspace is not built — 1 unmet precondition": 35 of 108 workspace packages, all in the UI tree, have no `dist/`. This is the container's build state, not this diff. It is recorded as NOT MEASURED. - The CLI `integration` layer, `test:repo`, and the repo-wide lint are left to CI. - Dogfood: n/a. The title has no `!`, and Clause-② is a widening. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01Utp6CajiB6BSQKWowy6YLB)_ <!-- signed: repo:objectstack#5 · os-bill · session_01Utp6CajiB6BSQKWowy6YLB --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent e91d967 commit 7411f9b

54 files changed

Lines changed: 2457 additions & 13 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@objectstack/spec': patch
3+
'@objectstack/platform-objects': patch
4+
'@objectstack/plugin-security': patch
5+
'@objectstack/cli': patch
6+
---
7+
8+
feat(spec, platform-objects): the standard unit table and the organization unit object `sys_unit` (ADR-0158 U1–U3)
9+
10+
Clause-②: yes (widening)
11+
Metadata-protocol: none
12+
13+
Units of measure, first release (ADR-0158 U7 R1). Nothing reads these tables yet: the unit declaration on a `number` field, the write-time membership check and the display of a quantity with its unit ship with their own cards. No field key ships here.
14+
15+
- **`@objectstack/spec`** (`@objectstack/spec/data`) exports `STANDARD_UNITS`, a closed table of 41 UN/ECE Recommendation 20 codes. Each code carries its dimension (`UNIT_DIMENSIONS`: `mass`, `length`, `area`, `volume`, `time`, `count`, `package`) and its ratio to the dimension's base unit (`UNIT_DIMENSION_BASE_CODES`: `KGM`, `MTR`, `MTK`, `MTQ`, `SEC`, `H87`), as an exact decimal string: `1 CODE = ratio × BASE`. Package codes (`XBX`, `XCT`, `XPX`, …) carry no ratio. The piece is `H87`; `C62` and `EA` are not members. `ORGANIZATION_UNIT_CODE_PATTERN` is the namespace of an organization's own codes (uppercase letters, digits and underscores, at least 4 characters or containing an underscore), which no standard code can match. `PLATFORM_OBJECTS_BY_PACKAGE['platform-objects']` gains `sys_unit`. The table is not a value domain: `ValueDomainSchema` keeps its three members.
16+
- **`@objectstack/platform-objects`** registers `sys_unit` (Setup → Configuration → Units of Measure), an organization's own units: `code`, `label`, `dimension`, `ratio` (scale 12; required on every dimension but `package`, refused on `package`), `decimal_places` (a display default) and `retired`. It is organization-owned behind the tenant wall and ships no rows. A code outside the organization namespace is refused, the code is unique within the organization, and the code and dimension cannot change after create. A unit is retired instead of deleted, and retiring cannot be undone, so a code is never created again with another meaning; the data API serves no delete on it. Every column carries field history.
17+
- **`@objectstack/plugin-security`**: `member_default` reads `sys_unit`, so a unit's label displays to every member; organization administrators write it through their existing grant.
18+
- **`@objectstack/cli`**: the organization-ownership inventory lists `sys_unit` as attributed to its organization.

‎docs/adr/0158-units-of-measure-standard-unit-table-org-units-quantity-unit-declaration-base-quantity.md‎

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,8 @@ U7 is the ruled plan; this table restates it and adds nothing.
435435
first, and only an organization admin edits a ratio, audited.
436436
- **A unit row's code and dimension cannot change after create** (L1, settled by the seat). A deleted code can be
437437
created again with another dimension; what that does to resting rows is [Open item](#open-items) 11.
438+
*Note (2026-11-19):* Open item 11 is settled: a deleted code stays retired, and the retired row keeps its code, so it
439+
is never created again.
438440
- **A deleted org unit leaves its rows readable** (L1, settled by the seat): they keep their code and stored
439441
conversion and show the code without a label, and a new save with that code is refused. Which writes count as such
440442
a save is [Open item](#open-items) 9.
@@ -469,11 +471,63 @@ amended with each answer, the way ADR-0144's open items were.
469471

470472
1. **U1's membership.** Which Rec 20 common codes the curated subset holds, each one's dimension and ratio, and which
471473
package codes it lists. U2 fixes one code (`H87`) and refuses two (`C62`, `EA`).
474+
*Note (2026-11-19):* settled on the `sys_unit` card
475+
([#35488](https://github.com/objectstack-ai/objectstack/issues/35488)), under the owning seat's contract review; the
476+
table is `packages/spec/src/data/standard-units.ts#STANDARD_UNITS`, 41 codes. Seven dimensions, the closed
477+
vocabulary `UNIT_DIMENSIONS`; each ratio dimension has a base unit (`UNIT_DIMENSION_BASE_CODES`), whose ratio is
478+
`1`. The ratio reads `1 CODE = ratio × BASE`, so a quantity converts to the base unit by multiplying it by the
479+
ratio. Every ratio is a decimal string of at most 12 places, exact by definition:
480+
481+
| Dimension | Base | Members, with ratio |
482+
|:--|:--|:--|
483+
| `mass` | `KGM` | `GRM` 0.001, `MGM` 0.000001, `TNE` 1000, `LBR` 0.45359237, `ONZ` 0.028349523125 |
484+
| `length` | `MTR` | `MMT` 0.001, `CMT` 0.01, `KMT` 1000, `INH` 0.0254, `FOT` 0.3048, `YRD` 0.9144 |
485+
| `area` | `MTK` | `CMK` 0.0001, `MMK` 0.000001, `FTK` 0.09290304 |
486+
| `volume` | `MTQ` | `LTR` 0.001, `MLT` 0.000001, `GLL` 0.003785411784 |
487+
| `time` | `SEC` | `MIN` 60, `HUR` 3600, `DAY` 86400, `WEE` 604800 |
488+
| `count` | `H87` | `PR` 2, `DZN` 12 |
489+
| `package` | none | `XBG`, `XBE`, `XBO`, `XBX`, `XCT`, `XCS`, `XCR`, `XDR`, `XPK`, `XPX`, `XRO`, `XSA`; no ratio |
490+
491+
Sources: the SI prefixes (`GRM`, `MGM`, `MMT`, `CMT`, `KMT`, `CMK`, `MMK`, `MLT`) and the units accepted for use with
492+
the SI (`TNE`, `LTR`, `MIN`, `HUR`, `DAY`), SI Brochure 9th edition, Tables 7 and 8; the international yard and
493+
pound of 1959 (`LBR`, `ONZ` as 1/16 lb, `INH`, `FOT`, `YRD`, `FTK`); the United States gallon of 231 cubic inches
494+
(`GLL`); Recommendation 20's own factor (`WEE`, `PR`, `DZN`). Recommendation 20 prints `ONZ` and `GLL` rounded
495+
(2.834 952 × 10⁻² kg, 3.785 412 × 10⁻³ m³); the table holds the exact values. Left out: hectare (`HAR`), which
496+
Recommendation 20 marks deprecated; month (`MON`) and year (`ANN`), whose Recommendation 20 factors rest on a
497+
365.25-day year that no calendar month or year equals; and every affine unit (U7 R2). The dimension is named
498+
`count`, not `piece`: a pair and a dozen are counts measured in pieces, as a gram is a mass measured in kilograms.
499+
Codes, names, statuses and factors were read from the Recommendation 20 annex (the `datasets/unece-units-of-measure`
500+
mirror, data package 17.0) and the package codes from the Peppol BIS Billing 3.0 list `UNECERec20` ("including
501+
Recommendation 21 codes - prefixed with X", Revision 11e). The organization namespace of U3 is the same file's
502+
`ORGANIZATION_UNIT_CODE_PATTERN`: uppercase letters, digits and underscores, starting with a letter or a digit, at
503+
most 32 characters, at least 4 long or containing an underscore. The table widens only by an amendment of this
504+
record.
472505
2. **`sys_unit`'s owning package, its fields and its write grants.** Its fields beyond what U3, U6, U7 R2, L1 and L2
473506
name, against [ADR-0029](./0029-kernel-object-ownership-and-platform-objects-decomposition.md) D1, D3 and D6.
474507
ADR-0144 D3 left `sys_exchange_rate`'s owner to its card the same way. Its write grants: who creates, relabels and
475508
deletes an org unit. The seat's L1 settlement names only who edits a ratio, and a delete is the act L1 attaches
476509
refusals to.
510+
*Note (2026-11-19):* settled on the `sys_unit` card
511+
([#35488](https://github.com/objectstack-ai/objectstack/issues/35488)), under the owning seat's contract review,
512+
answering [#35465](https://github.com/objectstack-ai/objectstack/issues/35465).
513+
- **Owner: `@objectstack/platform-objects`**
514+
(`packages/platform-objects/src/system/sys-unit.object.ts#SysUnit`), registered in its first manifest beside
515+
`sys_exchange_rate`. ADR-0029 D3 asks for one owner per object, and this is the only one. Its readers are the
516+
engine's write-time membership check (U5) and the display of a quantity with its unit, present in every
517+
composition that can write or read a record, so it has no on/off boundary of its own (D2) and no capability plugin
518+
(D1) would own it; it joins the per-organization reference table ADR-0144's Open item 11 settled into the same
519+
package. D6's decomposition, when it comes, moves both together.
520+
- **Fields:** `code` (text, at most 32, required, unique per organization, in U3's namespace, immutable after
521+
create); `label` (text, at most 80, required: L2's one org-written label); `dimension` (select over U1's closed
522+
vocabulary, required, immutable after create); `ratio` (number, scale 12, precision 24, at least 10⁻¹², required
523+
on every dimension but `package` and refused on `package`, U1's shape; editable, an edit affecting later writes
524+
only, L1); `decimal_places` (whole number 0 to 12, optional, the display default of U6, never a storage rule, L4);
525+
`retired` (boolean, default false, Open item 11). `organization_id` is injected (U3). Every authored column
526+
carries field history.
527+
- **Grants:** every member reads (`member_default` names `sys_unit`, read only; the seat's first U3 note). An
528+
organization owner or administrator creates, relabels, edits a ratio and retires a unit, through
529+
`organization_admin`'s wildcard grant, the way `sys_exchange_rate` is written; no member holds a write bit. No one
530+
deletes: retiring is the delete (Open item 11).
477531
3. **The codes of the new refusals**: U5's membership refusal, U7 R1's aggregate refusal, U7 R2's refusal of a write
478532
with no ratio and no factor, and the refusal of a new save with a deleted org unit's code (L1, settled by the
479533
seat). [ADR-0112](./0112-error-code-vocabulary-and-ledger.md) sets their codes and envelope.
@@ -539,6 +593,23 @@ amended with each answer, the way ADR-0144's open items were.
539593
record declines a lock for the ratio only, and L1 rules out scanning for "used", so a use check cannot close it.
540594
For the `sys_unit` card: either a deleted code stays retired, or re-creation is admitted and its consequence is
541595
stated. Not settled here.
596+
*Note (2026-11-19):* settled on the `sys_unit` card
597+
([#35488](https://github.com/objectstack-ai/objectstack/issues/35488)), under the owning seat's contract review,
598+
answering [#35466](https://github.com/objectstack-ai/objectstack/issues/35466): **a deleted code stays retired.**
599+
L1's delete is spelled as a one-way `retired` flag on the row. The row is never removed, so it keeps holding the
600+
organization-scoped unique key on `code`, and the same code can never be created again with another dimension,
601+
ratio or label; the hazard above cannot arise. The mechanism, each part pinned: the data API serves no delete on
602+
`sys_unit`, single or batched (`enable.apiMethods` is `get`, `list`, `create`, `update`, `bulk`, and a batch admits
603+
only a granted verb), Setup offers no Delete
604+
(`userActions.delete: false`), and a rule refuses clearing `retired` once set. Rows resting on a retired unit keep
605+
their code and stored conversion, as L1 states for a deleted unit. Two consequences are left to their cards: the
606+
membership card (U5, [Open item](#open-items) 9) refuses a new save with a retired code, as L1's delete bullet
607+
requires; and the display card says whether a resting row shows the retired unit's label, which stays on file, or
608+
the bare code that L1 wrote for a deleted unit. Re-creation was not admitted: no measured reason favoured it, and
609+
an organization that needs the code's old meaning back has the retired row's history, while one that needs a new
610+
meaning names a new code. Not closed by this mechanism: `apiMethods` governs the data API, so a delete issued to the
611+
engine directly, below that door, is not refused by it; no platform path issues one, and whether an automation
612+
could is not measured here.
542613
12. **R1's backfill and its raw aggregates.** The backfill mirrors `os migrate record-currency-codes` loosely. That
543614
door writes one code, the operator's, into the rows whose code is blank
544615
(`packages/objectql/src/record-currency-backfill.ts#backfillRecordCurrencyCodes`); the unit door rewrites free

‎packages/cli/src/utils/organization-ownership-inventory.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,10 @@ export const ORGANIZATION_OWNERSHIP_INVENTORY: readonly InventoryEntry[] = [
851851
// Exchange rates (`@objectstack/platform-objects`, #27185): an organization's
852852
// administrators author its own rate table; no parent row anchors a rate.
853853
{ object: 'sys_exchange_rate', census: PMAIN, fate: 'attribution', citation: `${CENSUS_MAIN} (in reach, added since the first census); ${D10_SINGLE}`, anchors: [] },
854+
// Units of measure (`@objectstack/platform-objects`, ADR-0158 U3): an
855+
// organization's administrators author its own units; the platform ships no
856+
// row, and no parent row anchors a unit.
857+
{ object: 'sys_unit', census: PMAIN, fate: 'attribution', citation: `${CENSUS_MAIN} (in reach, added since the first census); ${D10_SINGLE}`, anchors: [] },
854858
// The recycle bin (`@objectstack/platform-objects`, ADR-0148, #30237): the
855859
// engine writes each entry with the organization of the record it holds,
856860
// else the deleting context's. A NULL row comes only from a delete with

‎packages/cli/test/connect-agent-both-halves-wire.pin.test.ts‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,16 +274,19 @@ describe('#17647 — Connect-an-Agent visibility: BOTH halves, over the wire', (
274274
// Configuration; 32 until the recycle bin entry, `nav_recycle_bin`,
275275
// joined Configuration (#30239); 33 until objectstack#34724 retired
276276
// the Packaged Actions entry, `nav_packaged_actions`, the one entry
277-
// `group_apps` held here, so that group collapses too.)
277+
// `group_apps` held here, so that group collapses too; 31 until the
278+
// Units of Measure entry, `nav_units_of_measure`, joined Configuration
279+
// (#35488).)
278280
// `nav_settings_branding` is not among them, and not because of a
279281
// tenancy wall (this harness boots none): since #24766 it is
280282
// contributed by `@objectstack/service-settings` together with the
281283
// `branding` namespace, offered only where no organization wall stands,
282284
// and this harness composes platform-objects and the MCP bundle alone.
283-
expect(allowedIds).toHaveLength(31);
285+
expect(allowedIds).toHaveLength(32);
284286
expect(allowedIds).not.toContain('nav_packaged_actions');
285287
expect(allowedIds).toContain('nav_settings_access_policy');
286288
expect(allowedIds).toContain('nav_recycle_bin');
289+
expect(allowedIds).toContain('nav_units_of_measure');
287290
expect(allowedIds).not.toContain('nav_settings_branding');
288291
// The two per-user stores are reached from the User record page, not
289292
// from Setup's menu (#23803).
@@ -306,8 +309,8 @@ describe('#17647 — Connect-an-Agent visibility: BOTH halves, over the wire', (
306309
expect(withAccountHalf.statusCode).toBe(200);
307310
expect(withoutAccountHalf.statusCode).toBe(200);
308311
expect(navIds(withAccountHalf.body?.item)).toEqual(navIds(withoutAccountHalf.body?.item));
309-
// 31: the composition the count in the test above states.
310-
expect(navIds(withAccountHalf.body?.item)).toHaveLength(31);
312+
// 32: the composition the count in the test above states.
313+
expect(navIds(withAccountHalf.body?.item)).toHaveLength(32);
311314

312315
// The mechanism behind the invariance, asserted rather than assumed:
313316
// the bundle aims exactly one contribution at `setup` and one at

‎packages/platform-objects/scripts/i18n-extract.config.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ import {
203203
SysPlatformSettingAudit,
204204
SysMigration,
205205
SysExchangeRate,
206+
SysUnit,
206207
} from '../src/system/index.js';
207208

208209
// ── Existing Setup app + dashboards + translations ────────────────────────
@@ -360,6 +361,7 @@ const config: ObjectStackDefinition = defineStack({
360361
SysPlatformSettingAudit,
361362
SysMigration,
362363
SysExchangeRate,
364+
SysUnit,
363365
] as any,
364366

365367
apps: [SETUP_APP, STUDIO_APP, ACCOUNT_APP] as any,

‎packages/platform-objects/src/apps/setup-nav.contributions.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@ export const SETUP_NAV_CONTRIBUTIONS: NavigationContribution[] = [
134134
// `requiredPermissions`: the object grant decides who reads and writes
135135
// (organization admins), and Setup itself already needs `setup.access`.
136136
{ id: 'nav_exchange_rates', type: 'object', label: 'Exchange Rates', objectName: 'sys_exchange_rate', viewName: 'all_rates', icon: 'arrow-right-left' },
137+
// [ADR-0158 U3] The organization's own units of measure, beside the
138+
// exchange rates as the other per-organization reference table. No
139+
// `requiredPermissions`: the object grant decides (every member reads,
140+
// organization admins write), and Setup itself already needs `setup.access`.
141+
{ id: 'nav_units_of_measure', type: 'object', label: 'Units of Measure', objectName: 'sys_unit', viewName: 'all_units', icon: 'ruler' },
137142
{ id: 'nav_settings_company', type: 'url', label: 'Company', url: '/apps/setup/system/settings/company', icon: 'building-2' },
138143
// `nav_settings_branding` is contributed by `@objectstack/service-settings`
139144
// with the `branding` namespace, which is offered only where no

0 commit comments

Comments
 (0)