@drawbridge/drawbridge-agents 0.1.25 → 0.1.26
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,23 @@ 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
|
+
- **The actions PRODUCT is load-bearing; the meter and metered price are not.** drawbridge-stripe
|
|
72
|
+
(≥0.1.42) provisions only a product for actions, and drawbridge-sync prices its invoice lines
|
|
73
|
+
with `price_data.product` read from `items.actions.product`. Deactivating or dropping that
|
|
74
|
+
product breaks every future invoice — which is why api's `scripts.js removeActionsMeters` strips
|
|
75
|
+
the item, price and meter but never the product, and does not reuse
|
|
76
|
+
`stripeSubscription.deactivatableItems` (that includes it).
|
|
77
|
+
- **A subscription must open with the plan item.** It used to open with the metered actions price
|
|
78
|
+
and attach the plan afterwards with `always_invoice`. With no metered item, Stripe rejects an
|
|
79
|
+
itemless subscription, so the plan goes in at creation — changing the first invoice's shape.
|
|
80
|
+
- **Invoice line descriptions must keep the word "actions":** `isActionsLine` matches `/actions/i`
|
|
81
|
+
to count billed quantity for the billed-vs-ledger reconcile. A copy edit that drops it silently
|
|
82
|
+
breaks the audit. Detail: drawbridge-docs `reference/billing.md`.
|
|
77
83
|
- Every `$inc` on a `totals.*` counter needs a matching entry in `drawbridge-sync/lib/totals.js`
|
|
78
84
|
`SOURCES` — that map is the only drift backstop.
|
|
79
85
|
- The `invoice` collection's **unique partial index on `stripeInvoiceId`** (drawbridge-api
|
package/package.json
CHANGED