diff --git a/src/lib/stores/billing.ts b/src/lib/stores/billing.ts index 1215904ec..32edebbe6 100644 --- a/src/lib/stores/billing.ts +++ b/src/lib/stores/billing.ts @@ -32,6 +32,22 @@ export class Billing { ); } + async getPlan(organizationId: string): Promise { + const path = `/organizations/${organizationId}/plan`; + const params = { + organizationId + }; + const uri = new URL(this.client.config.endpoint + path); + return await this.client.call( + 'get', + uri, + { + 'content-type': 'application/json' + }, + params + ); + } + async updatePlan( organizationId: string, billingPlan: string, @@ -232,6 +248,24 @@ export class Billing { } } +export const tierFree = { + price: 0, + name: 'Free', + description: 'For personal, passion projects.' +}; + +export const tierStarter = { + price: 10, + name: 'Starter', + description: 'For small organizations that want flexibility.' +}; + +export const tierPro = { + price: 20, + name: 'Pro', + description: 'For organizations that need the ability scale easily.' +}; + export const apperanceLight = { variables: { colorPrimary: '#606a7b', diff --git a/src/routes/console/createOrganizationCloud.svelte b/src/routes/console/createOrganizationCloud.svelte index 7d67cece7..a3d5fa66f 100644 --- a/src/routes/console/createOrganizationCloud.svelte +++ b/src/routes/console/createOrganizationCloud.svelte @@ -23,9 +23,11 @@ async function create() { try { - const org = await sdk.forConsole.teams.create( + const org = await sdk.forConsole.billing.createOrganization( $createOrganization.id ?? ID.unique(), - $createOrganization.name + $createOrganization.name, + $createOrganization.tier, + $createOrganization.payment ); await invalidate(Dependencies.ACCOUNT); dispatch('created'); diff --git a/src/routes/console/wizard/step1.svelte b/src/routes/console/wizard/step1.svelte index 30d750c11..5868eb537 100644 --- a/src/routes/console/wizard/step1.svelte +++ b/src/routes/console/wizard/step1.svelte @@ -3,6 +3,7 @@ import { Pill } from '$lib/elements'; import { InputText, FormList } from '$lib/elements/forms'; import { WizardStep } from '$lib/layout'; + import { tierFree, tierPro, tierStarter } from '$lib/stores/billing'; import { organizationList } from '$lib/stores/organization'; import { createOrganization } from './store'; @@ -53,8 +54,10 @@
-

Free - $0/month

-

For personal, passion projects.

+

+ {tierFree.name} - ${tierFree.price}/month +

+

{tierFree.description}

@@ -65,10 +68,10 @@

- Starter - $10/month per organization member + {tierStarter.name} - ${tierStarter.price}/month per organization member

- For small organizations that want flexibility. + {tierStarter.description}

14 DAY FREE TRIAL @@ -80,10 +83,11 @@

- Pro - $20/month per organization member + exta usage + {tierPro.name} - ${tierPro.price}/month per organization member + exta + usage

- For organizations that need the ability scale easily. + {tierPro.description}

14 DAY FREE TRIAL