Count stock from the container the compound comes in - #136
Merged
suskozaver merged 1 commit intoSep 17, 2026
Merged
Conversation
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.
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
stockFortakes 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.needsReconstitutionwas 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
routeHasSitelike 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 --noEmitclean,npx next lintclean, 1713 tests pass (4 new).