diff --git a/packages/billing/core/src/create-billing-schema.ts b/packages/billing/core/src/create-billing-schema.ts index d455f6d5a..65744a349 100644 --- a/packages/billing/core/src/create-billing-schema.ts +++ b/packages/billing/core/src/create-billing-schema.ts @@ -104,21 +104,6 @@ export const PlanSchema = z path: ['lineItems'], }, ) - .refine( - (data) => { - if (data.paymentType === 'one-time') { - const meteredItems = data.lineItems.filter( - (item) => item.type === 'metered', - ); - - return meteredItems.length === 0; - } - }, - { - message: 'One-time plans must not have metered line items', - path: ['paymentType', 'lineItems'], - }, - ) .refine( (data) => { if (data.paymentType === 'one-time') { @@ -126,6 +111,8 @@ export const PlanSchema = z return baseItems.length === 0; } + + return true; }, { message: 'One-time plans must not have non-base line items', diff --git a/packages/billing/gateway/src/components/pricing-table.tsx b/packages/billing/gateway/src/components/pricing-table.tsx index e0c7e8fe3..b2727d55b 100644 --- a/packages/billing/gateway/src/components/pricing-table.tsx +++ b/packages/billing/gateway/src/components/pricing-table.tsx @@ -4,10 +4,11 @@ import { useState } from 'react'; import Link from 'next/link'; -import { CheckCircle, Sparkles } from 'lucide-react'; +import { ArrowRight, CheckCircle, Sparkles } from 'lucide-react'; import { BillingConfig, getBaseLineItem, getPlanIntervals } from '@kit/billing'; import { formatCurrency } from '@kit/shared/utils'; +import { Badge } from '@kit/ui/badge'; import { Button } from '@kit/ui/button'; import { Heading } from '@kit/ui/heading'; import { If } from '@kit/ui/if'; @@ -49,25 +50,36 @@ export function PricingTable({