@kaiord/core / assembleDayEnergyBalance
Function: assembleDayEnergyBalance()
assembleDayEnergyBalance(
input):object
Defined in: packages/core/src/application/energy/day-balance.ts:55
Assemble a validated DayEnergyBalance from a resolved expenditure plus the day's intake, target, and optional macro breakdowns.
Parameters
input
Returns
object
activity_kcal
activity_kcal:
number
basal_kcal
basal_kcal:
number
date
date:
string
expenditure_kcal
expenditure_kcal:
number
intake_kcal
intake_kcal:
number|null
macro_actuals?
optionalmacro_actuals?:object
macro_actuals.carb_g
carb_g:
number
macro_actuals.fat_g
fat_g:
number
macro_actuals.kcal
kcal:
number
macro_actuals.protein_g
protein_g:
number
macro_targets?
optionalmacro_targets?:object
macro_targets.carb_g
carb_g:
number
macro_targets.fat_g
fat_g:
number
macro_targets.kcal
kcal:
number
macro_targets.protein_g
protein_g:
number
net_kcal
net_kcal:
number|null
source
source:
"measured"|"predicted"|"mixed"=expenditureSourceSchema
target_kcal
target_kcal:
number|null
Throws
ZodError when the assembled view-model fails schema validation.