Repository navigation
feat(billing): usage time series, admin usage report, and billing docs - #568
Merged
Conversation
Closes AyinkxLab#449 Closes AyinkxLab#480 Closes AyinkxLab#487 - Add daily/weekly usage time-series aggregation and user/workspace APIs. - Add the admin usage report page with date/scope filters and bounded paging. - Document quotas, alerts, invoices, time series, and every billing setting. - Repair the merged invoice export module/tests and make PDF export an explicit fpdf2 dependency. - Reset the process-local marketplace fallback cache between tests.
abdulwahabmonilola-ctrl
force-pushed
the
feat/449-480-487-usage-timeseries-admin-report-billing-docs
branch
from
October 23, 2026 14:33
0de7407 to
9cbe7a8
Compare
Ayinkx
approved these changes
Oct 23, 2026
| try: | ||
| days = usage_dashboards.normalize_days(request.args.get("days")) | ||
| except ValueError as exc: | ||
| return jsonify({"error": str(exc), "kind": "invalid"}), 400 |
| try: | ||
| return usage_dashboards.normalize_bucket(request.args.get("bucket")), None | ||
| except ValueError as exc: | ||
| return None, (jsonify({"error": str(exc), "kind": "invalid"}), 400) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Combines the three Phase 10 billing/observability issues assigned to me, plus the minimal repairs needed to make the billing migration and invoice tests runnable on current
main.#449 — Usage time-series API
usage_dashboards.timeseries()with daily and weekly buckets (Monday–Sunday UTC), computed strictly from storedUsageRecordrows.[now - days, now], including future-dated rows, are excluded.GET /billing/api/usage/timeseriesandGET /billing/api/workspaces/<id>/usage/timeserieswith the samedays,source,provider, andmodelfilters as the dashboards.#480 — Admin usage report page
GET /admin/usage/reportprotected by the existing admin guard.all/user/workspace), source/provider/model filters, and bounded pagination.#487 — Billing documentation
docs/billing.md.BILLING_ALERT_EMAILandUSAGE_EXPORT_CSV_MAX_ROWS, in both the docs and README..env.exampleand the config class.Supporting fixes required by the gate
app/services/invoice_export.pyandtests/test_invoice_export.pyintroduced by Phase 10: Invoice export as CSV and PDF #483.fpdf2for PDF invoice export; CSV export remains import-free.main, which already carries the unique migration revision fix.Validation
Targeted suites pass:
ruff check .is clean. The full Python suite should be confirmed by CI.Closes #449
Closes #480
Closes #487