update applying current ai insight from dashboard-cpsp

This commit is contained in:
Alberto-Audrix committed 2026-10-05 14:25:22 +07:00
1 parent 31272035e9
commit b87f20e3b3
27 files changed
+5300 -343

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
/**
* KPI.chicken_life = DOC − cumulative mortality (excludes harvest).
* Stock akhir (in-house remaining) = chicken_life − harvest_total.
*/
export function stockAkhirFromKpi(
kpi: { chicken_life?: number | null; harvest_total?: number | null } | null | undefined
): number | null {
if (kpi?.chicken_life == null) return null;
return Math.max(0, kpi.chicken_life - (kpi.harvest_total ?? 0));
}