Files
supabase/studio/components/interfaces/Billing/PlanSelection/PlanSelection.utils.ts
2022-03-24 17:55:20 +08:00

22 lines
757 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { STRIPE_PRODUCT_IDS } from 'lib/constants'
// On the UI, we hide PAYG, and add an Enterprise option
export const formatTierOptions = (tiers: any[]) => {
const enterpriseOption = {
id: 'Enterprise',
name: 'Enterprise',
description: 'For large-scale applications managing serious workloads',
metadata: {
features:
'Point in time recovery\\nDesignated Support manager & SLAs\\nSSO / SAML + SOC2\\nCustom contracts & invoicing\\n24×7×365 premium enterprise support',
},
prices: [],
}
// Fix the order of plans here
return tiers
.filter((tier: any) => tier.id === STRIPE_PRODUCT_IDS.FREE)
.concat(tiers.filter((tier: any) => tier.id === STRIPE_PRODUCT_IDS.PRO))
.concat([enterpriseOption])
}