diff --git a/packages/server/assets/gatekeeper/typedefs/gatekeeper.graphql b/packages/server/assets/gatekeeper/typedefs/gatekeeper.graphql index fd5138485..ff89c387a 100644 --- a/packages/server/assets/gatekeeper/typedefs/gatekeeper.graphql +++ b/packages/server/assets/gatekeeper/typedefs/gatekeeper.graphql @@ -62,6 +62,9 @@ enum WorkspacePlans { business unlimited academia + starterInvoiced + plusInvoiced + businessInvoiced } enum WorkspacePlanStatuses { diff --git a/packages/server/modules/core/graph/generated/graphql.ts b/packages/server/modules/core/graph/generated/graphql.ts index 40dc3530d..14138d6bd 100644 --- a/packages/server/modules/core/graph/generated/graphql.ts +++ b/packages/server/modules/core/graph/generated/graphql.ts @@ -4537,8 +4537,11 @@ export enum WorkspacePlanStatuses { export enum WorkspacePlans { Academia = 'academia', Business = 'business', + BusinessInvoiced = 'businessInvoiced', Plus = 'plus', + PlusInvoiced = 'plusInvoiced', Starter = 'starter', + StarterInvoiced = 'starterInvoiced', Unlimited = 'unlimited' } diff --git a/packages/server/modules/cross-server-sync/graph/generated/graphql.ts b/packages/server/modules/cross-server-sync/graph/generated/graphql.ts index b907c0cc7..be8f5fa05 100644 --- a/packages/server/modules/cross-server-sync/graph/generated/graphql.ts +++ b/packages/server/modules/cross-server-sync/graph/generated/graphql.ts @@ -4518,8 +4518,11 @@ export enum WorkspacePlanStatuses { export enum WorkspacePlans { Academia = 'academia', Business = 'business', + BusinessInvoiced = 'businessInvoiced', Plus = 'plus', + PlusInvoiced = 'plusInvoiced', Starter = 'starter', + StarterInvoiced = 'starterInvoiced', Unlimited = 'unlimited' } diff --git a/packages/server/modules/gatekeeper/domain/workspacePricing.ts b/packages/server/modules/gatekeeper/domain/workspacePricing.ts index 07c4191ea..b75c26b25 100644 --- a/packages/server/modules/gatekeeper/domain/workspacePricing.ts +++ b/packages/server/modules/gatekeeper/domain/workspacePricing.ts @@ -90,7 +90,10 @@ export type PaidWorkspacePlans = z.infer // these are not publicly exposed for general use on billing enabled servers export const unpaidWorkspacePlans = z.union([ z.literal('unlimited'), - z.literal('academia') + z.literal('academia'), + z.literal('starterInvoiced'), + z.literal('plusInvoiced'), + z.literal('businessInvoiced') ]) export type UnpaidWorkspacePlans = z.infer @@ -156,9 +159,9 @@ const academia: WorkspacePlanFeaturesAndLimits = { name: 'academia', description: 'The academia plan', oidcSso: true, - workspaceDataRegionSpecificity: false, - automateMinutes: null, - uploadSize: 100 + workspaceDataRegionSpecificity: true, + automateMinutes: 900, + uploadSize: 1000 } const paidWorkspacePlanFeatures: Record< @@ -175,7 +178,10 @@ export const unpaidWorkspacePlanFeatures: Record< WorkspacePlanFeaturesAndLimits > = { academia, - unlimited + unlimited, + starterInvoiced: starter, + plusInvoiced: plus, + businessInvoiced: business } export const workspacePlanFeatures: Record< diff --git a/packages/server/modules/gatekeeper/services/subscriptions.ts b/packages/server/modules/gatekeeper/services/subscriptions.ts index e487ddfc0..3549ef318 100644 --- a/packages/server/modules/gatekeeper/services/subscriptions.ts +++ b/packages/server/modules/gatekeeper/services/subscriptions.ts @@ -81,6 +81,9 @@ export const handleSubscriptionUpdateFactory = break case 'unlimited': case 'academia': + case 'starterInvoiced': + case 'plusInvoiced': + case 'businessInvoiced': throw new WorkspacePlanMismatchError() default: throwUncoveredError(workspacePlan) @@ -131,6 +134,9 @@ export const addWorkspaceSubscriptionSeatIfNeededFactory = break case 'unlimited': case 'academia': + case 'starterInvoiced': + case 'plusInvoiced': + case 'businessInvoiced': throw new WorkspacePlanMismatchError() default: throwUncoveredError(workspacePlan) @@ -261,6 +267,9 @@ export const downscaleWorkspaceSubscriptionFactory = break case 'unlimited': case 'academia': + case 'starterInvoiced': + case 'plusInvoiced': + case 'businessInvoiced': throw new WorkspacePlanMismatchError() default: throwUncoveredError(workspacePlan) @@ -373,6 +382,9 @@ export const upgradeWorkspaceSubscriptionFactory = switch (workspacePlan.name) { case 'unlimited': case 'academia': + case 'starterInvoiced': + case 'plusInvoiced': + case 'businessInvoiced': throw new WorkspaceNotPaidPlanError() case 'starter': case 'plus': diff --git a/packages/server/modules/workspaces/graph/resolvers/workspaces.ts b/packages/server/modules/workspaces/graph/resolvers/workspaces.ts index b392a16c9..fffc44f77 100644 --- a/packages/server/modules/workspaces/graph/resolvers/workspaces.ts +++ b/packages/server/modules/workspaces/graph/resolvers/workspaces.ts @@ -484,6 +484,9 @@ export = FF_WORKSPACES_MODULE_ENABLED case WorkspacePlans.Academia: case WorkspacePlans.Unlimited: + case WorkspacePlans.StarterInvoiced: + case WorkspacePlans.PlusInvoiced: + case WorkspacePlans.BusinessInvoiced: switch (status) { case WorkspacePlanStatuses.Valid: await upsertUnpaidWorkspacePlanFactory({ db })({ @@ -565,6 +568,9 @@ export = FF_WORKSPACES_MODULE_ENABLED } case 'unlimited': case 'academia': + case 'starterInvoiced': + case 'plusInvoiced': + case 'businessInvoiced': break default: throwUncoveredError(workspacePlan) diff --git a/packages/server/test/graphql/generated/graphql.ts b/packages/server/test/graphql/generated/graphql.ts index 8212f5b51..707290bfb 100644 --- a/packages/server/test/graphql/generated/graphql.ts +++ b/packages/server/test/graphql/generated/graphql.ts @@ -4519,8 +4519,11 @@ export enum WorkspacePlanStatuses { export enum WorkspacePlans { Academia = 'academia', Business = 'business', + BusinessInvoiced = 'businessInvoiced', Plus = 'plus', + PlusInvoiced = 'plusInvoiced', Starter = 'starter', + StarterInvoiced = 'starterInvoiced', Unlimited = 'unlimited' }