feat: add inhaler and injection package types

Closes #558

- add inhaler and injection as supported medication package types
- align refill, planner, dashboard, report, export, and notification wording for the new discrete package types
- include the validated CI repair for formatting and dashboard label parity
This commit is contained in:
Daniel Volz
2026-05-11 21:29:59 +02:00
committed by GitHub
parent 26e9b39f47
commit c5c75f65e4
32 changed files with 584 additions and 141 deletions
+11 -1
View File
@@ -48,10 +48,20 @@ export function isContainerPackage(packageType?: string): boolean {
export function getPlannerUnit(
packageType: string | undefined,
tr: { common: { units: string; ml: string; pills: string } }
tr: { common: { units: string; ml: string; pills: string; puffs?: string; injections?: string } }
): string {
const unitKind = getPlannerUnitKind(packageType);
if (unitKind === "units") return tr.common.units;
if (unitKind === "ml") return tr.common.ml;
if (unitKind === "puffs") return tr.common.puffs ?? tr.common.pills;
if (unitKind === "injections") return tr.common.injections ?? tr.common.pills;
return tr.common.pills;
}
export function formatPlannerQuantity(
packageType: string | undefined,
count: number,
tr: { common: { units: string; ml: string; pills: string; puffs?: string; injections?: string } }
): string {
return `${count} ${getPlannerUnit(packageType, tr)}`;
}