Skip to content

@kaiord/core


@kaiord/core / dayEnergyBalanceSchema

Variable: dayEnergyBalanceSchema

const dayEnergyBalanceSchema: ZodObject<{ activity_kcal: ZodNumber; basal_kcal: ZodNumber; date: ZodISODate; expenditure_kcal: ZodNumber; intake_kcal: ZodNullable<ZodNumber>; macro_actuals: ZodOptional<ZodObject<{ carb_g: ZodNumber; fat_g: ZodNumber; kcal: ZodNumber; protein_g: ZodNumber; }, $strip>>; macro_targets: ZodOptional<ZodObject<{ carb_g: ZodNumber; fat_g: ZodNumber; kcal: ZodNumber; protein_g: ZodNumber; }, $strip>>; net_kcal: ZodNullable<ZodNumber>; source: ZodEnum<{ measured: "measured"; mixed: "mixed"; predicted: "predicted"; }>; target_kcal: ZodNullable<ZodNumber>; }, $strip>

Defined in: packages/core/src/domain/schemas/health/energy-balance.ts:28

Computed per-day energy-balance view-model — not a persisted payload but the shape the SPA/chatbot read.

intake_kcal is nullable: null means the day is untracked (never a silent zero). net_kcal is correspondingly nullable — without a tracked intake there is no net (never a misleading zero or full-surplus). target_kcal is nullable when no goal is active. Macro targets and actuals are optional because they only exist once a goal / intake is present.