sinfactura-types 1.0.95 → 1.1.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 +25 -11
- package/dist/subscription.js +6 -2
- package/package.json +1 -1
package/dist/subscription.d.ts
CHANGED
|
@@ -5,24 +5,29 @@
|
|
|
5
5
|
* sinfactura/app/docs/plans/SUBSCRIPTION_BUSINESS_DECISIONS.md.
|
|
6
6
|
*
|
|
7
7
|
* Notes:
|
|
8
|
-
* - Tier names are the
|
|
9
|
-
*
|
|
8
|
+
* - Tier names are the 5 locked Spanish tiers (per SUBSCRIPTION_TIERS_BEST_PRACTICES §0
|
|
9
|
+
* and api#802 — the launch lineup is BÁSICO, EMPRENDEDOR, PROFESIONAL, AVANZADO,
|
|
10
|
+
* plus FUNDADOR for the pre-launch cohort).
|
|
11
|
+
* - `fundador` is BOTH a `PlanTier` (the cohort plan template seeded at api#802) and a
|
|
12
|
+
* pre-existing `SubscriptionStatus` value (kept for backward compat — the registration
|
|
13
|
+
* flow now sets status='active' on fundador subscriptions).
|
|
10
14
|
* - `FeatureKey` uses flat camelCase (not the dotted `reports.advanced` from the design kit).
|
|
11
15
|
* - Monetary amounts are integers in minor units (ARS cents) to avoid float issues.
|
|
12
16
|
* - WhatsApp-specific feature keys + `customDomain` are intentionally OUT of scope here;
|
|
13
17
|
* they ship with their own epics (#1072, #1152) after Product sign-off.
|
|
14
18
|
*/
|
|
15
19
|
declare global {
|
|
16
|
-
type PlanTier = 'basico' | 'emprendedor' | '
|
|
20
|
+
type PlanTier = 'basico' | 'emprendedor' | 'profesional' | 'avanzado' | 'fundador';
|
|
17
21
|
/**
|
|
18
22
|
* Lifecycle status of a tenant's subscription.
|
|
19
23
|
*
|
|
20
|
-
* - `trialing` — new signup in the 30-day
|
|
24
|
+
* - `trialing` — new signup in the 30-day PROFESIONAL trial (no payment method).
|
|
21
25
|
* - `active` — paid subscription, period current.
|
|
22
26
|
* - `past_due` — payment failed, in the 7-day grace window.
|
|
23
27
|
* - `readonly` — grace elapsed, writes blocked, tenant can still read.
|
|
24
28
|
* - `canceled` — tenant ended subscription; data retained per grace policy.
|
|
25
|
-
* - `fundador` — pre-
|
|
29
|
+
* - `fundador` — legacy pre-cohort status. Post-api#802, fundador subscriptions
|
|
30
|
+
* carry `status: 'active'` and are identified via `planTier === 'fundador'`.
|
|
26
31
|
*/
|
|
27
32
|
type SubscriptionStatus = 'trialing' | 'active' | 'past_due' | 'readonly' | 'canceled' | 'fundador';
|
|
28
33
|
type BillingCycle = 'monthly' | 'annual';
|
|
@@ -58,11 +63,11 @@ declare global {
|
|
|
58
63
|
* served to the frontend via GET /subscription/plans.
|
|
59
64
|
*
|
|
60
65
|
* Prices are integers in ARS cents (e.g. $40 000 = 4_000_000).
|
|
61
|
-
* `null` = "Contactar ventas" (
|
|
66
|
+
* `null` = "Contactar ventas" (AVANZADO, pre-unlock).
|
|
62
67
|
*/
|
|
63
68
|
interface Plan {
|
|
64
69
|
tier: PlanTier;
|
|
65
|
-
/** Display label — "BÁSICO", "EMPRENDEDOR", "
|
|
70
|
+
/** Display label — "BÁSICO", "EMPRENDEDOR", "PROFESIONAL", "AVANZADO", "FUNDADOR". */
|
|
66
71
|
label: string;
|
|
67
72
|
/** Short marketing tagline (Spanish). */
|
|
68
73
|
blurb?: string;
|
|
@@ -78,10 +83,10 @@ declare global {
|
|
|
78
83
|
* the plan row.
|
|
79
84
|
*/
|
|
80
85
|
isActive: boolean;
|
|
81
|
-
/** Marked as the anchor / recommended tier on the pricing page.
|
|
86
|
+
/** Marked as the anchor / recommended tier on the pricing page. PROFESIONAL at launch. */
|
|
82
87
|
isPopular?: boolean;
|
|
83
88
|
/**
|
|
84
|
-
* Visibility on the public pricing page.
|
|
89
|
+
* Visibility on the public pricing page. AVANZADO = `false` until
|
|
85
90
|
* ≥2 Planned features ship (per SUBSCRIPTION_TIERS_BEST_PRACTICES §0).
|
|
86
91
|
*/
|
|
87
92
|
isPublic: boolean;
|
|
@@ -107,8 +112,17 @@ declare global {
|
|
|
107
112
|
currentPeriodEnd: number;
|
|
108
113
|
/** Set while `status === 'trialing'`. Unix ms. */
|
|
109
114
|
trialEndsAt?: number;
|
|
110
|
-
/**
|
|
111
|
-
|
|
115
|
+
/**
|
|
116
|
+
* Founders cohort only — YYYY-MM-DD when the 12-month free PROFESIONAL
|
|
117
|
+
* entitlement window ends. Set on registration when `?mode=founders`
|
|
118
|
+
* is opted into and the cohort is open. String (not numeric ms) so it's
|
|
119
|
+
* human-readable in the DynamoDB console — matches api#802 verbatim.
|
|
120
|
+
*/
|
|
121
|
+
freeUntil?: string;
|
|
122
|
+
/** Founders cohort only — YYYY-MM-DD when the post-free grace period ends. */
|
|
123
|
+
graceUntil?: string;
|
|
124
|
+
/** Founders cohort only — eligible for the perpetual founder discount after cutoff. */
|
|
125
|
+
founderDiscountEligible?: boolean;
|
|
112
126
|
/** Stripe identifiers (absent for trialing/fundador before checkout). */
|
|
113
127
|
stripeCustomerId?: string;
|
|
114
128
|
stripeSubscriptionId?: string;
|
package/dist/subscription.js
CHANGED
|
@@ -5,8 +5,12 @@
|
|
|
5
5
|
* sinfactura/app/docs/plans/SUBSCRIPTION_BUSINESS_DECISIONS.md.
|
|
6
6
|
*
|
|
7
7
|
* Notes:
|
|
8
|
-
* - Tier names are the
|
|
9
|
-
*
|
|
8
|
+
* - Tier names are the 5 locked Spanish tiers (per SUBSCRIPTION_TIERS_BEST_PRACTICES §0
|
|
9
|
+
* and api#802 — the launch lineup is BÁSICO, EMPRENDEDOR, PROFESIONAL, AVANZADO,
|
|
10
|
+
* plus FUNDADOR for the pre-launch cohort).
|
|
11
|
+
* - `fundador` is BOTH a `PlanTier` (the cohort plan template seeded at api#802) and a
|
|
12
|
+
* pre-existing `SubscriptionStatus` value (kept for backward compat — the registration
|
|
13
|
+
* flow now sets status='active' on fundador subscriptions).
|
|
10
14
|
* - `FeatureKey` uses flat camelCase (not the dotted `reports.advanced` from the design kit).
|
|
11
15
|
* - Monetary amounts are integers in minor units (ARS cents) to avoid float issues.
|
|
12
16
|
* - WhatsApp-specific feature keys + `customDomain` are intentionally OUT of scope here;
|