Skip to content

Commit eecf532

Browse files
committed
fix(billing): plan pricing input accepts a subscription without a plan
1 parent 238704a commit eecf532

3 files changed

Lines changed: 2 additions & 3 deletions

File tree

‎apps/sim/lib/billing/subscriptions/utils.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ export function resolveBillingInterval(
375375

376376
/** The billing fields that decide a plan's included usage per period. */
377377
export interface PlanPricingInput {
378-
plan: string | null | undefined
378+
plan?: string | null
379379
billingInterval?: string | null
380380
metadata?: unknown
381381
}

‎packages/testing/src/mocks/billing-plan-logic.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export function resolveBillingInterval(
6464

6565
/** Faithful port of the real `getPlanPricing` with env overrides unset. */
6666
export function getPlanPricing(subscription: {
67-
plan: string | null | undefined
67+
plan?: string | null
6868
billingInterval?: string | null
6969
metadata?: unknown
7070
}): { basePrice: number } {

‎scripts/check-test-types.baseline.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
"TS2554": 4
5252
},
5353
"apps/sim/app/api/billing/route.test.ts": {
54-
"TS2345": 1,
5554
"TS2554": 4
5655
},
5756
"apps/sim/app/api/billing/switch-plan/route.test.ts": {

0 commit comments

Comments
 (0)