platform-types 1.10.704 → 1.10.705

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.
@@ -13,8 +13,9 @@
13
13
  * (see `PlanCatalogue.trial`). A trial with no payment method drops to
14
14
  * `basico` (`active`, free-tier limits, no lock-out) on the first nightly
15
15
  * sweep after that date, unless a courtesy gift covers today. A Stripe
16
- * checkout adds its own fixed 30-day trial, which does not follow those
17
- * globals (ADR-0010) and is ended by Stripe's events. Courtesy
16
+ * checkout grants no trial of its own: it carries over what is left of the
17
+ * row's `trialEndsAt` (as `subscription_data.trial_end`) when that is at
18
+ * least 48 h + 5 min away, and bills from checkout otherwise. Courtesy
18
19
  * gifts (formerly the Founders cohort) are now a one-off ops action via
19
20
  * `gift-subscription` that sets `freeUntil` on the SUBSCRIPTION row.
20
21
  * - `freeUntil` lives on every Subscription independent of status. It is the
@@ -12,8 +12,9 @@
12
12
  * (see `PlanCatalogue.trial`). A trial with no payment method drops to
13
13
  * `basico` (`active`, free-tier limits, no lock-out) on the first nightly
14
14
  * sweep after that date, unless a courtesy gift covers today. A Stripe
15
- * checkout adds its own fixed 30-day trial, which does not follow those
16
- * globals (ADR-0010) and is ended by Stripe's events. Courtesy
15
+ * checkout grants no trial of its own: it carries over what is left of the
16
+ * row's `trialEndsAt` (as `subscription_data.trial_end`) when that is at
17
+ * least 48 h + 5 min away, and bills from checkout otherwise. Courtesy
17
18
  * gifts (formerly the Founders cohort) are now a one-off ops action via
18
19
  * `gift-subscription` that sets `freeUntil` on the SUBSCRIPTION row.
19
20
  * - `freeUntil` lives on every Subscription independent of status. It is the
@@ -38,7 +39,9 @@ declare global {
38
39
  * `trialTier` platform global with `trialEndsAt` set `trialDays` days out
39
40
  * (`PlanCatalogue.trial`) — once that date passes with no payment method the
40
41
  * nightly sweep drops the row to `basico`/`active` (unless a courtesy gift
41
- * covers today) — and a Stripe checkout adds its own fixed 30-day trial.
42
+ * covers today). A Stripe checkout carries over the remaining
43
+ * `trialEndsAt` when it is at least 48 h + 5 min away, else no trial —
44
+ * never a fresh fixed period.
42
45
  * - `active` — paid subscription, period current.
43
46
  * - `past_due` — payment failed, in the 7-day grace window.
44
47
  * - `readonly` — grace elapsed, writes blocked, tenant can still read.
@@ -223,17 +226,22 @@ declare global {
223
226
  /**
224
227
  * How a billing cycle of a plan can be bought:
225
228
  *
226
- * - `self` — self-serve checkout: the cycle has a charged price and the
227
- * plan has a `currency`.
229
+ * - `self` — self-serve checkout: the cycle has a charged price, the
230
+ * plan has a `currency`, and the plan is active.
228
231
  * - `sales` — the plan charges some cycle, but not this one self-serve
229
- * (no price on it, or no `currency`); route to "Contactar ventas".
232
+ * (no price on it, no `currency`, or `isActive: false`); route
233
+ * to "Contactar ventas". On `GET /subscription/plans` the
234
+ * caller's OWN hidden tier reads `self` instead, as checkout
235
+ * lets that store renew it.
230
236
  * - `none` — neither cycle is charged (the free tier); nothing to buy.
231
237
  */
232
238
  type PlanCheckoutMode = 'self' | 'sales' | 'none';
233
239
  /**
234
240
  * A sellable plan in the catalog, exactly as `GET /subscription/plans` and
235
241
  * `GET /public/plans` emit it — both build it with the same catalogue
236
- * builder, so the two endpoints return identical plans. The template fields
242
+ * builder, so the two endpoints return identical plans — except the
243
+ * caller's own hidden tier's `checkout` on `GET /subscription/plans` (see
244
+ * {@link PlanCheckoutMode}). The template fields
237
245
  * (copy, prices, flags) live in DynamoDB (`PLAN#{tier}` / `SK: PLAN`),
238
246
  * administered via `POST /platform/billing/plans` +
239
247
  * `PATCH /platform/billing/plans/{tier}`; `features` are code, rendered at
@@ -271,7 +279,9 @@ declare global {
271
279
  /**
272
280
  * Whether the plan is shown on the pricing page and accepting new
273
281
  * subscribers. Pre-launch / sales-led tiers set this `false` without
274
- * deleting the row.
282
+ * deleting the row. `POST /subscription/checkout` refuses a `false`
283
+ * tier with 400 `PLAN_NOT_PURCHASABLE` unless the store's subscription
284
+ * is already on it — existing subscribers on it may renew.
275
285
  */
276
286
  isActive: boolean;
277
287
  /**
@@ -12,8 +12,9 @@
12
12
  * (see `PlanCatalogue.trial`). A trial with no payment method drops to
13
13
  * `basico` (`active`, free-tier limits, no lock-out) on the first nightly
14
14
  * sweep after that date, unless a courtesy gift covers today. A Stripe
15
- * checkout adds its own fixed 30-day trial, which does not follow those
16
- * globals (ADR-0010) and is ended by Stripe's events. Courtesy
15
+ * checkout grants no trial of its own: it carries over what is left of the
16
+ * row's `trialEndsAt` (as `subscription_data.trial_end`) when that is at
17
+ * least 48 h + 5 min away, and bills from checkout otherwise. Courtesy
17
18
  * gifts (formerly the Founders cohort) are now a one-off ops action via
18
19
  * `gift-subscription` that sets `freeUntil` on the SUBSCRIPTION row.
19
20
  * - `freeUntil` lives on every Subscription independent of status. It is the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "platform-types",
3
- "version": "1.10.704",
3
+ "version": "1.10.705",
4
4
  "description": "Shared wire and entity contracts for the platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",