Skip to content

Record a whole bar delivery note on one sheet - #1705

Merged
MattA-Official merged 6 commits into
unified/mainfrom
claude/admin-ux-delivery-note
Oct 28, 2026
Merged

MattA-Official merged 6 commits into
unified/mainfrom
claude/admin-ux-delivery-note

Conversation

@MattA-Official

Copy link
Copy Markdown
Member

Requested by Matt · project thread

The third proposal from the admin UX audit (report), after #1703 and #1704. Matt approved it on 25 October. It is decision record 0254.

What changes

  • The stock register gains Record a delivery note. It opens one sheet listing every active stocked item, with a find box, a container count and an optional cost per line.
  • Fill from the order list puts each item's suggested order (or its shortfall) into its count.
  • Saving posts every filled line to the new POST /api/admin/bar/deliveries, which writes them as ordinary delivery movements in one db.batch. The route reads the catalogue with one fixed statement (0006) and refuses the whole note if any line names a retired, unknown or repeated item.
  • deliveryNoteForm and MAX_DELIVERY_LINES live in shared/utils/bar.ts. The route is registered in the audit-coverage list, since stock movements are their own record.

Docs

  • Bar stock: a new "A whole delivery note" section. Order list: how it feeds the sheet.
  • ADR 0254, its index row, and the F-114 amendment.

Checks

  • Run locally on this branch: lint, check (7/7), typecheck, typecheck:bun and the unit tests.
  • Added: unit tests for the form schema, and the e2e "a delivery note records many items at once (0254)" in tests/e2e/bar-catalogue.test.ts. CI is the check for the e2e suite.

Generated by Claude Code

The stock register gains Record a delivery note: every active item on one
sheet, a count and a cost per line, filled from the order list if wanted,
saved as one batch of ordinary delivery movements. The route reads the
catalogue with one fixed statement and refuses retired, unknown or repeated
items for the whole note.
@MattA-Official MattA-Official self-assigned this Oct 28, 2026
…note

# Conflicts:
#	docs/decisions/README.md
Every view shares one cookie jar, so a session written into document.cookie
could be overwritten before the case's first visit, and the console then sent
the officer to /sign-in. The suite now grants a registered member ADMIN and
signs each case in with signInView, as every other suite does.

Copy link
Copy Markdown
Member Author

e2e (6/10) failed in shared-ids.test.ts "the console filters…": the console page landed on /sign-in after merging unified/main. It is the same failure seen on #1707, and it is not from this PR, which touches neither sign-in nor that suite. The fix is #1709, which signs that suite in through the form instead of writing the session cookie. I've cherry-picked it here (2ad2095). It will no-op once #1709 merges.


Generated by Claude Code

Copy link
Copy Markdown
Member Author

e2e (9/10) failed one case, "a register opens on the day (G-115 criterion 1) > the button itself is disabled before the day, and enabled on it", with Chrome killed by signal 5 (467 pass, 1 fail). That is a browser crash, not an assertion. The same crash has been seen on unrelated PRs (#1620, #1673), and this diff does not touch registers. No fix exists for it yet. Re-running the failed job once.


Generated by Claude Code

Copy link
Copy Markdown
Member Author

The re-run of e2e (9/10) passed the register case but failed a different one: passes.test.ts "a chosen request is marked, named in Due now…". It showed "Your sign-in has ended" on /box-office/desk-passes for a freshly signed-in Front of House Manager. That is the long-running flake also seen on #1704 and #1708 today, and this diff does not touch passes or sign-in.

No fix exists yet. I looked at desk-passes.vue: it loads the first pass type's requests with plain $fetch during server rendering, without the officer's session. I could not show that this causes the failure (the page renders fine locally), so I'm not changing it here. The next update from unified/main will run CI again.


Generated by Claude Code

…note

# Conflicts:
#	docs/decisions/README.md
The first case runs on a dev server that has just booted, and under bun's
5-second default it timed out before the home page had compiled.

Copy link
Copy Markdown
Member Author

I've also cherry-picked #1710 here (5573b25). It gives shells.test.ts the usual two-minute case timeout, since its first case has been timing out at 5 seconds on a just-booted server across these PRs. It no-ops once #1710 merges.


Generated by Claude Code

…note

# Conflicts:
#	docs/decisions/README.md
@MattA-Official
MattA-Official merged commit c33b180 into unified/main Oct 28, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant