fix(medications): separate the two container dates and name the ampoule caveat

The row printed the opening date and the printed expiry with nothing between
them. It carries the same middle dot the unit figures use.

The docblock now says out loud what the enum cannot distinguish: AMPOULE
covers both a punctured multi-dose vial, where the post-opening window is
real, and a carton of single-use glass ampoules, where it is not. The kind is
never auto-selected, so picking it is a statement about an opened container,
and the opening date is editable when it turns out not to be.
This commit is contained in:
Marc-André Bombeck committed 2026-07-26 18:00:08 +02:00
1 parent a4ff11f10d
commit fd1464867d
3 files changed
+23 -1

No files matched your search

@@ -124,6 +124,22 @@ describe("<InventorySection> — item-row dates", () => {
expect(html).toContain("Haltbar bis 01.06.2027");
});
it("separates the two dates when the row carries both", () => {
seedItems([
{
...BASE,
firstUseAt: "2026-06-12T00:00:00.000Z",
printedExpiry: "2027-06-01T00:00:00.000Z",
},
]);
const html = render(
<InventorySection medicationId="med-1" unitsPerDose={1} />,
);
expect(html).toContain("Geöffnet 12.06.2026");
expect(html).toContain("Haltbar bis 01.06.2027");
expect(html).toContain("<span>·</span>");
});
it("shows no date line when neither date is recorded", () => {
// Absence reads as absence — no placeholder, no invented date.
seedItems([{ ...BASE, firstUseAt: null, printedExpiry: null }]);
@@ -505,6 +505,7 @@ export function InventorySection({
})}
</span>
)}
{item.firstUseAt && item.printedExpiry && <span>·</span>}
{item.printedExpiry && (
<span>
{t("medications.detail.bestand.expiresOn", {
@@ -37,7 +37,12 @@
* - AMPOULE — the member a punctured injectable reservoir (ampoule or
* multi-dose vial) lands on; there is no separate VIAL member. Same
* physical fact as the pen: the barrier is broken and the contents
* are exposed.
* are exposed. The enum cannot tell that reservoir apart from a
* carton of single-use glass ampoules, where the clock would be
* wrong for the same reason it was wrong on a blister; the kind is
* never auto-selected, so choosing it is a deliberate statement
* about a container that was opened, and the opening date is
* editable when it turns out not to be.
* - BLISTER — every tablet sits in its own sealed foil cavity.
* Pressing out tablet 1 does nothing to tablets 2..n. The carton
* expiry is the only expiry.