FUE-T03: correct meters POST docstring (no recomputed_periods field) and inaccurate test comments
This commit is contained in:
@@ -185,9 +185,10 @@ def declare_energy_meter(
|
||||
|
||||
**Retroactive recompute**: if ``started_at`` is in the past, billing
|
||||
records from that point forward are re-judged via ``recompute_range`` to
|
||||
reflect the new meter attribution. The response includes the count of
|
||||
recomputed periods in ``recomputed_periods`` (not part of ``MeterResponse``
|
||||
— the recompute is transparent; callers should re-fetch costs if needed).
|
||||
reflect the new meter attribution. The recompute is transparent — the
|
||||
response body is the created meter (``MeterResponse``) only and does **not**
|
||||
include a recompute count; callers should re-fetch costs if they need the
|
||||
updated totals.
|
||||
"""
|
||||
started_at_utc = _localize_started_at(body.started_at)
|
||||
|
||||
|
||||
Vendored
+4
-3
@@ -591,9 +591,10 @@ export interface paths {
|
||||
*
|
||||
* **Retroactive recompute**: if ``started_at`` is in the past, billing
|
||||
* records from that point forward are re-judged via ``recompute_range`` to
|
||||
* reflect the new meter attribution. The response includes the count of
|
||||
* recomputed periods in ``recomputed_periods`` (not part of ``MeterResponse``
|
||||
* — the recompute is transparent; callers should re-fetch costs if needed).
|
||||
* reflect the new meter attribution. The recompute is transparent — the
|
||||
* response body is the created meter (``MeterResponse``) only and does **not**
|
||||
* include a recompute count; callers should re-fetch costs if they need the
|
||||
* updated totals.
|
||||
*/
|
||||
post: operations["declare_energy_meter_api_energy_meters_post"];
|
||||
delete?: never;
|
||||
|
||||
@@ -1405,7 +1405,7 @@
|
||||
"api-energy-meters"
|
||||
],
|
||||
"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",
|
||||
"parameters": [
|
||||
{
|
||||
|
||||
@@ -1125,11 +1125,13 @@ paths:
|
||||
|
||||
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
|
||||
parameters:
|
||||
- name: X-CSRF-Token
|
||||
|
||||
@@ -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
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user