Phase 14, parts 5 and 6: seats, and moving down to Free

Seats: inviting past the seats paid for offers the owner to add one
(Stripe prorates it); admins are told to ask the owner; Free has two.
Moving down: past the plan's seats, the owner and one other (the owner's
pick, or the first to join) edit and the rest read; storage is measured
hourly, and past the plan's, photo uploads and the SEO crawl stop.
Nothing is deleted. TEST.md section 18.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-25 13:34:22 -07:00
co-authored by Claude Opus 5.5
parent aa0408fb14
commit 6d3eb18b5e
16 changed files with 573 additions and 6 deletions
+46 -1
View File
@@ -19,7 +19,7 @@ are run first on the local edition, on this computer. Then:
|---|---|---|
| **Local** | `install.sh` / `./update.sh`, at <http://localhost:8470> | 1–13, 14 (local part), 15 |
| **Server, with the Core** | `./install-server.sh` on a server (or a test machine, with Caddy's own CA), its Core's domain entered under Settings → Core & Hermes | 14, 15 (agents on a server), 16, and a quick run through 2–10 as a member with only some modules |
| **Multi-tenant** | `compose.multi.yaml` with a Postgres and a Garage bucket (`multi.env`), `SUPERMARKET_PLATFORM_ADMINS` set | 17, and 16 for a team's Core sign-in |
| **Multi-tenant** | `compose.multi.yaml` with a Postgres and a Garage bucket (`multi.env`), `SUPERMARKET_PLATFORM_ADMINS` set | 17, 18 (with Stripe's test mode), and 16 for a team's Core sign-in |
On the server and multi-tenant passes, sign in as different people (an
owner, an admin, a member with one module) in separate browser profiles or
@@ -953,3 +953,48 @@ Hermes:
- [ ] Restart one copy: people stay signed in, and the others carry on
the background work.
## 18. Billing (Phase 14)
Multi-tenant only, with Stripe in **test mode**: `SUPERMARKET_STRIPE_KEY`
(`sk_test_…`), `SUPERMARKET_STRIPE_PRICE` (a monthly per-person price),
and `SUPERMARKET_STRIPE_WEBHOOK_SECRET` from `stripe listen --forward-to
https://<domain>/billing/stripe` (or a webhook endpoint in the dashboard
with `checkout.session.completed`, `customer.subscription.*`,
`invoice.paid` and `invoice.payment_failed`). Pay with Stripe's test card
4242 4242 4242 4242. Some steps need time to pass: set the dates in the
`billing` table, then wait for the hourly turn (or restart a copy).
- [ ] Without the Stripe key, a team has everything and there's no
Settings → Billing.
- [ ] A new team is on a 14-day trial of Paid: Settings → Billing says so,
with people, agents, storage and the crawl against the plan's.
Admins see the plan without the buttons.
- [ ] *Subscribe with Stripe* (the owner) goes to Checkout with the
people as the quantity; paying brings you back, and the page soon
shows *Active*, the seats paid for, and the next invoice.
- [ ] *Open Stripe's billing page* opens the Customer Portal; cancelling
there ends the subscription at the period's end, and the page
follows.
- [ ] Each change shows in Activity ("billing changed"). Sending the same
event again (`stripe events resend`) changes nothing.
- [ ] A trial that ends without a subscription drops to Free, and the
owner gets an email. Prospects, Metrics and Sites can be read, not
changed ("The Free plan doesn't include…"); their jobs stop. One
agent, ten Market entries, a 500-page weekly crawl.
- [ ] A failed payment (test card 4000 0000 0000 0341, then a renewal):
a banner on every page (*Pay now* for the owner), and an email.
14 days on: read-only, agents refused, an email. 53 days: everyone
warned. 60: the team closes as being deleted, everyone emailed;
the owner's *Undo* gives a week more to pay.
- [ ] Paying the overdue invoice clears the banner and read-only.
- [ ] Seats: inviting past the seats paid for offers the owner *Add a seat
for them* (Stripe's next invoice shows the proration); an admin is
told to ask the owner. On Free, past two people: *subscribe*.
- [ ] Moving down to Free with more than two people: the owner and one
other edit (the first to join, until the owner chooses under
Settings → Billing); the rest read, and are told why. No one is
removed.
- [ ] Storage: Settings → Billing shows what the team stores (within the
hour). Past the plan's (set `storage_used` high to try it), a photo
upload says the storage is full and the SEO crawl waits. Exports
still work.