fix FE 96h forecast
Some checks failed
CI and deploy / migration-check (push) Failing after 17s
CI and deploy / deploy (push) Has been skipped

This commit is contained in:
Dusan Vojacek
2026-04-19 21:40:55 +02:00
parent 70d306961a
commit ee4355f17f
4 changed files with 234 additions and 7 deletions

View File

@@ -99,6 +99,24 @@ export async function getCurrentPlan(siteId: number): Promise<CurrentPlanRespons
return data
}
/** Řada FVE předpovědi (součet polí) po 15 min — doplnění grafu za horizont uloženého plánu. */
export type ForecastPvSlotRow = {
interval_start: string
pv_forecast_total_w?: number | null
}
export async function getForecastPvSlotsRange(
siteId: number,
fromIso: string,
toIso: string,
): Promise<ForecastPvSlotRow[]> {
const { data } = await client.get<{ slots?: ForecastPvSlotRow[] }>(
`/sites/${siteId}/forecast/pv-slots`,
{ params: { from: fromIso, to: toIso }, timeout: 45_000 },
)
return Array.isArray(data?.slots) ? data.slots : []
}
/** GET /api/v1/sites/{id}/prices?date=YYYY-MM-DD */
export type SiteEffectivePriceRowDto = {
site_id: number