M8-T16: add thermal meter cost APIs

This commit is contained in:
2026-08-23 21:22:06 +02:00
parent 489e5b596a
commit 3eec701448
12 changed files with 1843 additions and 19 deletions
+297
View File
@@ -559,6 +559,66 @@ export interface paths {
patch?: never;
trace?: never;
};
"/api/energy/meter-costs": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get Meter Costs
* @description List thermal rows in a half-open time window with stable pagination.
*/
get: operations["get_meter_costs_api_energy_meter_costs_get"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/api/energy/meter-costs/summary": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Get Meter Cost Summary
* @description Summarize thermal variable and once-per-contract daily fixed costs.
*/
get: operations["get_meter_cost_summary_api_energy_meter_costs_summary_get"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/api/energy/meter-costs/recompute": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
put?: never;
/**
* Post Meter Cost Recompute
* @description Atomically overwrite closed, UTC-quarter thermal rows in a bounded window.
*/
post: operations["post_meter_cost_recompute_api_energy_meter_costs_recompute_post"];
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/api/energy/meters": {
parameters: {
query?: never;
@@ -1962,6 +2022,74 @@ export interface components {
/** Ended At */
ended_at: string | null;
};
/**
* MeterCostPeriodSchema
* @description One auditable thermal ledger row; all Decimal values are JSON strings.
*/
MeterCostPeriodSchema: {
/**
* Commodity
* @enum {string}
*/
commodity: "heating" | "hot_water";
/**
* Period Start
* Format: date-time
*/
period_start: string;
/**
* Period End
* Format: date-time
*/
period_end: string;
/** Meter Id */
meter_id: number | null;
/** Source Binding Id */
source_binding_id: number | null;
/** Contract Version Id */
contract_version_id: number | null;
/** Quantity */
quantity: string;
/** Cost */
cost: string;
/** Currency */
currency: string;
/** Cost Breakdown */
cost_breakdown: {
[key: string]: string;
};
/** Pricing Snapshot */
pricing_snapshot: {
[key: string]: {
[key: string]: string;
};
};
/** Quality */
quality: string;
/** Degraded */
degraded: boolean;
/** Degraded Reason */
degraded_reason: string | null;
};
/** MeterCostRecomputeResponse */
MeterCostRecomputeResponse: {
/** Processed */
processed: number;
/** Normal */
normal: number;
/** Degraded */
degraded: number;
};
/** MeterCostsResponse */
MeterCostsResponse: {
/** Items */
items: components["schemas"]["MeterCostPeriodSchema"][];
/**
* Total
* @description Total matching rows before pagination.
*/
total: number;
};
/**
* MeterDeclareRequest
* @description Request body for POST /api/energy/meters.
@@ -2493,6 +2621,30 @@ export interface components {
points: components["schemas"]["PricePointSchema"][];
/** @description Fixed tariff table for manual contracts. Null for tibber contracts and when no active contract exists. */
tariff?: components["schemas"]["ManualTariffSchema"] | null;
/**
* Contract Version Id
* @description Thermal active contract version identifier; omitted for electricity.
*/
contract_version_id?: number | null;
/**
* Effective From
* @description Thermal contract version start; omitted for electricity.
*/
effective_from?: string | null;
/**
* Effective To
* @description Thermal contract version end; omitted for electricity.
*/
effective_to?: string | null;
/**
* Values
* @description Thermal normalized Decimal-string contract values; omitted for electricity.
*/
values?: {
[key: string]: {
[key: string]: string;
};
} | null;
};
/**
* ProfileSummary
@@ -2737,6 +2889,46 @@ export interface components {
*/
days: number;
};
/** ThermalCostSummaryResponse */
ThermalCostSummaryResponse: {
/** Currency */
currency: string;
/** Heating */
heating: string;
/** Hot Water Heating */
hot_water_heating: string;
/** Hot Water */
hot_water: string;
/** Hot Water Tax */
hot_water_tax: string;
/** Variable Subtotal */
variable_subtotal: string;
fixed_breakdown: components["schemas"]["ThermalFixedBreakdown"];
/** Fixed Subtotal */
fixed_subtotal: string;
/** All In */
all_in: string;
/** Period Count */
period_count: number;
/** Degraded Count */
degraded_count: number;
};
/**
* ThermalFixedBreakdown
* @description D11 annual-standing charges accrued per settled local day, as Decimal strings.
*/
ThermalFixedBreakdown: {
/** Heating Network */
heating_network: string;
/** Metering */
metering: string;
/** Delivery Set */
delivery_set: string;
/** Hot Water Network */
hot_water_network: string;
/** Other */
other: string;
};
/**
* TibberTestPriceSchema
* @description Current Tibber price point returned on a successful test.
@@ -3272,6 +3464,7 @@ export interface operations {
get_prices_api_energy_prices_get: {
parameters: {
query?: {
scope?: "electricity" | "thermal";
/** @description Inclusive start of the time window (ISO 8601). Defaults to the start of today UTC when omitted. */
start?: string | null;
/** @description Inclusive end of the time window (ISO 8601). Defaults to the end of tomorrow UTC when omitted. */
@@ -3669,6 +3862,110 @@ export interface operations {
};
};
};
get_meter_costs_api_energy_meter_costs_get: {
parameters: {
query?: {
scope?: "thermal";
commodity?: ("heating" | "hot_water") | null;
start?: string | null;
end?: string | null;
limit?: number;
offset?: number;
};
header?: never;
path?: never;
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Successful Response */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["MeterCostsResponse"];
};
};
/** @description Validation Error */
422: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["HTTPValidationError"];
};
};
};
};
get_meter_cost_summary_api_energy_meter_costs_summary_get: {
parameters: {
query?: {
scope?: "thermal";
start?: string | null;
end?: string | null;
};
header?: never;
path?: never;
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Successful Response */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["ThermalCostSummaryResponse"];
};
};
/** @description Validation Error */
422: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["HTTPValidationError"];
};
};
};
};
post_meter_cost_recompute_api_energy_meter_costs_recompute_post: {
parameters: {
query: {
scope?: "thermal";
start: string;
end: string;
};
header?: {
"X-CSRF-Token"?: string | null;
};
path?: never;
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Successful Response */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["MeterCostRecomputeResponse"];
};
};
/** @description Validation Error */
422: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["HTTPValidationError"];
};
};
};
};
list_energy_meters_api_energy_meters_get: {
parameters: {
query?: never;