FUE-T03: correct meters POST docstring (no recomputed_periods field) and inaccurate test comments
frontend / frontend (push) Successful in 2m11s
pytest / test (push) Successful in 8m51s

This commit is contained in:
2026-06-25 18:36:46 +02:00
parent 188168b16a
commit da05fd2f09
5 changed files with 16 additions and 12 deletions
+4 -3
View File
@@ -185,9 +185,10 @@ def declare_energy_meter(
**Retroactive recompute**: if ``started_at`` is in the past, billing **Retroactive recompute**: if ``started_at`` is in the past, billing
records from that point forward are re-judged via ``recompute_range`` to records from that point forward are re-judged via ``recompute_range`` to
reflect the new meter attribution. The response includes the count of reflect the new meter attribution. The recompute is transparent — the
recomputed periods in ``recomputed_periods`` (not part of ``MeterResponse`` response body is the created meter (``MeterResponse``) only and does **not**
— the recompute is transparent; callers should re-fetch costs if needed). include a recompute count; callers should re-fetch costs if they need the
updated totals.
""" """
started_at_utc = _localize_started_at(body.started_at) started_at_utc = _localize_started_at(body.started_at)
+4 -3
View File
@@ -591,9 +591,10 @@ export interface paths {
* *
* **Retroactive recompute**: if ``started_at`` is in the past, billing * **Retroactive recompute**: if ``started_at`` is in the past, billing
* records from that point forward are re-judged via ``recompute_range`` to * records from that point forward are re-judged via ``recompute_range`` to
* reflect the new meter attribution. The response includes the count of * reflect the new meter attribution. The recompute is transparent — the
* recomputed periods in ``recomputed_periods`` (not part of ``MeterResponse`` * response body is the created meter (``MeterResponse``) only and does **not**
* — the recompute is transparent; callers should re-fetch costs if needed). * include a recompute count; callers should re-fetch costs if they need the
* updated totals.
*/ */
post: operations["declare_energy_meter_api_energy_meters_post"]; post: operations["declare_energy_meter_api_energy_meters_post"];
delete?: never; delete?: never;
+1 -1
View File
@@ -1405,7 +1405,7 @@
"api-energy-meters" "api-energy-meters"
], ],
"summary": "Declare Energy Meter", "summary": "Declare Energy Meter",
"description": "Declare a new meter epoch (swap, home move, or initial declaration).\n\nCloses the current active meter for the given commodity at ``started_at``\nand opens a new active meter. If no active meter exists, the new meter is\nsimply created without closing anything.\n\n**Validation**: ``started_at`` must be **≥** the current active meter's\nown ``started_at`` (no chronological backdate below the active epoch's\nstart). Equal timestamps are allowed (replaces the current meter at the\nsame logical moment). Violation → 422.\n\n**Retroactive recompute**: if ``started_at`` is in the past, billing\nrecords from that point forward are re-judged via ``recompute_range`` to\nreflect the new meter attribution. The response includes the count of\nrecomputed periods in ``recomputed_periods`` (not part of ``MeterResponse``\n— the recompute is transparent; callers should re-fetch costs if needed).", "description": "Declare a new meter epoch (swap, home move, or initial declaration).\n\nCloses the current active meter for the given commodity at ``started_at``\nand opens a new active meter. If no active meter exists, the new meter is\nsimply created without closing anything.\n\n**Validation**: ``started_at`` must be **≥** the current active meter's\nown ``started_at`` (no chronological backdate below the active epoch's\nstart). Equal timestamps are allowed (replaces the current meter at the\nsame logical moment). Violation → 422.\n\n**Retroactive recompute**: if ``started_at`` is in the past, billing\nrecords from that point forward are re-judged via ``recompute_range`` to\nreflect the new meter attribution. The recompute is transparent — the\nresponse body is the created meter (``MeterResponse``) only and does **not**\ninclude a recompute count; callers should re-fetch costs if they need the\nupdated totals.",
"operationId": "declare_energy_meter_api_energy_meters_post", "operationId": "declare_energy_meter_api_energy_meters_post",
"parameters": [ "parameters": [
{ {
+5 -3
View File
@@ -1125,11 +1125,13 @@ paths:
records from that point forward are re-judged via ``recompute_range`` to records from that point forward are re-judged via ``recompute_range`` to
reflect the new meter attribution. The response includes the count of reflect the new meter attribution. The recompute is transparent — the
recomputed periods in ``recomputed_periods`` (not part of ``MeterResponse`` response body is the created meter (``MeterResponse``) only and does **not**
— the recompute is transparent; callers should re-fetch costs if needed).' include a recompute count; callers should re-fetch costs if they need the
updated totals.'
operationId: declare_energy_meter_api_energy_meters_post operationId: declare_energy_meter_api_energy_meters_post
parameters: parameters:
- name: X-CSRF-Token - name: X-CSRF-Token
+2 -2
View File
@@ -543,7 +543,7 @@ def test_patch_meter_no_recompute_when_started_at_not_changed(meters_client):
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Timeline continuity (integration: no recompute mock) # Timeline continuity (recompute mocked to avoid slow computation over empty quarters)
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
@@ -615,7 +615,7 @@ def test_declare_meter_invalid_reason_returns_422(meters_client):
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Retroactive recompute: integration (no mock) — window coverage check # Retroactive recompute & boundary update (recompute mocked) — window coverage check
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------