test(vaccinations): reconcile the structural guards with the new surfaces

- freeze the booster-mint and upload-suggestion routes into the sharing
  surface guard with their why sentences; delegable-write and mutation
  inventories move by the two routes they add
- inventory the two new routes as module-exempt data routes (SURFACE-gated,
  like the medications posture)
- give the booster-plan audit action its own owner-facing verb in six locales
- register the dose delete as a destructive control; route the vaccination
  success toasts through the outcome module
- move the report leaf counts (structured 15→16, all 92→93) and the history
  group count in the panel; regenerate the OpenAPI selection bound
- seed the immunization rows in the export-route mock so the aggregator no
  longer throws for a fully-selected report
This commit is contained in:
Marc-André Bombeck committed 2026-08-08 21:43:28 +02:00
1 parent 4db70d3eb1
commit 958f3bc50a
20 files changed
+147 -19

No files matched your search

@@ -193,7 +193,7 @@ describe("<HealthRecordExportPanel> — the first run", () => {
expect(groupChip(html, "labs")).toBe("0/1");
expect(groupChip(html, "medications")).toBe("0/4");
// ALLERGIES, ILLNESS_EPISODES and now VISITS.
expect(groupChip(html, "history")).toBe("0/3");
expect(groupChip(html, "history")).toBe("0/4");
expect(groupChip(html, "cardio")).toBe("0/14");
expect(groupChip(html, "activity")).toBe("0/8");
expect(groupChip(html, "sleepRecovery")).toBe("0/16");
@@ -19,6 +19,7 @@
import { useState } from "react";
import { toast } from "sonner";
import { toastWrittenOutcome } from "@/components/outcome/outcome-toast";
import {
AlertDialog,
AlertDialogAction,
@@ -84,7 +85,7 @@ export function BoosterMintPrompt({
id: record.id,
body: { intervalMonths: months, label: label.trim() || defaultLabel },
});
toast.success(t("vaccinations.booster.planned"));
toastWrittenOutcome("success", t("vaccinations.booster.planned"));
} catch (err) {
toast.error(
err instanceof Error ? err.message : t("vaccinations.booster.failed"),
@@ -21,6 +21,7 @@ import { Check, Syringe } from "lucide-react";
import { toast } from "sonner";
import { Button } from "@/components/ui/button";
import { toastWrittenOutcome } from "@/components/outcome/outcome-toast";
import { useFormatters, useTranslations } from "@/lib/i18n/context";
import {
useLinkDocumentToVaccination,
@@ -68,7 +69,7 @@ export function VaccinationDocumentSuggestion({
{
onSuccess: () => {
setLinkedId(candidate.id);
toast.success(t("vaccinations.suggestion.linked"));
toastWrittenOutcome("success", t("vaccinations.suggestion.linked"));
},
onError: () => toast.error(t("vaccinations.suggestion.failed")),
},
@@ -28,6 +28,7 @@ import {
} from "@/components/ui/alert-dialog";
import { Button } from "@/components/ui/button";
import { ResponsiveSheet } from "@/components/ui/responsive-sheet";
import { toastWrittenOutcome } from "@/components/outcome/outcome-toast";
import { useTranslations } from "@/lib/i18n/context";
import { useVaccinationMutations, type Vaccination } from "./use-vaccinations";
import {
@@ -73,11 +74,11 @@ export function VaccinationSheet({
try {
if (isEdit) {
await update.mutateAsync({ id: vaccination.id, body });
toast.success(t("vaccinations.updated"));
toastWrittenOutcome("success", t("vaccinations.updated"));
onOpenChange(false);
} else {
const created = await create.mutateAsync(body);
toast.success(t("vaccinations.created"));
toastWrittenOutcome("success", t("vaccinations.created"));
onOpenChange(false);
onCreated?.(created);
}