docs: add storage billing decisions D7-D12 (hybrid prepaid, Free tier signup, restart OK pre-launch, alerts only, non-payment restriction, pricing.ts authoritative)

Docs only; no runtime code changes.
This commit is contained in:
Grok Bot 2026-10-06 13:19:37 -04:00
commit 0895f6bdda
3 changed files with 16 additions and 7 deletions

View file

@ -27,8 +27,8 @@ on the **Customers** tab:
- **Stripe** — metered usage is reported to Stripe by the daily billing job.
*Decided 2026-10-06, not yet implemented:* Stripe customers are collected
through a **Stripe subscription**. For Peergos storage that means a base price
item plus a metered overage item. Stripe issues and collects those invoices;
the prepaid balance is not the collection path for them. See
item plus a metered overage item. Stripe issues and collects those invoices,
after any prepaid balance is applied first (D7, hybrid). See
[PEERGOS-BILLING.md](PEERGOS-BILLING.md) ("Storage billing decisions").
- **Purchase order** — invoiced manually with a PO number; issued PO invoices
get a 30-day due date automatically.
@ -43,7 +43,8 @@ Partial coverage is left untouched — there are no partial payments.
> **Note (decision D1, 2026-10-06):** prepaid drawdown at issue describes the
> current code. Once Stripe subscriptions are live, Stripe-billed customers pay
> through their subscription and PO customers through the invoice run below.
> How existing prepaid balances migrate is still an open question.
> Prepaid balances stay: they are applied first to
> the Stripe invoice, and the subscription bills the remainder (D7).
---

View file

@ -71,8 +71,10 @@ Only your own invoices are visible; other customers' ids return "not found".
> **Planned change (decision D1, 2026-10-06):** card-billed (Stripe) customers
> will pay through a Stripe subscription, which for Peergos storage means a base
> plan plus metered overage, prorated for partial months. Reloads and prepaid
> drawdown describe the current behavior only.
> plan plus metered overage, prorated for partial months. Reload stays available:
> the prepaid balance is applied first and the subscription bills the remainder
> (D7). Free-tier users need no card; unpaid invoices restrict storage access
> until paid (D8, D11).
## 6. Security: two-factor authentication

View file

@ -83,10 +83,16 @@ These are decided but **not implemented in this code yet**. The design is in
| # | Decision |
|---|----------|
| D1 | **Stripe customers** pay for storage through a **Stripe subscription**: a storage base price item plus a metered storage overage item. They are not collected from the prepaid balance. **PO customers** stay on the existing invoice run (Generate → Issue with PO number and 30-day due date). |
| D1 | **Stripe customers** pay for storage through a **Stripe subscription**: a storage base price item plus a metered storage overage item. Any prepaid balance is applied first (D7). **PO customers** stay on the existing invoice run (Generate → Issue with PO number and 30-day due date). |
| D2 | The timestamp tier's **monthly credit counts against storage charges** (base and overage), as `buildInvoice` already does for all lines. |
| D3 | **Every Peergos user must have a Verae (zap.verae.ai) customer account.** App signup creates or links one. There are no unlinked users, so the `cust-platform` default above is to be retired. |
| D4 | **Partial months are prorated** (storage base fee and included GB). |
| D5 | **Storage overage markup is 25% (×1.25)**, matching `DEFAULT_STORAGE_OVERAGE_MARKUP_BPS = 2500`. |
| D6 | **Hitting an overage level never blocks storage.** Usage continues and overage is billed at month end. Peergos quotas are raised automatically ahead of usage. |
| D6 | **Hitting an overage level never blocks storage** for accounts in good standing (D11 covers non-payment). Usage continues and overage is billed at month end. Peergos quotas are raised automatically ahead of usage. |
| D7 | **Hybrid prepaid + subscription.** Keep both. The prepaid balance (`balance_cents`) is applied first, as a negative item on the Stripe draft invoice keyed by invoice id. The subscription bills only the remainder, with no double billing. Portal Reload stays. |
| D8 | **New app signups start on the Free tier** (1 GB included, $1.00 monthly credit, 20 stamps), with **no card required**. Overage is invoiced at month end. Access is restricted while an invoice is unpaid (D11). |
| D9 | **Restarting the ns2 (137) Peergos container is allowed at any time until George says real customers are live.** This is recorded only. |
| D10 | **Runaway usage triggers alerts only, with no hard ceiling.** Alerts go to George by default, through the admin portal and email (`STORAGE_ALERT_EMAILS`). The thresholds are in the design doc §3.12. |
| D11 | **Failed or unpaid payment:** quota auto-raise pauses and file access is restricted until the invoice is paid. Enforcement pins the Peergos quota to current usage: no new writes, while deletes and downloads still work. The app shows a pay-now screen. See design doc §3.11. |
| D12 | **`src/pricing.ts` is the authoritative rate card.** The old veraetimestamps.com prices ($0.50/stamp, $49 plan) were placeholders. The site now mirrors this file. |