prepsani s opusem dle planu
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-24 22:44:21 +02:00
parent 2d021b15c3
commit 8bef1c6da6
11 changed files with 720 additions and 16 deletions

View File

@@ -68,7 +68,11 @@ begin
is_predicted_price,
load_baseline_w,
pv_a_forecast_raw_w, pv_b_forecast_raw_w,
pv_a_forecast_solver_w, pv_b_forecast_solver_w
pv_a_forecast_solver_w, pv_b_forecast_solver_w,
cashflow_czk,
battery_arbitrage_czk,
penalty_czk,
green_bonus_czk
) values (
v_run_id,
(r.value->>'interval_start')::timestamptz,
@@ -94,7 +98,11 @@ begin
(r.value->>'pv_a_forecast_raw_w')::int,
(r.value->>'pv_b_forecast_raw_w')::int,
(r.value->>'pv_a_forecast_solver_w')::int,
(r.value->>'pv_b_forecast_solver_w')::int
(r.value->>'pv_b_forecast_solver_w')::int,
nullif(r.value->>'cashflow_czk', '')::numeric,
nullif(r.value->>'battery_arbitrage_czk', '')::numeric,
nullif(r.value->>'penalty_czk', '')::numeric,
nullif(r.value->>'green_bonus_czk', '')::numeric
);
else
insert into ems.planning_interval (
@@ -109,7 +117,11 @@ begin
heat_pump_enabled, heat_pump_setpoint_w,
pv_a_curtailed_w, expected_cost_czk,
effective_buy_price, effective_sell_price,
is_predicted_price
is_predicted_price,
cashflow_czk,
battery_arbitrage_czk,
penalty_czk,
green_bonus_czk
) values (
v_run_id,
(r.value->>'interval_start')::timestamptz,
@@ -130,7 +142,11 @@ begin
(r.value->>'expected_cost_czk')::numeric,
(r.value->>'effective_buy_price')::numeric,
(r.value->>'effective_sell_price')::numeric,
coalesce((r.value->>'is_predicted_price')::boolean, false)
coalesce((r.value->>'is_predicted_price')::boolean, false),
nullif(r.value->>'cashflow_czk', '')::numeric,
nullif(r.value->>'battery_arbitrage_czk', '')::numeric,
nullif(r.value->>'penalty_czk', '')::numeric,
nullif(r.value->>'green_bonus_czk', '')::numeric
);
end if;
end loop;