Hub 2.0 step 1: products foundation

- Product enum (events, accounts, website, app) on Licence and Install,
  Install.publicKey; existing rows are events
- One open licence per product per customer: partial unique index, with a
  migration guard that names customers with duplicates (npm run check:hub2
  lists them beforehand)
- Licence keys per product (CEH-, CCA-, CCW-, CCP-); free Accounts licence
  created with the first other product licence
- Protocol v1 registers Events licences only (409 WRONG_PRODUCT); only Events
  licences can be invoiced until billing per customer
- Cross Code Hub in the UI, emails and PDFs
- @crosscode/contracts 1.0.0 vendored (backend/vendor)
- Steps merge into release/2.0, not main (plan updated)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-04 15:28:06 +02:00
co-authored by Claude Opus 5.5
parent fe0f2638c6
commit ad602b2846
30 changed files with 544 additions and 49 deletions
+26
View File
@@ -5,6 +5,32 @@ versions follow [Semantic Versioning](https://semver.org/).
## [Unreleased]
Hub 2.0.0, Cross Code Hub, in steps (`docs/HUB-2.0-PLAN.md`).
### Added
- **Products** (step 1): a licence and an install are for one product: Cross Events, Accounts,
Church Website or Church App (existing ones are Cross Events). Generate a licence for a product
on the customer's page; keys have the product's prefix (`CEH-` Events as before, `CCA-`
Accounts, `CCW-` Website, `CCP-` App).
- **One licence per product per customer** that isn't revoked (a revoked one can be replaced),
enforced by the database. Un-revoking a licence whose product has another open licence is
refused.
- **Accounts licence** (free, never invoiced) created automatically with a customer's first other
product licence.
- `npm run check:hub2`: before deploying 2.0, lists customers with two open licences (the 2.0
migration stops on them, naming them). Run it against production first.
- `@crosscode/contracts` 1.0.0, committed as `backend/vendor/crosscode-contracts-1.0.0.tgz`.
### 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).
- Migration `20261104132032_products`.
## [1.7.0] - 2026-11-03
### Added