Files
speckle-server/packages/server/modules/gatekeeper/errors/billing.ts
T
Gergő Jedlicska af3857a209 gergo/web 2038 billing graphql api (#3379)
* feat(gatekeeper): add gatekeeper module feature flag

* feat(gatekeeper): add workspace pricing table domain

* feat(gatekeeper): add checkout session creation

* feat(gatekeeper): verify stripe signature

* wip(gatekeeper): checkout callbacks

* feat(gatekeeper): add unlimited and academia plan types

* refactor(envHelper): getStringFromEnv helper

* chore(gatekeeper): add future todos

* feat(gatekeeper): add productId to the subscription domain

* feat(gatekeeper): add in memory repositories

* feat(gatekeeper): add more errors

* feat(gatekeeper): complete checkout session service

* feat(gatekeeper): add stripe client implementation

* feat(gatekeeper): add checkout session completion webhook callback path

* feat(gendo): fix not needing env vars if gendo module is not enabled

* feat(gatekeeper): require a license for billing

* chore(gatekeeper): cleanup before testing

* feat(gatekeeper): subscriptionData parsing model

* ci: add billing integration and gatekeeper modules to test config

* test(gatekeeper): add checkout service tests

* feat(gatekeeper): make completeCheckout callback idempotent properly

* feat(gatekeeper): move to knex based repositories

* test(gatekeeper): billing repository tests

* feat(gatekeeper): add yearly billing cycle toggle

* feat(ci): add stripe integration context to test job

* feat(billingPage): conditionally render the checkout CTAs

* fix(gatekeeper): remove flaky test condition

* feat(helm): add billing integration feature flag

* WIP billing gql api

* feat(gatekeeper): cancel checkout session api

* feat(gatekeeper): handle existing checkout sessions, when trying to create a new one

* feat(gatekeeper): add workspace plans gql api

* feat(gatekeeper): handle cancelation and subscription updates

* fix(gatekeeper): scope initialization

* fix(gatekeeper): eliminate stripe client import sideeffect

* fix(gatekeeper): eliminate stripe client import sideeffect 2

* fix(mainConstants): fitler gatekeeper scopes with feature flag
2024-10-25 10:46:09 +02:00

38 lines
1.3 KiB
TypeScript

import { BaseError } from '@/modules/shared/errors'
export class WorkspacePlanNotFoundError extends BaseError {
static defaultMessage = 'Workspace plan not found'
static code = 'WORKSPACE_PLAN_NOT_FOUND_ERROR'
static statusCode = 500
}
export class WorkspacePlanMismatchError extends BaseError {
static defaultMessage = 'Workspace plan is not matching the expected state'
static code = 'WORKSPACE_PLAN_MISMATCH'
static statusCode = 500
}
export class WorkspaceCheckoutSessionInProgressError extends BaseError {
static defaultMessage = 'Workspace already has a checkout session in progress'
static code = 'WORKSPACE_CHECKOUT_SESSION_IN_PROGRESS_ERROR'
static statusCode = 400
}
export class WorkspaceAlreadyPaidError extends BaseError {
static defaultMessage = 'Workspace is already on a paid plan'
static code = 'WORKSPACE_ALREADY_PAID_ERROR'
static statusCode = 400
}
export class CheckoutSessionNotFoundError extends BaseError {
static defaultMessage = 'Checkout session is not found'
static code = 'CHECKOUT_SESSION_NOT_FOUND'
static statusCode = 404
}
export class WorkspaceSubscriptionNotFoundError extends BaseError {
static defaultMessage = 'Workspace subscription not found'
static code = 'WORKSPACE_SUBSCRIPTION_NOT_FOUND'
static statusCode = 404
}