8cba7eb6f7
* 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
26 lines
882 B
TypeScript
26 lines
882 B
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 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
|
|
}
|