feat(metering): this month's usage on the targets page (t72) #931

Merged
sharang merged 1 commits from feat/t72-usage-view into main 2026-11-07 02:50:58 +00:00
Owner

Part (c), item 4 of t72: the customer sees their usage.

What changes

  • Agent: GET /api/v1/metering/usage (tenant-scoped) returns:
    • month (Europe/Berlin);
    • pruefungen and prueftage from the counters;
    • extra_targets now, and extra_peak;
    • the plan's included_targets, monthly_pruefungen and prueftag_cap;
    • plan_known, which is false when the registry didn't answer. The limits are then unknown, not unlimited.
  • Dashboard: one row under the targets page header:
    • for example "Nutzung in diesem Monat · 37 von 100 Prüfungen · 1 Prüftag (Limit 5) · 2 zusätzliche Prüfobjekte";
    • Enterprise shows "… Prüfungen, unbegrenzt";
    • an unknown plan shows only "… gezählte Prüfungen";
    • the hover text says what counts.
  • The extra_peak field gets its stored value once #929 is merged. Until then the summary uses the current count as the floor.

Tests

  • Texts: the wording for each case.
  • Dashboard: which lines show for Standard, Enterprise and an unknown plan.
  • Mongo: the metering_counters integration test now also reads the month summary.

Not built locally, per the CI-only rule.

🤖 Generated with Claude Code

Part (c), item 4 of t72: the customer sees their usage. ## What changes - **Agent:** `GET /api/v1/metering/usage` (tenant-scoped) returns: - `month` (Europe/Berlin); - `pruefungen` and `prueftage` from the counters; - `extra_targets` now, and `extra_peak`; - the plan's `included_targets`, `monthly_pruefungen` and `prueftag_cap`; - `plan_known`, which is false when the registry didn't answer. The limits are then unknown, not unlimited. - **Dashboard:** one row under the targets page header: - for example "Nutzung in diesem Monat · 37 von 100 Prüfungen · 1 Prüftag (Limit 5) · 2 zusätzliche Prüfobjekte"; - Enterprise shows "… Prüfungen, unbegrenzt"; - an unknown plan shows only "… gezählte Prüfungen"; - the hover text says what counts. - The `extra_peak` field gets its stored value once #929 is merged. Until then the summary uses the current count as the floor. ## Tests - **Texts:** the wording for each case. - **Dashboard:** which lines show for Standard, Enterprise and an unknown plan. - **Mongo:** the `metering_counters` integration test now also reads the month summary. Not built locally, per the CI-only rule. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
sharang force-pushed feat/t72-usage-view from 43a974037b to 5262cd447a 2026-11-06 17:02:49 +00:00 Compare
sharang added 1 commit 2026-11-07 02:31:23 +00:00
feat(metering): this month's usage on the targets page (t72)
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Agent integration (pull_request) Successful in 4m17s
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 19m7s
686b8b0863
- GET /api/v1/metering/usage: the tenant's counted Prüfungen and
  Prüftage this month (Europe/Berlin), the extra targets now and the
  month's peak, with the plan's limits and whether the plan could be
  read.
- The targets page shows it in one row: "37 von 100 Prüfungen",
  Prüftage with the cap, and the extra targets. Enterprise reads
  "unbegrenzt"; an unknown plan shows only the count, never a limit it
  cannot know. The hover text says what counts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sharang force-pushed feat/t72-usage-view from 5262cd447a to 686b8b0863 2026-11-07 02:31:23 +00:00 Compare
sharang merged commit 3bdaf28737 into main 2026-11-07 02:50:58 +00:00
Sign in to join this conversation.