platform-types 1.10.703 → 1.10.704

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.
@@ -10,9 +10,11 @@
10
10
  * - Tier names are the 4 locked Spanish tiers (per SUBSCRIPTION_TIERS_BEST_PRACTICES §0):
11
11
  * BÁSICO, EMPRENDEDOR, PROFESIONAL, AVANZADO. A new store starts trialing on
12
12
  * the `trialTier` platform global, with `trialEndsAt` set `trialDays` days out
13
- * (see `PlanCatalogue.trial`); that date is not yet enforced for a store
14
- * without a payment provider. A Stripe checkout adds its own fixed 30-day
15
- * trial, which does not follow those globals (ADR-0010). Courtesy
13
+ * (see `PlanCatalogue.trial`). A trial with no payment method drops to
14
+ * `basico` (`active`, free-tier limits, no lock-out) on the first nightly
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
18
  * gifts (formerly the Founders cohort) are now a one-off ops action via
17
19
  * `gift-subscription` that sets `freeUntil` on the SUBSCRIPTION row.
18
20
  * - `freeUntil` lives on every Subscription independent of status. It is the
package/dist/store.d.ts CHANGED
@@ -829,10 +829,16 @@ declare global {
829
829
  * writes `planTier: 'basico'` on a delinquent store at day 14. A security
830
830
  * posture does not lapse because an invoice did.
831
831
  *
832
- * Verified rather than assumed: `graceSweep` writes only `status`,
833
- * `planTier`, `canceledFromTier`, `canceledAt` and `updatedAt`, and writes
834
- * them to the SUBSCRIPTION row — it touches neither `totp` nor store
835
- * config. So an obligation kept here survives the downgrade **by
832
+ * Verified rather than assumed: on the SUBSCRIPTION row `graceSweep`
833
+ * writes `status`, `planTier`, `pastDueSince`, `canceledFromTier`,
834
+ * `canceledAt`, `trialEndingNotifiedAt` and `updatedAt`, SETs
835
+ * `trialEndedFromTier` and REMOVEs `trialEndsAt` on a trial expiry, and
836
+ * REMOVEs `pastDueSince` and `trialEndedFromTier` on a cancel. Its other
837
+ * writes are its checkpoint row, ERROR rows and the shop-grace reconcile,
838
+ * which SETs only the STORE row's `ecommerce.deactivatesAt` and
839
+ * `updatedAt` (plus its own grace rows and custom-domain rows'
840
+ * `deactivatesAt`) — none of them touches `totp` or anything under
841
+ * `config`. So an obligation kept here survives the downgrade **by
836
842
  * construction**, with no special case for anyone to remember and nothing
837
843
  * to re-check when the sweep changes.
838
844
  *
@@ -9,9 +9,11 @@
9
9
  * - Tier names are the 4 locked Spanish tiers (per SUBSCRIPTION_TIERS_BEST_PRACTICES §0):
10
10
  * BÁSICO, EMPRENDEDOR, PROFESIONAL, AVANZADO. A new store starts trialing on
11
11
  * the `trialTier` platform global, with `trialEndsAt` set `trialDays` days out
12
- * (see `PlanCatalogue.trial`); that date is not yet enforced for a store
13
- * without a payment provider. A Stripe checkout adds its own fixed 30-day
14
- * trial, which does not follow those globals (ADR-0010). Courtesy
12
+ * (see `PlanCatalogue.trial`). A trial with no payment method drops to
13
+ * `basico` (`active`, free-tier limits, no lock-out) on the first nightly
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
17
  * gifts (formerly the Founders cohort) are now a one-off ops action via
16
18
  * `gift-subscription` that sets `freeUntil` on the SUBSCRIPTION row.
17
19
  * - `freeUntil` lives on every Subscription independent of status. It is the
@@ -34,8 +36,9 @@ declare global {
34
36
  *
35
37
  * - `trialing` — a trial on a paid tier: a new store trials on the
36
38
  * `trialTier` platform global with `trialEndsAt` set `trialDays` days out
37
- * (`PlanCatalogue.trial`) — a date not yet enforced for a store without a
38
- * payment provider — and a Stripe checkout adds its own fixed 30-day trial.
39
+ * (`PlanCatalogue.trial`) — once that date passes with no payment method the
40
+ * 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.
39
42
  * - `active` — paid subscription, period current.
40
43
  * - `past_due` — payment failed, in the 7-day grace window.
41
44
  * - `readonly` — grace elapsed, writes blocked, tenant can still read.
@@ -336,8 +339,10 @@ declare global {
336
339
  groups: PlanFeatureGroup[];
337
340
  /**
338
341
  * What a store registered now starts on: `tier` — a paid tier — in status
339
- * `trialing`, with `trialEndsAt` set `days` days out. That date is not yet
340
- * enforced for a store without a payment provider. Resolved from the platform globals
342
+ * `trialing`, with `trialEndsAt` set `days` days out. A store that has
343
+ * attached no payment method by then drops to `basico` (`active`, free-tier
344
+ * limits) on the first nightly sweep after that date, unless a courtesy gift
345
+ * covers today. Resolved from the platform globals
341
346
  * `trialTier` / `trialDays` — `profesional` / `30` when unset or invalid —
342
347
  * so it is always present.
343
348
  */
@@ -502,6 +507,16 @@ declare global {
502
507
  * field existed — forward-only, readers fall back to generic copy.
503
508
  */
504
509
  canceledFromTier?: PlanTier | null;
510
+ /**
511
+ * The paid tier a trial ran on when it lapsed with no payment method —
512
+ * set only by the grace sweep when it moves a provider-less `trialing`
513
+ * row (no provider, no provider subscription or customer id) whose
514
+ * `trialEndsAt` has passed to `basico`/`active`. Cleared (`null`) when
515
+ * the store re-subscribes to a paid tier or is canceled — a cancel
516
+ * records its own lost plan in `canceledFromTier`. `null` when absent —
517
+ * every row that never expired that way, or has moved on since.
518
+ */
519
+ trialEndedFromTier?: PlanTier | null;
505
520
  entitlements: SubscriptionEntitlementEntry[];
506
521
  usage: SubscriptionUsageEntry[];
507
522
  }
@@ -608,6 +623,8 @@ declare global {
608
623
  * it together with `provider`.
609
624
  */
610
625
  mode?: 'preapproval' | 'manual';
626
+ /** The paid tier an expired trial dropped from; `null` when a write cleared it. */
627
+ trialEndedFromTier?: PlanTier | null;
611
628
  };
612
629
  /**
613
630
  * One audit row for a MANAGER out-of-band subscription change, as returned by
@@ -616,6 +633,13 @@ declare global {
616
633
  * `AUDIT#SUBSCRIPTION#{storeId}` partition. `before`/`after` carry the
617
634
  * subscription fields an operator can change.
618
635
  *
636
+ * The partition also carries SYSTEM-written `subscription.trial_expired`
637
+ * rows from the grace sweep: `actor` is empty (`userId: ''`,
638
+ * `fullName: ''`), `before` holds the trial's `status`/`planTier`/
639
+ * `trialEndsAt`, and `after` holds `status: 'active'`,
640
+ * `planTier: 'basico'`, `trialEndsAt: null` and `trialEndedFromTier`
641
+ * (the trial's tier).
642
+ *
619
643
  * ⚠️ The same partition also carries entitlement-override and advancedPricing
620
644
  * rows whose `before`/`after` hold different keys, so consumers must read
621
645
  * each side structurally rather than trusting every field to be present.
@@ -9,9 +9,11 @@
9
9
  * - Tier names are the 4 locked Spanish tiers (per SUBSCRIPTION_TIERS_BEST_PRACTICES §0):
10
10
  * BÁSICO, EMPRENDEDOR, PROFESIONAL, AVANZADO. A new store starts trialing on
11
11
  * the `trialTier` platform global, with `trialEndsAt` set `trialDays` days out
12
- * (see `PlanCatalogue.trial`); that date is not yet enforced for a store
13
- * without a payment provider. A Stripe checkout adds its own fixed 30-day
14
- * trial, which does not follow those globals (ADR-0010). Courtesy
12
+ * (see `PlanCatalogue.trial`). A trial with no payment method drops to
13
+ * `basico` (`active`, free-tier limits, no lock-out) on the first nightly
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
17
  * gifts (formerly the Founders cohort) are now a one-off ops action via
16
18
  * `gift-subscription` that sets `freeUntil` on the SUBSCRIPTION row.
17
19
  * - `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.703",
3
+ "version": "1.10.704",
4
4
  "description": "Shared wire and entity contracts for the platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",