Hub 2.0 step 4: billing per customer

- One invoice per customer per period for all its products; the schedule
  moves from Licence to Customer (migration copies it, so billing carries
  on unchanged); licences get billedFrom / billedUntil
- Website (R99, 5 GB) and App (on active members) prices next to the
  Events tiers; founding prices per product, then bundles (15% two, 25%
  three); extra website storage R20 per 5 GB, never discounted
- A product added to a billed customer starts after its free month; days
  before its first full period are prorated, never charged twice
- Annual review per product (Events income, App members), one notice of
  licence change per product; invoices, PDFs and emails name products
- Customer page: schedule, per-product billing, next-invoice preview
- Invoices from before 2.0 kept as they were (still recalculable)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-04 16:18:23 +02:00
co-authored by Claude Opus 5.5
parent 937c1fa38e
commit 7478e84e9d
21 changed files with 1081 additions and 316 deletions
+17 -3
View File
@@ -43,15 +43,29 @@ Hub 2.0.0, Cross Code Hub, in steps (`docs/HUB-2.0-PLAN.md`).
install of that product runs that version or later, counting every release the update would
bring. The install page shows what's missing; the Releases page shows each release's needs.
Protocol v2 replies carry them (`requires`, contracts 1.1.0); v1 replies are unchanged.
- **Billing per customer** (step 4): one invoice per church per period for all its products. The
billing schedule (cycle, start, next invoice, review) is the church's; each licence has the date
it's **charged from** and the day it's invoiced up to. Prices for the **Church Website** (R99, 5 GB
included) and the **Church App** (R99 to R999 on active members, Network priced per church), next to
the Cross Events tiers. **Bundles** 15% off two products and 25% off three, after the founding
prices; Accounts is free and never counts. **Extra website storage** R20 per 5 GB a month, never
discounted (12 months' price when billed yearly). A product added to a billed church gets its
**free month**, then the days before its first full period are charged by the day. The annual
review moves each product's tier (Cross Events on event income, the App on active members), with
a notice of licence change per product. Customer page → Billing: the schedule, each product's
billing and the **next invoice** as it would be drafted today (`GET …/customers/:id/preview`).
Invoices, PDFs and emails name the products. Invoices made before 2.0 (one per licence) stay as
they were, and their drafts can still be recalculated.
### Changed
- **Cross Code Hub** in the dashboard, emails, PDFs and new two-factor set-ups (the `hel1.`
licence-token prefix stays: it's part of the protocol).
- Installs register with protocol v1 only with a Cross Events licence (`409 WRONG_PRODUCT`
otherwise); the other products register with protocol v2 (step 2). Only Cross Events licences
can be invoiced until billing per customer (step 4).
- Migrations `20261104132032_products`, `20261104150000_releases_per_product`.
otherwise); the other products register with protocol v2 (step 2).
- Migrations `20261104132032_products`, `20261104150000_releases_per_product`,
`20261104170000_billing_per_customer` (moves each billed licence's schedule to its customer,
so billing carries on unchanged).
## [1.7.0] - 2026-11-03