M8-T12: scope energy contracts

This commit is contained in:
2026-08-23 21:22:06 +02:00
parent a9458394f2
commit b812d5ac46
13 changed files with 533 additions and 47 deletions
+22 -5
View File
@@ -472,7 +472,7 @@ export interface paths {
* List Energy Contracts
* @description List all energy contracts with their active status.
*
* Returns a flat list (no embedded version history); use
* Scope defaults to ``electricity`` for old clients. Returns a flat list (no embedded version history); use
* GET /api/energy/contracts/{id} to fetch the full version history for a
* specific contract.
*/
@@ -519,11 +519,11 @@ export interface paths {
* @description Partially update a contract: rename or change activation status.
*
* - ``name``: updates the human-readable label.
* - ``active=true``: activates this contract (all others are deactivated).
* - ``active=true``: activates this contract (same-scope contracts are deactivated).
* - ``active=false``: deactivates this contract (no effect on others).
*
* At most one contract may be active at any time; the service layer enforces
* mutual exclusion.
* At most one contract may be active per scope; the service layer enforces
* scope-local mutual exclusion.
*/
patch: operations["patch_energy_contract_api_energy_contracts__contract_id__patch"];
trace?: never;
@@ -1549,6 +1549,8 @@ export interface components {
name: string;
/** Kind */
kind: string;
/** Scope */
scope?: string | null;
/**
* Currency
* @default EUR
@@ -1578,6 +1580,8 @@ export interface components {
name: string;
/** Kind */
kind: string;
/** Scope */
scope: string;
/** Active */
active: boolean;
/** Currency */
@@ -1632,6 +1636,8 @@ export interface components {
name: string;
/** Kind */
kind: string;
/** Scope */
scope: string;
/** Active */
active: boolean;
/** Currency */
@@ -3494,7 +3500,9 @@ export interface operations {
};
list_energy_contracts_api_energy_contracts_get: {
parameters: {
query?: never;
query?: {
scope?: string;
};
header?: never;
path?: never;
cookie?: never;
@@ -3510,6 +3518,15 @@ export interface operations {
"application/json": components["schemas"]["ContractListResponse"];
};
};
/** @description Validation Error */
422: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["HTTPValidationError"];
};
};
};
};
create_energy_contract_api_energy_contracts_post: {