feat: credit-based billing with monthly usage caps - #101
Conversation
# Conflicts: # apps/dashboard/drizzle/meta/0029_snapshot.json # apps/dashboard/drizzle/meta/_journal.json
- purchaseProjectCredits passed currentQuantity + credits to billing.update, double-counting credits the customer already had; now passes the purchased amount directly
- add getProjectInvoices using the Autumn customer invoices expand - include invoices in the billing overview response - render invoice list with date, status, amount, and hosted invoice link
- Prevent reversing usage outside the current billing period - Calculate monthly billing cycles using calendar months
|
There are still two sources of truth for billing. There is the rate/cap data that is in the vm_types table and the pricing on the autumn credit system. That is data that can get desynced and seems like a pain for maintenance. |
this is unfixable as far as I'm aware due to how autumn works unless we want to hit their (very slow) api to show pricing data. we have to handle the usage and caps ourselves which means we need to have the rates & caps to calculate it |
- Lock billing meters during usage recording - Avoid rounding exact credit-pack amounts up
|
|
||
| # local wireguard config | ||
| dev/fyra-wg.conf | ||
| core.* |
There was a problem hiding this comment.
pnpm crash dumps, sometimes workerd will crash randomly
| postgres: | ||
| image: docker.io/library/postgres:17 | ||
| container_name: fyra-postgres | ||
| mem_limit: 512m |
There was a problem hiding this comment.
probably good to have, but curious why you added them
Uh oh!
There was an error while loading. Please reload this page.