f501cc4ad5
* WIP can create project * WIP can create project more work * complete body, stencil tests * feat(shared): move workspace plan types into shared * test progress wip * feat(shared): add more logic to canCreateWorkspaceProject * a few more tests, as a treat * chore(authz): round out tests * fixed loaders, new GQL checks, dataLoaders in auth loaders * fix(authz): get workspace limits loader * chore(authz): update loaders * frontend fixed up to snuff * fix(authz): fix workspace plans for tests * fix(authz): classic * fix(authz): 0 counts --------- Co-authored-by: Chuck Driesler <chuck@speckle.systems> Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
40 lines
1010 B
TypeScript
40 lines
1010 B
TypeScript
import {
|
|
PaidWorkspacePlans,
|
|
WorkspacePlanBillingIntervals,
|
|
WorkspacePlans
|
|
} from '@speckle/shared'
|
|
import { OverrideProperties, SetOptional } from 'type-fest'
|
|
|
|
/**
|
|
* This includes the pricing plans (Stripe products) a customer can sub to
|
|
*/
|
|
export type WorkspacePricingProducts = PaidWorkspacePlans | 'guest'
|
|
|
|
type WorkspacePlanProductsMetadata<PriceData = string> = OverrideProperties<
|
|
Record<
|
|
WorkspacePricingProducts,
|
|
Record<WorkspacePlanBillingIntervals, PriceData> & {
|
|
productId: string
|
|
}
|
|
>,
|
|
{
|
|
// Team has no yearly plan
|
|
[PaidWorkspacePlans.Team]: {
|
|
productId: string
|
|
monthly: PriceData
|
|
}
|
|
}
|
|
>
|
|
|
|
export type WorkspacePlanProductAndPriceIds = SetOptional<
|
|
WorkspacePlanProductsMetadata<string>,
|
|
typeof WorkspacePlans.Team | typeof WorkspacePlans.Pro
|
|
>
|
|
export type WorkspacePlanProductPrices = SetOptional<
|
|
WorkspacePlanProductsMetadata<{
|
|
amount: number
|
|
currency: string
|
|
}>,
|
|
typeof WorkspacePlans.Team | typeof WorkspacePlans.Pro
|
|
>
|