@drawbridge/drawbridge-agents 0.1.25 → 0.1.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -63,17 +63,31 @@ skill) so it stops living only in tribal memory.
|
|
|
63
63
|
|
|
64
64
|
## Billing / metering
|
|
65
65
|
|
|
66
|
-
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
66
|
+
- **Actions never touch Stripe's meter.** Every cycle invoice bills the period's ledger count as
|
|
67
|
+
invoice items priced from `plans.js` (drawbridge-sync `settleCycleUsage`). The meter was removed
|
|
68
|
+
after it produced five distinct defects, ending in a 60-second line-window overlap that billed
|
|
69
|
+
one correctly-delivered event twice. Do not reintroduce meter events, and do not "fix" a billing
|
|
70
|
+
discrepancy by reporting usage to Stripe — corrections are `billing.trueup` ledger rows.
|
|
71
|
+
- **`items.actions` is the record of what the customer was SOLD** — `{ limit,
|
|
72
|
+
overageCentsPerAction }`, written by drawbridge-stripe (≥0.1.44) at create/upgrade/downgrade and
|
|
73
|
+
read by drawbridge-sync at cycle close. plans.js is the default for NEW sales only; editing it
|
|
74
|
+
does not reprice existing customers (that is `repriceActionsSnapshot`, explicit and dry-runnable).
|
|
75
|
+
Anything adding custom/enterprise pricing must gate the plan-change paths and the reprice script
|
|
76
|
+
or negotiated values get silently overwritten. The rate is a NUMBER in cents — the string
|
|
77
|
+
`'2.5'` shape exists only at the Stripe `unit_amount_decimal` boundary.
|
|
78
|
+
- **No Stripe product backs actions (≥0.1.45).** Invoice items carry
|
|
79
|
+
currency/quantity/unit_amount_decimal/tax_behavior/description directly; the account keeps exactly
|
|
80
|
+
one product — the plan product behind `STRIPE_PRICE_*`. Never reintroduce a product-presence guard
|
|
81
|
+
in sync's billing: the old one skipped billing entirely for a productless subscription, which
|
|
82
|
+
would have zeroed every invoice once the products were archived.
|
|
83
|
+
- **The v2 pricing-plan layer (`bpp_*`, billing cadences) is never touched by script.** Canceling a
|
|
84
|
+
billing cadence is terminal and unrecoverable. Dashboard, by hand, only.
|
|
85
|
+
- **A subscription must open with the plan item.** It used to open with the metered actions price
|
|
86
|
+
and attach the plan afterwards with `always_invoice`. With no metered item, Stripe rejects an
|
|
87
|
+
itemless subscription, so the plan goes in at creation — changing the first invoice's shape.
|
|
88
|
+
- **Invoice line descriptions must keep the word "actions":** `isActionsLine` matches `/actions/i`
|
|
89
|
+
to count billed quantity for the billed-vs-ledger reconcile. A copy edit that drops it silently
|
|
90
|
+
breaks the audit. Detail: drawbridge-docs `reference/billing.md`.
|
|
77
91
|
- Every `$inc` on a `totals.*` counter needs a matching entry in `drawbridge-sync/lib/totals.js`
|
|
78
92
|
`SOURCES` — that map is the only drift backstop.
|
|
79
93
|
- The `invoice` collection's **unique partial index on `stripeInvoiceId`** (drawbridge-api
|
package/package.json
CHANGED