Part (c), item 1 of t72. This sends the extra-target line to the registry, following the contract agreed for tenant-registry #114.
After each billing refresh (before a scan, and when a target is created), the agent stores the month's peak number of extra active targets in metering_months.extra_peak. Months are Europe/Berlin calendar months.
When the peak rises, it sends target.extra with quantity = peak and key target-extra:{tenant}:{YYYY-MM}:{peak}.
Once a day it re-sends the current peak. The registry drops that as a duplicate of its key, so ERP usage records stay append-only.
Billing takes the highest quantity per tenant-month.
The event carries a count only (properties: month), never target names.
Hardening: the quota filter also matches a month document that has no pruefungen counter yet. The peak can create that document before the first Prüfung is charged.
Tests
tests/extra_peak.rs (Mongo) covers:
a rise is sent;
a second send the same day is not;
archiving an extra target leaves the peak unchanged;
a re-send happens the next day;
a new month starts from the current count;
the quota still counts on a month document the peak created.
Part (c), item 1 of t72. This sends the extra-target line to the registry, following the contract agreed for tenant-registry #114.
- After each billing refresh (before a scan, and when a target is created), the agent stores the month's peak number of extra active targets in `metering_months.extra_peak`. Months are Europe/Berlin calendar months.
- When the peak rises, it sends `target.extra` with quantity = peak and key `target-extra:{tenant}:{YYYY-MM}:{peak}`.
- Once a day it re-sends the current peak. The registry drops that as a duplicate of its key, so ERP usage records stay append-only.
- Billing takes the highest quantity per tenant-month.
- The event carries a count only (properties: `month`), never target names.
- **Hardening:** the quota filter also matches a month document that has no `pruefungen` counter yet. The peak can create that document before the first Prüfung is charged.
## Tests
`tests/extra_peak.rs` (Mongo) covers:
- a rise is sent;
- a second send the same day is not;
- archiving an extra target leaves the peak unchanged;
- a re-send happens the next day;
- a new month starts from the current count;
- the quota still counts on a month document the peak created.
Not built locally, per the CI-only rule.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
The 5,99 € line bills the highest number of extra targets at once in
the calendar month (Europe/Berlin), with no proration.
- After each billing refresh (before a scan, when a target is created)
the agent records how many active targets are extra as the month's
peak, in metering_months.
- When the peak rises it sends `target.extra` with quantity = peak and
the key target-extra:{tenant}:{YYYY-MM}:{peak}; once a day it sends
the current peak again, which the registry drops as a duplicate of
its key. Count only: no target names leave Prüfwerk.
- The quota filter also matches a month document without the counter,
since the peak can create that document first.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Part (c), item 1 of t72. This sends the extra-target line to the registry, following the contract agreed for tenant-registry #114.
metering_months.extra_peak. Months are Europe/Berlin calendar months.target.extrawith quantity = peak and keytarget-extra:{tenant}:{YYYY-MM}:{peak}.month), never target names.pruefungencounter yet. The peak can create that document before the first Prüfung is charged.Tests
tests/extra_peak.rs(Mongo) covers:Not built locally, per the CI-only rule.
🤖 Generated with Claude Code
The 5,99 € line bills the highest number of extra targets at once in the calendar month (Europe/Berlin), with no proration. - After each billing refresh (before a scan, when a target is created) the agent records how many active targets are extra as the month's peak, in metering_months. - When the peak rises it sends `target.extra` with quantity = peak and the key target-extra:{tenant}:{YYYY-MM}:{peak}; once a day it sends the current peak again, which the registry drops as a duplicate of its key. Count only: no target names leave Prüfwerk. - The quota filter also matches a month document without the counter, since the peak can create that document first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>