sinfactura-types 1.2.0 → 1.4.0
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.
- package/dist/subscription.d.ts +37 -25
- package/dist/subscription.js +9 -7
- package/package.json +1 -1
package/dist/subscription.d.ts
CHANGED
|
@@ -2,15 +2,17 @@
|
|
|
2
2
|
* Subscription types — plan tiers, entitlements, feature matrix, subscription state.
|
|
3
3
|
*
|
|
4
4
|
* Ships app#710 (Chunk 1). Canonical decisions live in
|
|
5
|
-
* sinfactura/app/docs/plans/SUBSCRIPTION_BUSINESS_DECISIONS.md
|
|
5
|
+
* sinfactura/app/docs/plans/SUBSCRIPTION_BUSINESS_DECISIONS.md and
|
|
6
|
+
* sinfactura/app/docs/adr/0010-launch-trial-policy.md.
|
|
6
7
|
*
|
|
7
8
|
* Notes:
|
|
8
|
-
* - Tier names are the
|
|
9
|
-
* and api#802
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
9
|
+
* - Tier names are the 4 locked Spanish tiers (per SUBSCRIPTION_TIERS_BEST_PRACTICES §0
|
|
10
|
+
* and api#802): BÁSICO, EMPRENDEDOR, PROFESIONAL, AVANZADO. The launch policy
|
|
11
|
+
* (ADR-0010) gives every new paid subscription a 30-day Stripe trial; courtesy
|
|
12
|
+
* gifts (formerly the Founders cohort) are now a one-off ops action via
|
|
13
|
+
* `gift-subscription` that sets `freeUntil` on the SUBSCRIPTION row.
|
|
14
|
+
* - `freeUntil` lives on every Subscription independent of status. It is the
|
|
15
|
+
* courtesy-gift cutoff; while `freeUntil > now` the BE suppresses billing.
|
|
14
16
|
* - `FeatureKey` uses flat camelCase (not the dotted `reports.advanced` from the design kit).
|
|
15
17
|
* - Monetary amounts are integers in minor units (ARS cents) to avoid float issues.
|
|
16
18
|
* - Feature keys now match the BE wire format directly (renamed afip→afipInvoicing,
|
|
@@ -20,19 +22,21 @@
|
|
|
20
22
|
* enabled:false until they do.
|
|
21
23
|
*/
|
|
22
24
|
declare global {
|
|
23
|
-
type PlanTier = 'basico' | 'emprendedor' | 'profesional' | 'avanzado'
|
|
25
|
+
type PlanTier = 'basico' | 'emprendedor' | 'profesional' | 'avanzado';
|
|
24
26
|
/**
|
|
25
27
|
* Lifecycle status of a tenant's subscription.
|
|
26
28
|
*
|
|
27
|
-
* - `trialing` — new signup in
|
|
29
|
+
* - `trialing` — new paid-tier signup in their 30-day Stripe trial.
|
|
28
30
|
* - `active` — paid subscription, period current.
|
|
29
31
|
* - `past_due` — payment failed, in the 7-day grace window.
|
|
30
32
|
* - `readonly` — grace elapsed, writes blocked, tenant can still read.
|
|
31
33
|
* - `canceled` — tenant ended subscription; data retained per grace policy.
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
+
*
|
|
35
|
+
* Courtesy gifts (formerly the Founders cohort, ADR-0009) are no longer a
|
|
36
|
+
* status — they are represented by `Subscription.freeUntil` on top of any
|
|
37
|
+
* normal status. See ADR-0010.
|
|
34
38
|
*/
|
|
35
|
-
type SubscriptionStatus = 'trialing' | 'active' | 'past_due' | 'readonly' | 'canceled'
|
|
39
|
+
type SubscriptionStatus = 'trialing' | 'active' | 'past_due' | 'readonly' | 'canceled';
|
|
36
40
|
type BillingCycle = 'monthly' | 'annual';
|
|
37
41
|
/**
|
|
38
42
|
* Shape of a single entitlement on a (tier, feature) cell.
|
|
@@ -125,9 +129,8 @@ declare global {
|
|
|
125
129
|
description: string;
|
|
126
130
|
/**
|
|
127
131
|
* Whether the plan is shown on the pricing page and accepting new
|
|
128
|
-
* subscribers.
|
|
129
|
-
*
|
|
130
|
-
* set this to `false` without deleting the plan row.
|
|
132
|
+
* subscribers. Pre-launch / sales-led tiers (e.g. AVANZADO until ≥2
|
|
133
|
+
* Planned features ship) set this to `false` without deleting the row.
|
|
131
134
|
*/
|
|
132
135
|
isActive: boolean;
|
|
133
136
|
/**
|
|
@@ -146,7 +149,7 @@ declare global {
|
|
|
146
149
|
/**
|
|
147
150
|
* Currency the prices are denominated in. `'ARS'` at launch; `'USD'`
|
|
148
151
|
* is the migration target (api#841). `null` on free / off-billing
|
|
149
|
-
* tiers (basico
|
|
152
|
+
* tiers (basico).
|
|
150
153
|
*/
|
|
151
154
|
currency: 'ARS' | 'USD' | null;
|
|
152
155
|
/**
|
|
@@ -160,6 +163,18 @@ declare global {
|
|
|
160
163
|
* Boolean features carry `enabled`; numeric/metered carry `limit`.
|
|
161
164
|
*/
|
|
162
165
|
features: PlanFeature[];
|
|
166
|
+
/**
|
|
167
|
+
* Marketing-curated short bullets shown on the customer-facing
|
|
168
|
+
* pricing card. Display order = array order. Recommended 3-5
|
|
169
|
+
* entries; the BE allows up to 6, each up to 80 chars (one card
|
|
170
|
+
* line). Always present — empty array when no bullets are set
|
|
171
|
+
* (FE then falls back to a synthesized list from `features[]`).
|
|
172
|
+
*
|
|
173
|
+
* Lifted onto the row in api#869 to let marketing tweak copy via
|
|
174
|
+
* `/sa/plans` without a redeploy. Replaces the FE-only
|
|
175
|
+
* `BULLET_LIST_BY_TIER` constant.
|
|
176
|
+
*/
|
|
177
|
+
bullets: string[];
|
|
163
178
|
}
|
|
164
179
|
/**
|
|
165
180
|
* One audit row per SUPER_ADMIN-driven plan mutation. Returned by
|
|
@@ -207,17 +222,13 @@ declare global {
|
|
|
207
222
|
/** Set while `status === 'trialing'`. Unix ms. */
|
|
208
223
|
trialEndsAt?: number;
|
|
209
224
|
/**
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
225
|
+
* Courtesy-gift cutoff (ADR-0010) — YYYY-MM-DD up to which billing is
|
|
226
|
+
* suppressed regardless of `status`. String (not numeric ms) so it's
|
|
227
|
+
* human-readable in the DynamoDB console. Set/cleared via the
|
|
228
|
+
* `gift-subscription` super endpoint with an audit-logged reason.
|
|
214
229
|
*/
|
|
215
230
|
freeUntil?: string;
|
|
216
|
-
/**
|
|
217
|
-
graceUntil?: string;
|
|
218
|
-
/** Founders cohort only — eligible for the perpetual founder discount after cutoff. */
|
|
219
|
-
founderDiscountEligible?: boolean;
|
|
220
|
-
/** Stripe identifiers (absent for trialing/fundador before checkout). */
|
|
231
|
+
/** Stripe identifiers (absent before first checkout). */
|
|
221
232
|
stripeCustomerId?: string;
|
|
222
233
|
stripeSubscriptionId?: string;
|
|
223
234
|
/**
|
|
@@ -270,6 +281,7 @@ declare global {
|
|
|
270
281
|
currentPeriodStart: number | null;
|
|
271
282
|
currentPeriodEnd: number | null;
|
|
272
283
|
trialEndsAt: number | null;
|
|
284
|
+
/** Courtesy-gift cutoff (ADR-0010). YYYY-MM-DD or omitted. */
|
|
273
285
|
freeUntil?: string;
|
|
274
286
|
cancelAt: number | null;
|
|
275
287
|
canceledAt: number | null;
|
package/dist/subscription.js
CHANGED
|
@@ -2,15 +2,17 @@
|
|
|
2
2
|
* Subscription types — plan tiers, entitlements, feature matrix, subscription state.
|
|
3
3
|
*
|
|
4
4
|
* Ships app#710 (Chunk 1). Canonical decisions live in
|
|
5
|
-
* sinfactura/app/docs/plans/SUBSCRIPTION_BUSINESS_DECISIONS.md
|
|
5
|
+
* sinfactura/app/docs/plans/SUBSCRIPTION_BUSINESS_DECISIONS.md and
|
|
6
|
+
* sinfactura/app/docs/adr/0010-launch-trial-policy.md.
|
|
6
7
|
*
|
|
7
8
|
* Notes:
|
|
8
|
-
* - Tier names are the
|
|
9
|
-
* and api#802
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
9
|
+
* - Tier names are the 4 locked Spanish tiers (per SUBSCRIPTION_TIERS_BEST_PRACTICES §0
|
|
10
|
+
* and api#802): BÁSICO, EMPRENDEDOR, PROFESIONAL, AVANZADO. The launch policy
|
|
11
|
+
* (ADR-0010) gives every new paid subscription a 30-day Stripe trial; courtesy
|
|
12
|
+
* gifts (formerly the Founders cohort) are now a one-off ops action via
|
|
13
|
+
* `gift-subscription` that sets `freeUntil` on the SUBSCRIPTION row.
|
|
14
|
+
* - `freeUntil` lives on every Subscription independent of status. It is the
|
|
15
|
+
* courtesy-gift cutoff; while `freeUntil > now` the BE suppresses billing.
|
|
14
16
|
* - `FeatureKey` uses flat camelCase (not the dotted `reports.advanced` from the design kit).
|
|
15
17
|
* - Monetary amounts are integers in minor units (ARS cents) to avoid float issues.
|
|
16
18
|
* - Feature keys now match the BE wire format directly (renamed afip→afipInvoicing,
|