diff --git a/src/components/medications/__tests__/inventory-section-dates.test.tsx b/src/components/medications/__tests__/inventory-section-dates.test.tsx index b52cbcff2..a35c71485 100644 --- a/src/components/medications/__tests__/inventory-section-dates.test.tsx +++ b/src/components/medications/__tests__/inventory-section-dates.test.tsx @@ -124,6 +124,22 @@ describe(" — 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( + , + ); + expect(html).toContain("Geöffnet 12.06.2026"); + expect(html).toContain("Haltbar bis 01.06.2027"); + expect(html).toContain("·"); + }); + 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 }]); diff --git a/src/components/medications/sections/inventory-section.tsx b/src/components/medications/sections/inventory-section.tsx index aac3bba24..6473f207f 100644 --- a/src/components/medications/sections/inventory-section.tsx +++ b/src/components/medications/sections/inventory-section.tsx @@ -505,6 +505,7 @@ export function InventorySection({ })} )} + {item.firstUseAt && item.printedExpiry && ·} {item.printedExpiry && ( {t("medications.detail.bestand.expiresOn", { diff --git a/src/lib/medications/inventory/state-machine.ts b/src/lib/medications/inventory/state-machine.ts index ed6fd92f5..10b49884c 100644 --- a/src/lib/medications/inventory/state-machine.ts +++ b/src/lib/medications/inventory/state-machine.ts @@ -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.