Skip to content

Count stock from the container the compound comes in - #136

Merged
suskozaver merged 1 commit into
ArunNGun:betafrom
suskozaver:stock-counts-the-right-container
Sep 17, 2026
Merged

suskozaver merged 1 commit into
ArunNGun:betafrom
suskozaver:stock-counts-the-right-container

Conversation

@suskozaver

Copy link
Copy Markdown
Collaborator

Reported from the Today page: Stock: 0 doses for a compound with a full pack of sixty tablets on the shelf, and an injection site printed beside a dose that was swallowed.

The zero

stockFor takes a container and defaults it to "vial", which was right when a vial was the only thing there was. Spray bottles added the parameter; tablets added a third value for it. All three call sites went on omitting it, so every figure on every screen counted vials and nothing else.

Nothing failed and nothing warned. The zero looked like an empty shelf rather than like a question nobody asked.

The three now pass containerForDose, the same rule the log form uses to decide what a dose comes out of. needsReconstitution was the same sentence one line further down: with the container finally arriving it stops being true for a pack, which has nothing to make up.

The site

One more reader left over from #135. The last-dose line on Today now asks routeHasSite like the rest.

Written down

06-traps.md: when a parameter gains a value, grep the call sites that omit it. The ones that pass something have been thought about; the ones relying on the default have not, and they never appear in a search for the parameter's name.

Checks

npx tsc --noEmit clean, npx next lint clean, 1713 tests pass (4 new).

Today read "Stock: 0 doses" for a compound with a full pack of sixty
tablets on the shelf, and showed an injection site for the last dose,
which was swallowed.

stockFor takes a container and defaults it to a vial, which was right
when a vial was the only thing there was. Spray bottles added the
parameter, tablets added a third value for it, and all three call
sites went on omitting it. Every figure on every screen counted vials
and nothing else. Nothing failed and nothing warned; the zero looked
like an empty shelf rather than like a question nobody asked.

The three now pass containerForDose, the same rule the log form uses
to pick what a dose comes out of. needsReconstitution was the same
sentence one line down: with the container finally arriving it stops
being true for a pack, which has nothing to make up.

The site on the last-dose line was one more reader left over from the
previous fix. It now asks routeHasSite like the others.

Written into 06-traps.md: when a parameter gains a value, grep the
call sites that omit it. The ones that pass something have been
thought about; the ones relying on the default have not, and they do
not appear in a search for the parameter's name.
@vercel

vercel Bot commented Sep 17, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Arun's projects Team on Vercel.

A member of the Team first needs to authorize it.

@suskozaver
suskozaver merged commit 3a86e21 into ArunNGun:beta Sep 17, 2026
1 of 2 checks passed
@suskozaver
suskozaver deleted the stock-counts-the-right-container branch September 17, 2026 19:01
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