implementace co nejdrive dosazeni SOC na home-01 a umozneni plneho socu n slotu ped koncem sell < 0
Some checks failed
CI and deploy / migration-check (push) Failing after 13s
CI and deploy / deploy (push) Has been skipped

This commit is contained in:
Dusan Vojacek
2026-05-26 08:07:00 +02:00
parent 8494ea26de
commit 91a9bef3d7
10 changed files with 566 additions and 25 deletions

View File

@@ -3,6 +3,8 @@
export type PlanMaskSlot = {
allow_charge: boolean
allow_discharge_export: boolean
neg_sell_phase?: 'none' | 'prep' | 'tail' | null
neg_sell_soc_target_wh?: number | null
}
export type PlanSolverSnapshot = {
@@ -47,9 +49,16 @@ export function parsePlanSolverSnapshot(
const row = m as Record<string, unknown>
const slot = recordString(row.slot)
if (slot == null) continue
const phaseRaw = row.neg_sell_phase
const phase =
phaseRaw === 'prep' || phaseRaw === 'tail' || phaseRaw === 'none'
? phaseRaw
: null
masksByIso.set(slot, {
allow_charge: recordBool(row.allow_charge),
allow_discharge_export: recordBool(row.allow_discharge_export),
neg_sell_phase: phase,
neg_sell_soc_target_wh: recordNumber(row.neg_sell_soc_target_wh),
})
}
}