Merge pull request #1650 from appwrite/update-plan-name-mapping

Update billing plans mapping
This commit is contained in:
Darshan
2025-02-10 18:28:14 +05:30
committed by GitHub
4 changed files with 22 additions and 8 deletions
@@ -77,9 +77,16 @@
</LabelCard>
</li>
<li>
<LabelCard name="plan" bind:group={billingPlan} value={BillingPlan.SCALE} padding={1.5}>
<svelte:fragment slot="custom">
<div class="u-flex u-flex-vertical u-gap-4 u-width-full-line">
<LabelCard
name="plan"
bind:group={billingPlan}
value={BillingPlan.SCALE}
padding={1.5}
disabled={!selfService}>
<svelte:fragment slot="custom" let:disabled>
<div
class="u-flex u-flex-vertical u-gap-4 u-width-full-line"
class:u-opacity-50={disabled}>
<h4 class="body-text-2 u-bold">
{tierScale.name}
{#if $organization?.billingPlan === BillingPlan.SCALE && !isNewOrg}
+2 -1
View File
@@ -470,7 +470,8 @@ export enum BillingPlan {
PRO = 'tier-1',
SCALE = 'tier-2',
GITHUB_EDUCATION = 'auto-1',
CUSTOM = 'cont-1'
CUSTOM = 'cont-1',
ENTERPRISE = 'ent-1'
}
export const feedbackDowngradeOptions = [
+8 -1
View File
@@ -34,7 +34,7 @@ import { user } from './user';
import { browser } from '$app/environment';
import { canSeeBilling } from './roles';
export type Tier = 'tier-0' | 'tier-1' | 'tier-2' | 'auto-1' | 'cont-1';
export type Tier = 'tier-0' | 'tier-1' | 'tier-2' | 'auto-1' | 'cont-1' | 'ent-1';
export const roles = [
{
@@ -81,6 +81,8 @@ export function tierToPlan(tier: Tier) {
return tierGitHubEducation;
case BillingPlan.CUSTOM:
return tierCustom;
case BillingPlan.ENTERPRISE:
return tierEnterprise;
default:
return tierFree;
}
@@ -199,6 +201,11 @@ export const tierCustom: TierData = {
description: 'Team on a custom contract'
};
export const tierEnterprise: TierData = {
name: 'Enterprise',
description: 'For enterprises that need more power and premium support.'
};
export const showUsageRatesModal = writable<boolean>(false);
export function checkForUsageFees(plan: Tier, id: PlanServices) {
@@ -3,7 +3,7 @@
import { Card, CardGrid, Collapsible, CollapsibleItem, Heading } from '$lib/components';
import { Button } from '$lib/elements/forms';
import { toLocaleDate } from '$lib/helpers/date';
import { plansInfo, tierToPlan, upgradeURL } from '$lib/stores/billing';
import { plansInfo, upgradeURL } from '$lib/stores/billing';
import { organization } from '$lib/stores/organization';
import type { CreditList, Invoice, Plan } from '$lib/sdk/billing';
import { abbreviateNumber, formatCurrency, formatNumberWithCommas } from '$lib/helpers/numbers';
@@ -47,8 +47,7 @@
<Collapsible>
<div class="u-flex-vertical u-gap-8">
<div class="u-flex">
<span class="body-text-2">
{tierToPlan($organization?.billingPlan)?.name} plan</span>
<span class="body-text-2">{currentPlan.name} plan</span>
<div class="body-text-2 u-margin-inline-start-auto">
{isTrial ||
$organization?.billingPlan === BillingPlan.GITHUB_EDUCATION