Skip to content

feat: import provider billing and reconcile against estimates - #513

Merged
Ayinkx merged 2 commits into
AyinkxLab:mainfrom
aliyuHabibu:phase10-billing-reconciliation
Oct 19, 2026
Merged

Ayinkx merged 2 commits into
AyinkxLab:mainfrom
aliyuHabibu:phase10-billing-reconciliation

Conversation

@aliyuHabibu

Copy link
Copy Markdown
Contributor

Add a bounded CSV import for provider-reported monthly costs and a reconciliation report that compares them against the app's own token-based estimate. The estimate is recomputed on read and is never overwritten by an import; re-importing the same provider/period updates the amount in place.

  • ProviderBillingRecord model + Alembic migration
  • app/services/billing_reconciliation.py: bounded CSV parsing, per-(provider, period) estimate from assistant message tokens, variance report, and idempotent import
  • /billing page, /billing/import, and /billing/api/reconciliation routes (owner-scoped, import audited)
  • fixture CSVs and tests

Summary

Linked issue

Changes

  • Bullet list of what changed and why.

Validation

  • pytest passes
  • ruff check . passes
  • black --check . passes
  • Added/updated tests for the change
  • Docs updated if user-visible

Notes for reviewers

Closes #485

Add a bounded CSV import for provider-reported monthly costs and a
reconciliation report that compares them against the app's own
token-based estimate. The estimate is recomputed on read and is never
overwritten by an import; re-importing the same provider/period updates
the amount in place.

- ProviderBillingRecord model + Alembic migration
- app/services/billing_reconciliation.py: bounded CSV parsing,
  per-(provider, period) estimate from assistant message tokens, variance
  report, and idempotent import
- /billing page, /billing/import, and /billing/api/reconciliation routes
  (owner-scoped, import audited)
- fixture CSVs and tests
@drips-wave

drips-wave Bot commented Oct 18, 2026

Copy link
Copy Markdown

@aliyuHabibu Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Ayinkx
Ayinkx merged commit 09825cb into AyinkxLab:main Oct 19, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Phase 10: Provider billing reconciliation import

2 participants