fix(statistics): feeding totals per unit instead of adding litres to kilograms

The feeding statistics summed every amount regardless of its unit, so
5 l syrup and 2 kg fondant showed as 7. The API now also returns byUnit
(units normalised: "L" = "l"), the old fields stay for compatibility,
and the statistics page shows one list per unit.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
Nick SzaunigandClaude Opus 5.5 committed 2026-10-01 12:27:24 +02:00
1 parent ed0a000534
commit 2bc0db6f33
4 files changed
+92 -45

No files matched your search

@@ -48,4 +48,6 @@ export interface HoneyStats {
export interface FeedingStats {
byColony: Record<string, number>;
bySeason: Record<string, number>;
/** Totals per unit ("l", "kg", ...) - units are never added together. */
byUnit?: Record<string, { byColony: Record<string, number>; bySeason: Record<string, number> }>;
}