Billing & plans: operator edits are possible, safe
Goal: an operator can shape any plan through the console without Stripe drift or surprise charges. Tenant purchases never silently change an org's plan, and billing actions never 500. Consolidates drafts 7727, 7730, 7673, and items from 7681 (1) and 7660 (3).
1. An operator can empty a plan's monthly price: its monthly and yearly Prices are archived as `plans.archive_prices` does for yearly, and the plan reads "No price". This is allowed only with 0 subscribers (otherwise an actionable refusal). The field shows the rule while editing, not after Save.
2. Toggling "Priced per agent" on a plan with a flat price warns before Save that the amount will be charged per agent.
3. Then finish Task 7721 on dev (and main once promoted): Team per_agent=true, min 3, max 9, no price, self-serve No.
4. Renting a Shared node must never change the org's plan. Paying for a hosting flipped Org B from Enterprise to Individual. If a Stripe sync must change it, warn first.
5. Under Act as, Billing › Jaah AI › Switch (`PUT /api/org/jaah-ai/mode`, `put_jaah_ai_mode`) either works for the Owner seat or refuses in a sentence. Never a 500.
6. Billing › Subscription on an unchosen Business trial: "Choose Business trial" says what it does, or marks it current.
7. Products › Plans list: Status chips on one line, one-line blurbs stay one line at 1440px, muted labels on phone cards, and Delete offered only on retired plans.
Out of scope: price figures, plan terms, Stripe products of other plans.
Done means:
- API tests: PATCH plan with unit_amount=null on a 0-subscriber plan archives its Prices; with subscribers, refused. The act-as Switch path has a test; a hosting purchase leaves `plan_key` unchanged.
- On dev, GET /api/billing/plans shows team per_agent=true, 3–9, price=null.
- Screenshots of Plans at 1440px and 375px.
Required checks: ./dc check full
Outcome
PR #6189 merged (lane full gate). Operators can empty a plan's price (refused with subscribers), per-agent flip warns, act-as Jaah AI saves no longer 500, Plans list fixed. Team is per-agent 3–9 with no price on dev; main waits for promotion. Hosting flip not reproduced, filed as draft 7824.
Artifacts
Activity
- Created
- Run
- Runner started
- Runner ended (done)