Files
speckle-server/packages/server/modules/gatekeeper/services/upgrades.ts
T
Gergő Jedlicska 72ecb9197b feat(gatekeeper): intoduce the enterprise plan (#4882)
* feat(gatekeeper): intoduce the enterprise plan

* chore(server): remove more "magic strings"

* test(shared): fix plan tests with enterprise case

* Small change to format plan name

---------

Co-authored-by: Mike Tasset <mike.tasset@gmail.com>
2025-06-05 11:07:59 +02:00

25 lines
690 B
TypeScript

import { WorkspacePlans } from '@speckle/shared'
const WorkspacePlansUpgradeMapping: Record<WorkspacePlans, WorkspacePlans[]> = {
academia: [],
unlimited: [],
free: ['team', 'teamUnlimited', 'pro', 'proUnlimited'],
team: ['team', 'teamUnlimited', 'pro', 'proUnlimited'],
teamUnlimited: ['teamUnlimited', 'pro', 'proUnlimited'],
teamUnlimitedInvoiced: [],
pro: ['pro', 'proUnlimited'],
proUnlimited: ['proUnlimited'],
proUnlimitedInvoiced: [],
enterprise: []
}
export const isUpgradeWorkspacePlanValid = ({
current,
upgrade
}: {
current: WorkspacePlans
upgrade: WorkspacePlans
}): boolean => {
return WorkspacePlansUpgradeMapping[current].includes(upgrade)
}