Skip to content

Commit 7e7c2dc

Browse files
Demo staff names are spelled once, in keys.ts (#192)
Fixes #191: objectstack.config.ts takes the legal head's and finance controller's demoStaff names from src/data/keys.ts, so a rename cannot silently drop seeded reviews. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017nzWFRUo2U7evMkPdVniAn
1 parent 494fb35 commit 7e7c2dc

2 files changed

Lines changed: 19 additions & 15 deletions

File tree

‎objectstack.config.ts‎

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { allEmailTemplates } from './src/email-templates/index.js';
77
import * as profiles from './src/profiles/index.js';
88
import { CLM_POSITION, ClmPositions, ClmSharingRules } from './src/sharing/index.js';
99
import { clmSeeds, demoSeedRequested } from './src/data/index.js';
10-
import { CONTRACT_OWNERS, LEGAL_OWNERS } from './src/data/keys.js';
10+
import { CONTRACT_OWNERS, FINANCE_CONTROLLER, LEGAL_HEAD, LEGAL_OWNERS } from './src/data/keys.js';
1111
import * as apps from './src/apps/index.js';
1212
import * as datasets from './src/datasets/index.js';
1313
import * as dashboards from './src/dashboards/index.js';
@@ -272,15 +272,19 @@ export default defineStack({
272272
// password (`os dev --admin-password`, default `admin123`) — the platform
273273
// refuses a `password` key, so no credential is committed here.
274274
//
275-
// - The business requesters and the two counsel are named by the SAME
276-
// constants the fixture deals rows by (`src/data/keys.ts`), so a name here
275+
// - Every account the fixture deals rows to BY NAME is named here by the
276+
// SAME constant the fixture uses (`src/data/keys.ts`), so a name here
277277
// cannot drift from the `owner_id` / `legal_owner` / `owner` /
278-
// `decided_by` values that resolve against it. A requester holds no
279-
// position: `clm_requester` is every member's default set (`isDefault`).
280-
// - The other six positions are staffed once each, so every rung of the
278+
// `decided_by` / `reviewer` values that resolve against it: the business
279+
// requesters, the two counsel, the head of legal and the finance
280+
// controller. `reviewer` is `required`, so a drift there would not land
281+
// NULL — the loader would drop every review dealt to the account and the
282+
// seed would still report success. A requester holds no position:
283+
// `clm_requester` is every member's default set (`isDefault`).
284+
// - The other positions are staffed once each, so every rung of the
281285
// approval ladder and every audience group of §05 has someone to sign in
282-
// as. The fixture names none of them; they are reached through the
283-
// position, not by name.
286+
// as. The fixture names none of the remaining four; they are reached
287+
// through the position, not by name.
284288
//
285289
// ⚠️ A line manager cannot be declared: a `demoStaff` entry carries a
286290
// `position` and `permissionSets` and nothing else, and `sys_user.manager_id`
@@ -290,8 +294,8 @@ export default defineStack({
290294
? [
291295
...CONTRACT_OWNERS.map((name, i) => ({ name, email: `requester${i + 1}@example.com` })),
292296
...LEGAL_OWNERS.map((name, i) => ({ name, email: `counsel${i + 1}@example.com`, position: CLM_POSITION.legalCounsel })),
293-
{ name: 'Head of Legal', email: 'legal.head@example.com', position: CLM_POSITION.legalHead },
294-
{ name: 'Finance Controller', email: 'finance@example.com', position: CLM_POSITION.financeController },
297+
{ name: LEGAL_HEAD, email: 'legal.head@example.com', position: CLM_POSITION.legalHead },
298+
{ name: FINANCE_CONTROLLER, email: 'finance@example.com', position: CLM_POSITION.financeController },
295299
{ name: 'Executive', email: 'executive@example.com', position: CLM_POSITION.executive },
296300
{ name: 'General Manager', email: 'gm@example.com', position: CLM_POSITION.generalManager },
297301
{ name: 'Records Manager', email: 'records@example.com', position: CLM_POSITION.recordsManager },

‎src/data/keys.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -315,11 +315,11 @@ export const deviationDeciderOf = (deviation: DeviationPlan): string | null =>
315315
* The head of legal and the finance controller, as the ACCOUNT NAMES the
316316
* loader resolves `clm_review.reviewer` against.
317317
*
318-
* ⚠️ These two MIRROR the `name` of their `demoStaff` entries in
319-
* `objectstack.config.ts`, which spells them as literals rather than from
320-
* here. `reviewer` is `required: true`, so a drift between the two is not a
321-
* NULL but a lost row: the loader refuses every review that names an account
322-
* nobody carries, and the seed reports success for the rest.
318+
* These two are the `name` of their `demoStaff` entries in
319+
* `objectstack.config.ts`, which spells them from here, so a rename moves
320+
* both (issue #191). `reviewer` is `required: true`, which is why they must
321+
* never drift: the loader refuses every review that names an account nobody
322+
* carries, and the seed reports success for the rest.
323323
*/
324324
export const LEGAL_HEAD = 'Head of Legal';
325325
export const FINANCE_CONTROLLER = 'Finance Controller';

0 commit comments

Comments
 (0)