@happyvertical/smrt-subscriptions 0.40.70 → 0.41.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/AGENTS.md +35 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +85 -3
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +155 -114
- package/dist/migrations/moneyMinorUnits.d.ts +31 -0
- package/dist/migrations/moneyMinorUnits.d.ts.map +1 -0
- package/dist/models/SubscriptionPlan.d.ts +5 -0
- package/dist/models/SubscriptionPlan.d.ts.map +1 -1
- package/dist/models/commercial.d.ts +23 -0
- package/dist/models/commercial.d.ts.map +1 -1
- package/dist/services/commercial.d.ts +26 -0
- package/dist/services/commercial.d.ts.map +1 -1
- package/dist/smrt-knowledge.json +28 -13
- package/dist/svelte/CommercialOverview.svelte +21 -1
- package/dist/svelte/CommercialOverview.svelte.d.ts +1 -0
- package/dist/svelte/CommercialOverview.svelte.d.ts.map +1 -1
- package/dist/svelte/PlanPicker.svelte +21 -4
- package/dist/svelte/PlanPicker.svelte.d.ts +1 -0
- package/dist/svelte/PlanPicker.svelte.d.ts.map +1 -1
- package/dist/svelte/PlanPicker.test.js +31 -0
- package/package.json +6 -5
|
@@ -28,7 +28,19 @@ export declare class ClientCharge extends SmrtObject {
|
|
|
28
28
|
provider: string;
|
|
29
29
|
serviceKey: string;
|
|
30
30
|
metricKey: string;
|
|
31
|
+
/**
|
|
32
|
+
* Metered quantity — genuinely fractional (`duration.seconds`, token counts
|
|
33
|
+
* scaled by a rate), so it stays DECIMAL.
|
|
34
|
+
*/
|
|
31
35
|
quantity: number;
|
|
36
|
+
/**
|
|
37
|
+
* Charge in **integer minor units** of {@link currency} (#2401).
|
|
38
|
+
*
|
|
39
|
+
* Summed against {@link BillingAdjustment.amount} and compared against
|
|
40
|
+
* {@link SpendingPolicy.limitAmount}, so all three carry the same unit —
|
|
41
|
+
* `CommercialService.calculateAmount()` rounds to a whole minor unit at the
|
|
42
|
+
* one boundary where the fractional pricing terms meet money.
|
|
43
|
+
*/
|
|
32
44
|
amount: number;
|
|
33
45
|
currency: string;
|
|
34
46
|
pricingRuleId: string;
|
|
@@ -41,6 +53,12 @@ export declare class ClientCharge extends SmrtObject {
|
|
|
41
53
|
export declare class BillingAdjustment extends SmrtObject {
|
|
42
54
|
tenantId?: string;
|
|
43
55
|
clientChargeId: string;
|
|
56
|
+
/**
|
|
57
|
+
* Signed correction in **integer minor units**, same unit as
|
|
58
|
+
* {@link ClientCharge.amount} it adjusts. Negative values are legitimate
|
|
59
|
+
* (a credit) — that is why the non-negative guard in
|
|
60
|
+
* `CommercialService.calculateAmount()` does not apply here (#2401).
|
|
61
|
+
*/
|
|
44
62
|
amount: number;
|
|
45
63
|
currency: string;
|
|
46
64
|
reason: string;
|
|
@@ -59,6 +77,11 @@ export declare class SpendingPolicy extends SmrtObject {
|
|
|
59
77
|
metricKey: string;
|
|
60
78
|
period: SpendingPeriod;
|
|
61
79
|
rollingSeconds: number;
|
|
80
|
+
/**
|
|
81
|
+
* Spending cap in **integer minor units** of {@link currency}. Compared
|
|
82
|
+
* directly against the sum of `ClientCharge.amount` + `BillingAdjustment`s
|
|
83
|
+
* plus the caller's estimate, so it must carry the same unit (#2401).
|
|
84
|
+
*/
|
|
62
85
|
limitAmount: number;
|
|
63
86
|
currency: string;
|
|
64
87
|
behavior: SpendingPolicyBehavior;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commercial.d.ts","sourceRoot":"","sources":["../../src/models/commercial.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,EACd,UAAU,EAEX,MAAM,0BAA0B,CAAC;AAGlC,MAAM,MAAM,eAAe,GACvB,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,QAAQ,GACR,kBAAkB,GAClB,MAAM,GACN,QAAQ,CAAC;AACb,MAAM,MAAM,sBAAsB,GAC9B,SAAS,GACT,MAAM,GACN,OAA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,CAAC,WAAW,CAAC;IACpE,MAAM,CAAC,QAAQ,CAAC,UAAU,qBAAe;CAC1C;AACD,qBAAa,sBAAuB,SAAQ,cAAc,CAAC,YAAY,CAAC;IACtE,MAAM,CAAC,QAAQ,CAAC,UAAU,sBAAgB;CAC3C;AACD,qBAAa,2BAA4B,SAAQ,cAAc,CAAC,iBAAiB,CAAC;IAChF,MAAM,CAAC,QAAQ,CAAC,UAAU,2BAAqB;CAChD;AACD,qBAAa,wBAAyB,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC1E,MAAM,CAAC,QAAQ,CAAC,UAAU,wBAAkB;CAC7C"}
|
|
@@ -28,13 +28,38 @@ export declare class CommercialUsageService {
|
|
|
28
28
|
record(options: RecordUsageOptions): Promise<import('../index.js').TenantUsageMetric>;
|
|
29
29
|
price(options: PriceUsageOptions): Promise<ClientCharge>;
|
|
30
30
|
private approveCharge;
|
|
31
|
+
/**
|
|
32
|
+
* Append a signed correction to an approved charge.
|
|
33
|
+
*
|
|
34
|
+
* @param amount - Signed correction in **integer minor units**, same unit as
|
|
35
|
+
* the charge (#2401). Negative is legitimate — that is a credit. A
|
|
36
|
+
* fractional value is rejected rather than silently rounded, because it
|
|
37
|
+
* almost always means the caller passed major units.
|
|
38
|
+
*/
|
|
31
39
|
adjust(chargeId: string, amount: number, reason: string, source?: string, sourceId?: string): Promise<import('../index.js').BillingAdjustment>;
|
|
40
|
+
/**
|
|
41
|
+
* Price one usage event, in **integer minor units** (#2401).
|
|
42
|
+
*
|
|
43
|
+
* The pricing terms stay fractional on purpose — a per-token rate is
|
|
44
|
+
* routinely a fraction of a cent, and an integer `unitPrice` would truncate
|
|
45
|
+
* it to zero — so terms are read as *minor units per unit of usage* and only
|
|
46
|
+
* the result is rounded. This is the single boundary in the package where a
|
|
47
|
+
* rate meets money, which is what lets `evaluateSpending()` compare sums
|
|
48
|
+
* against `SpendingPolicy.limitAmount` exactly.
|
|
49
|
+
*
|
|
50
|
+
* Replaces the old micro-unit rounding (`Math.round(amount * 1e6) / 1e6`),
|
|
51
|
+
* which kept six sub-cent digits in a column that is now integral.
|
|
52
|
+
*/
|
|
32
53
|
calculateAmount(rule: PricingRule, quantity: number, dimensions?: Record<string, unknown>): Promise<number>;
|
|
33
54
|
}
|
|
34
55
|
export interface SpendingDecision {
|
|
35
56
|
allowed: boolean;
|
|
36
57
|
approvalRequired: boolean;
|
|
37
58
|
state: 'ok' | 'observed' | 'warned' | 'blocked' | 'approval_required';
|
|
59
|
+
/**
|
|
60
|
+
* Already-spent plus estimated, in **integer minor units** — the same unit as
|
|
61
|
+
* `SpendingPolicy.limitAmount` it is compared against (#2401).
|
|
62
|
+
*/
|
|
38
63
|
projectedAmount: number;
|
|
39
64
|
matchedPolicyId: string | null;
|
|
40
65
|
}
|
|
@@ -45,6 +70,7 @@ interface SpendingEvaluationInput {
|
|
|
45
70
|
projectId?: string;
|
|
46
71
|
serviceKey?: string;
|
|
47
72
|
metricKey: string;
|
|
73
|
+
/** Estimated cost of the pending call, in integer minor units (#2401). */
|
|
48
74
|
estimatedAmount: number;
|
|
49
75
|
currency: string;
|
|
50
76
|
at?: Date;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commercial.d.ts","sourceRoot":"","sources":["../../src/services/commercial.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AAC5F,OAAO,EACL,2BAA2B,EAC3B,KAAK,YAAY,EACjB,sBAAsB,EACtB,KAAK,WAAW,EAChB,qBAAqB,EAGrB,wBAAwB,EACzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAOtE,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,EAAE,CAAC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AuB,GAAG,OAAO,CAAC,gBAAgB,CAAC;YAwC3D,cAAc;CAgF7B"}
|
package/dist/smrt-knowledge.json
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
"sensitiveFieldsExcluded": true,
|
|
4
4
|
"generatedAt": "1970-01-01T00:00:00.000Z",
|
|
5
5
|
"packageName": "@happyvertical/smrt-subscriptions",
|
|
6
|
-
"packageVersion": "0.
|
|
6
|
+
"packageVersion": "0.41.0",
|
|
7
7
|
"sourceManifestPath": "dist/manifest.json",
|
|
8
8
|
"agentDocPath": "AGENTS.md",
|
|
9
9
|
"sourceHashes": {
|
|
10
|
-
"manifest": "
|
|
11
|
-
"packageJson": "
|
|
12
|
-
"agents": "
|
|
10
|
+
"manifest": "54ecac7da7e4d71db926b8e016df6bf3b88e4c65424a952a49119eebed70e448",
|
|
11
|
+
"packageJson": "1e70c8dc572dc6563d7309209dd8d37a33e96c172244fcf28b301f999d731189",
|
|
12
|
+
"agents": "656dde02216872b61383cb0a4be164716332864573fb72eb8d15d6ecc6e07e23"
|
|
13
13
|
},
|
|
14
14
|
"exports": [
|
|
15
15
|
".",
|
|
@@ -262,9 +262,9 @@
|
|
|
262
262
|
},
|
|
263
263
|
{
|
|
264
264
|
"name": "priceAmount",
|
|
265
|
-
"type": "
|
|
265
|
+
"type": "integer",
|
|
266
266
|
"required": false,
|
|
267
|
-
"columnType": "
|
|
267
|
+
"columnType": "INTEGER",
|
|
268
268
|
"default": 0
|
|
269
269
|
},
|
|
270
270
|
{
|
|
@@ -847,6 +847,11 @@
|
|
|
847
847
|
"mode": "required",
|
|
848
848
|
"field": "tenantId"
|
|
849
849
|
},
|
|
850
|
+
"conflictColumns": [
|
|
851
|
+
"tenant_id",
|
|
852
|
+
"slug",
|
|
853
|
+
"context"
|
|
854
|
+
],
|
|
850
855
|
"surfaces": [
|
|
851
856
|
{
|
|
852
857
|
"kind": "api",
|
|
@@ -1015,6 +1020,11 @@
|
|
|
1015
1020
|
"mode": "required",
|
|
1016
1021
|
"field": "tenantId"
|
|
1017
1022
|
},
|
|
1023
|
+
"conflictColumns": [
|
|
1024
|
+
"tenant_id",
|
|
1025
|
+
"slug",
|
|
1026
|
+
"context"
|
|
1027
|
+
],
|
|
1018
1028
|
"surfaces": [
|
|
1019
1029
|
{
|
|
1020
1030
|
"kind": "api",
|
|
@@ -1209,9 +1219,9 @@
|
|
|
1209
1219
|
},
|
|
1210
1220
|
{
|
|
1211
1221
|
"name": "amount",
|
|
1212
|
-
"type": "
|
|
1222
|
+
"type": "integer",
|
|
1213
1223
|
"required": false,
|
|
1214
|
-
"columnType": "
|
|
1224
|
+
"columnType": "INTEGER",
|
|
1215
1225
|
"default": 0
|
|
1216
1226
|
},
|
|
1217
1227
|
{
|
|
@@ -1354,9 +1364,9 @@
|
|
|
1354
1364
|
},
|
|
1355
1365
|
{
|
|
1356
1366
|
"name": "amount",
|
|
1357
|
-
"type": "
|
|
1367
|
+
"type": "integer",
|
|
1358
1368
|
"required": false,
|
|
1359
|
-
"columnType": "
|
|
1369
|
+
"columnType": "INTEGER",
|
|
1360
1370
|
"default": 0
|
|
1361
1371
|
},
|
|
1362
1372
|
{
|
|
@@ -1410,6 +1420,11 @@
|
|
|
1410
1420
|
"mode": "required",
|
|
1411
1421
|
"field": "tenantId"
|
|
1412
1422
|
},
|
|
1423
|
+
"conflictColumns": [
|
|
1424
|
+
"tenant_id",
|
|
1425
|
+
"slug",
|
|
1426
|
+
"context"
|
|
1427
|
+
],
|
|
1413
1428
|
"surfaces": [
|
|
1414
1429
|
{
|
|
1415
1430
|
"kind": "api",
|
|
@@ -1531,9 +1546,9 @@
|
|
|
1531
1546
|
},
|
|
1532
1547
|
{
|
|
1533
1548
|
"name": "limitAmount",
|
|
1534
|
-
"type": "
|
|
1549
|
+
"type": "integer",
|
|
1535
1550
|
"required": false,
|
|
1536
|
-
"columnType": "
|
|
1551
|
+
"columnType": "INTEGER",
|
|
1537
1552
|
"default": 0
|
|
1538
1553
|
},
|
|
1539
1554
|
{
|
|
@@ -2252,5 +2267,5 @@
|
|
|
2252
2267
|
"polymorphicAssociations": 0,
|
|
2253
2268
|
"uuidColumns": 25
|
|
2254
2269
|
},
|
|
2255
|
-
"agentDoc": "# @happyvertical/smrt-subscriptions\n\nTenant subscriptions, plan features, immutable/idempotent usage evidence,\neffective-dated client pricing, scoped spending policies, and entitlement\nresolution for SMRT applications.\n\n## Validation\n\n```bash\npnpm --filter @happyvertical/smrt-subscriptions test\npnpm --filter @happyvertical/smrt-subscriptions typecheck\npnpm --filter @happyvertical/smrt-subscriptions build\n```\n\n## Notes\n\n- Keep Stripe-specific fields as provider binding metadata. Runtime Stripe API\n calls belong in the HappyVertical SDK accounting provider.\n- Thresholds are evaluated from tenant usage metrics and optional AI usage\n summaries. Resolve multiple thresholds with the batch usage path where\n available; do not bypass tenant context in application code.\n- Use `SubscriptionResolver.create()` or an explicitly injected\n `SubscriptionResolver` once per request when resolving entitlements multiple\n times. Load and pass `EntitlementResolutionContext` to avoid re-reading the\n current subscription and plan.\n- Subscription UI components should stay provider-neutral and receive actions\n from the host app.\n"
|
|
2270
|
+
"agentDoc": "# @happyvertical/smrt-subscriptions\n\nTenant subscriptions, plan features, immutable/idempotent usage evidence,\neffective-dated client pricing, scoped spending policies, and entitlement\nresolution for SMRT applications.\n\n## Validation\n\n```bash\npnpm --filter @happyvertical/smrt-subscriptions test\npnpm --filter @happyvertical/smrt-subscriptions test:postgres\npnpm --filter @happyvertical/smrt-subscriptions typecheck\npnpm --filter @happyvertical/smrt-subscriptions build\n```\n\n`test:postgres` is the lane that holds the money-column line — SQLite's type\naffinity stores a REAL in an INTEGER column without complaint, so a money field\nthat reverted to DECIMAL passes every SQLite suite.\n\n## Money\n\n- **Money is integer minor units** (cents) — `$19.99` is `1999`.\n `SubscriptionPlan.priceAmount`, `ClientCharge.amount`,\n `BillingAdjustment.amount` and `SpendingPolicy.limitAmount` all initialize\n `= 0`, never `= 0.0`: the integer literal is what maps them to INTEGER\n columns (#2401). `ClientCharge.quantity` and `TenantUsageMetric.quantity` are\n the opposite case — metered quantities are genuinely fractional and stay\n DECIMAL.\n- **`PricingRule.terms` are minor units *per unit of usage*, and stay\n fractional.** A per-token rate is routinely a fraction of a cent, so an\n integer `unitPrice` would truncate it to zero. `calculateAmount()` rounds the\n computed result to a whole minor unit — that is the single boundary in the\n package where a rate meets money, and it is what lets `evaluateSpending()`\n compare charge sums against `limitAmount` exactly.\n- **`adjust()` rejects a fractional amount.** Negative amounts are legitimate\n (a credit); fractional ones almost always mean the caller passed major units.\n- **UI formats by dividing, never by `toFixed`.** `PlanPicker` and\n `CommercialOverview` scale back to major units using the currency's own\n minor-unit exponent, so zero-decimal currencies (JPY, KRW) are not divided.\n- **Migrating an existing database**: `preflightSubscriptionsMoneyMinorUnits(db)`\n reports which columns still hold major units and which rows would be rounded\n or overflow `int4`; `migrateSubscriptionsMoneyToMinorUnits(db)` converts them\n (idempotent via `_smrt_backfills`). On SQLite the values are rescaled but the\n declared type needs the table-rebuild path (#2370). Existing\n `PricingRule.terms` are **not** migrated automatically — only the operator\n knows which keys in a given rule are prices rather than quantities or ratios.\n- **`int4` ceiling**: about 2.1e9 minor units (~$21.4M) per column. Widening to\n BIGINT is parked in #2373.\n\n## Notes\n\n- Keep Stripe-specific fields as provider binding metadata. Runtime Stripe API\n calls belong in the HappyVertical SDK accounting provider.\n- Thresholds are evaluated from tenant usage metrics and optional AI usage\n summaries. Resolve multiple thresholds with the batch usage path where\n available; do not bypass tenant context in application code.\n- Use `SubscriptionResolver.create()` or an explicitly injected\n `SubscriptionResolver` once per request when resolving entitlements multiple\n times. Load and pass `EntitlementResolutionContext` to avoid re-reading the\n current subscription and plan.\n- Subscription UI components should stay provider-neutral and receive actions\n from the host app.\n"
|
|
2256
2271
|
}
|
|
@@ -7,6 +7,7 @@ export interface CommercialMetricView {
|
|
|
7
7
|
usage: number;
|
|
8
8
|
allowance?: number;
|
|
9
9
|
forecast?: number;
|
|
10
|
+
/** Integer minor units of `currency` — `$19.99` is `1999` (#2401). */
|
|
10
11
|
charge?: number;
|
|
11
12
|
currency?: string;
|
|
12
13
|
thresholdState?:
|
|
@@ -19,6 +20,25 @@ export interface CommercialMetricView {
|
|
|
19
20
|
|
|
20
21
|
let { metrics = [] }: { metrics?: CommercialMetricView[] } = $props();
|
|
21
22
|
const { t } = useI18n();
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Render `charge` for display.
|
|
26
|
+
*
|
|
27
|
+
* The stored value is integer minor units (#2401), so it has to be scaled back
|
|
28
|
+
* to major units before formatting — otherwise a $0.40 charge renders as 40.00.
|
|
29
|
+
* The currency's own minor-unit exponent is used rather than a hard-coded 100,
|
|
30
|
+
* so zero-decimal currencies (JPY, KRW) are left alone.
|
|
31
|
+
*/
|
|
32
|
+
function formatCharge(metric: CommercialMetricView): string {
|
|
33
|
+
if (metric.charge == null) return '—';
|
|
34
|
+
const currency = metric.currency ?? 'USD';
|
|
35
|
+
const format = new Intl.NumberFormat(undefined, {
|
|
36
|
+
style: 'currency',
|
|
37
|
+
currency,
|
|
38
|
+
});
|
|
39
|
+
const digits = format.resolvedOptions().maximumFractionDigits ?? 2;
|
|
40
|
+
return format.format(metric.charge / 10 ** digits);
|
|
41
|
+
}
|
|
22
42
|
</script>
|
|
23
43
|
|
|
24
44
|
<section class="commercial-overview" aria-label={t(M['subscriptions.commercial.overview_label'])}>
|
|
@@ -29,7 +49,7 @@ const { t } = useI18n();
|
|
|
29
49
|
<div><dt>Usage</dt><dd>{metric.usage}</dd></div>
|
|
30
50
|
<div><dt>Allowance</dt><dd>{metric.allowance ?? '—'}</dd></div>
|
|
31
51
|
<div><dt>Forecast</dt><dd>{metric.forecast ?? '—'}</dd></div>
|
|
32
|
-
<div><dt>Charge</dt><dd>{metric
|
|
52
|
+
<div><dt>Charge</dt><dd>{formatCharge(metric)}</dd></div>
|
|
33
53
|
</dl>
|
|
34
54
|
</article>
|
|
35
55
|
{/each}
|
|
@@ -3,6 +3,7 @@ export interface CommercialMetricView {
|
|
|
3
3
|
usage: number;
|
|
4
4
|
allowance?: number;
|
|
5
5
|
forecast?: number;
|
|
6
|
+
/** Integer minor units of `currency` — `$19.99` is `1999` (#2401). */
|
|
6
7
|
charge?: number;
|
|
7
8
|
currency?: string;
|
|
8
9
|
thresholdState?: 'ok' | 'observed' | 'warned' | 'blocked' | 'approval_required';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommercialOverview.svelte.d.ts","sourceRoot":"","sources":["../../src/svelte/CommercialOverview.svelte.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EACX,IAAI,GACJ,UAAU,GACV,QAAQ,GACR,SAAS,GACT,mBAAmB,CAAC;CACzB;AACA,KAAK,gBAAgB,GAAI;IAAE,OAAO,CAAC,EAAE,oBAAoB,EAAE,CAAA;CAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"CommercialOverview.svelte.d.ts","sourceRoot":"","sources":["../../src/svelte/CommercialOverview.svelte.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sEAAsE;IACtE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EACX,IAAI,GACJ,UAAU,GACV,QAAQ,GACR,SAAS,GACT,mBAAmB,CAAC;CACzB;AACA,KAAK,gBAAgB,GAAI;IAAE,OAAO,CAAC,EAAE,oBAAoB,EAAE,CAAA;CAAE,CAAC;AA+C/D,QAAA,MAAM,kBAAkB,sDAAwC,CAAC;AACjE,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAChE,eAAe,kBAAkB,CAAC"}
|
|
@@ -16,6 +16,7 @@ export interface PlanPickerPlan {
|
|
|
16
16
|
planKey: string;
|
|
17
17
|
name: string;
|
|
18
18
|
description?: string | null;
|
|
19
|
+
/** Integer minor units of `currency` — `$19.99` is `1999` (#2401). */
|
|
19
20
|
priceAmount: number;
|
|
20
21
|
currency: string;
|
|
21
22
|
billingInterval: string;
|
|
@@ -24,6 +25,25 @@ export interface PlanPickerPlan {
|
|
|
24
25
|
getFeatureKeys?: () => string[];
|
|
25
26
|
}
|
|
26
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Render `priceAmount` for display.
|
|
30
|
+
*
|
|
31
|
+
* The stored value is integer minor units (#2401), and `Intl.NumberFormat`
|
|
32
|
+
* expects major units, so the scale has to be undone here — without it a
|
|
33
|
+
* $10.00 plan renders as $1,000.00.
|
|
34
|
+
*
|
|
35
|
+
* Uses the currency's own minor-unit exponent rather than a hard-coded 100, so
|
|
36
|
+
* zero-decimal currencies (JPY, KRW) are not divided by anything.
|
|
37
|
+
*/
|
|
38
|
+
function formatPrice(plan: PlanPickerPlan): string {
|
|
39
|
+
const format = new Intl.NumberFormat(undefined, {
|
|
40
|
+
style: 'currency',
|
|
41
|
+
currency: plan.currency,
|
|
42
|
+
});
|
|
43
|
+
const digits = format.resolvedOptions().maximumFractionDigits ?? 2;
|
|
44
|
+
return format.format(plan.priceAmount / 10 ** digits);
|
|
45
|
+
}
|
|
46
|
+
|
|
27
47
|
function featureCount(plan: PlanPickerPlan): number {
|
|
28
48
|
if (plan.featureKeys) return plan.featureKeys.length;
|
|
29
49
|
if (plan.getFeatureKeys) return plan.getFeatureKeys().length;
|
|
@@ -71,10 +91,7 @@ let {
|
|
|
71
91
|
>
|
|
72
92
|
<span class="smrt-plan-picker__name">{plan.name}</span>
|
|
73
93
|
<span class="smrt-plan-picker__price">
|
|
74
|
-
{
|
|
75
|
-
style: 'currency',
|
|
76
|
-
currency: plan.currency,
|
|
77
|
-
}).format(plan.priceAmount)}
|
|
94
|
+
{formatPrice(plan)}
|
|
78
95
|
<small>/ {plan.billingInterval}</small>
|
|
79
96
|
</span>
|
|
80
97
|
{#if plan.description}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlanPicker.svelte.d.ts","sourceRoot":"","sources":["../../src/svelte/PlanPicker.svelte.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,KAAK,sBAAsB,GACvB,MAAM,GACN;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE/C,MAAM,WAAW,cAAc;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,GAAG,sBAAsB,EAAE,CAAC;IAC7C,cAAc,CAAC,EAAE,MAAM,MAAM,EAAE,CAAC;CACjC;AACA,KAAK,gBAAgB,GAAI;IACxB,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;CAC3C,CAAC;
|
|
1
|
+
{"version":3,"file":"PlanPicker.svelte.d.ts","sourceRoot":"","sources":["../../src/svelte/PlanPicker.svelte.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,KAAK,sBAAsB,GACvB,MAAM,GACN;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE/C,MAAM,WAAW,cAAc;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,sEAAsE;IACtE,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,GAAG,sBAAsB,EAAE,CAAC;IAC7C,cAAc,CAAC,EAAE,MAAM,MAAM,EAAE,CAAC;CACjC;AACA,KAAK,gBAAgB,GAAI;IACxB,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;CAC3C,CAAC;AA8EF,QAAA,MAAM,UAAU,sDAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
|
|
@@ -27,6 +27,37 @@ describe('PlanPicker', () => {
|
|
|
27
27
|
expect(body.match(/smrt-plan-picker__plan/g)).toHaveLength(2);
|
|
28
28
|
expect(planPickerSource).toContain('{#each plans as plan (plan.planKey)}');
|
|
29
29
|
});
|
|
30
|
+
it('renders a minor-units price as major units', () => {
|
|
31
|
+
// `priceAmount` is integer minor units (#2401), so 1999 is $19.99 — not
|
|
32
|
+
// $1,999.00. Nothing asserted the rendered string before, which is exactly
|
|
33
|
+
// how a unit change slips through a currency formatter unnoticed.
|
|
34
|
+
const plans = [
|
|
35
|
+
{
|
|
36
|
+
planKey: 'pro',
|
|
37
|
+
name: 'Pro',
|
|
38
|
+
priceAmount: 1999,
|
|
39
|
+
currency: 'USD',
|
|
40
|
+
billingInterval: 'month',
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
const { body } = render(PlanPicker, { props: { plans } });
|
|
44
|
+
expect(body).toContain('19.99');
|
|
45
|
+
expect(body).not.toContain('1,999');
|
|
46
|
+
});
|
|
47
|
+
it('renders a zero-decimal currency without rescaling it', () => {
|
|
48
|
+
// JPY has no minor unit, so ¥1999 must render as ¥1,999 rather than ¥19.99.
|
|
49
|
+
const plans = [
|
|
50
|
+
{
|
|
51
|
+
planKey: 'jp',
|
|
52
|
+
name: 'Japan',
|
|
53
|
+
priceAmount: 1999,
|
|
54
|
+
currency: 'JPY',
|
|
55
|
+
billingInterval: 'month',
|
|
56
|
+
},
|
|
57
|
+
];
|
|
58
|
+
const { body } = render(PlanPicker, { props: { plans } });
|
|
59
|
+
expect(body).toContain('1,999');
|
|
60
|
+
});
|
|
30
61
|
it('counts enabled features from the normal model serialization shape', () => {
|
|
31
62
|
const plan = new SubscriptionPlan({
|
|
32
63
|
planKey: 'pro',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-subscriptions",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.41.0",
|
|
4
4
|
"description": "Tenant subscriptions, entitlement resolution, usage thresholds, and subscription UI for SMRT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"smrtRawPrimitives": "strict",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@happyvertical/sql": "^0.88.0",
|
|
30
|
-
"@happyvertical/smrt-core": "0.
|
|
31
|
-
"@happyvertical/smrt-ui": "0.
|
|
32
|
-
"@happyvertical/smrt-tenancy": "0.
|
|
30
|
+
"@happyvertical/smrt-core": "0.41.0",
|
|
31
|
+
"@happyvertical/smrt-ui": "0.41.0",
|
|
32
|
+
"@happyvertical/smrt-tenancy": "0.41.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"svelte": "^5.56.4"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"typescript": "5.9.3",
|
|
48
48
|
"vite": "8.1.4",
|
|
49
49
|
"vitest": "4.1.10",
|
|
50
|
-
"@happyvertical/smrt-vitest": "0.
|
|
50
|
+
"@happyvertical/smrt-vitest": "0.41.0"
|
|
51
51
|
},
|
|
52
52
|
"keywords": [
|
|
53
53
|
"smrt",
|
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
"clean": "rm -rf dist",
|
|
76
76
|
"dev": "vite dev",
|
|
77
77
|
"test": "vitest run",
|
|
78
|
+
"test:postgres": "node ../../scripts/run-with-ci-postgres.mjs -- pnpm exec vitest run optional.test.ts",
|
|
78
79
|
"test:watch": "vitest",
|
|
79
80
|
"verify:pack": "node ../../scripts/verify-package-types-exports.js ."
|
|
80
81
|
}
|