feat(server): support onetime payment subscription (#8369)

This commit is contained in:
forehalo
2024-10-10 10:12:40 +00:00
parent 06e059db88
commit 69fb5c06f4
13 changed files with 486 additions and 50 deletions
@@ -443,9 +443,9 @@ export const USER_FRIENDLY_ERRORS = {
args: { plan: 'string', recurring: 'string' },
message: 'You are trying to access a unknown subscription plan.',
},
cant_update_lifetime_subscription: {
cant_update_onetime_payment_subscription: {
type: 'action_forbidden',
message: 'You cannot update a lifetime subscription.',
message: 'You cannot update an onetime payment subscription.',
},
// Copilot errors
@@ -390,9 +390,9 @@ export class SubscriptionPlanNotFound extends UserFriendlyError {
}
}
export class CantUpdateLifetimeSubscription extends UserFriendlyError {
export class CantUpdateOnetimePaymentSubscription extends UserFriendlyError {
constructor(message?: string) {
super('action_forbidden', 'cant_update_lifetime_subscription', message);
super('action_forbidden', 'cant_update_onetime_payment_subscription', message);
}
}
@@ -591,7 +591,7 @@ export enum ErrorNames {
SAME_SUBSCRIPTION_RECURRING,
CUSTOMER_PORTAL_CREATE_FAILED,
SUBSCRIPTION_PLAN_NOT_FOUND,
CANT_UPDATE_LIFETIME_SUBSCRIPTION,
CANT_UPDATE_ONETIME_PAYMENT_SUBSCRIPTION,
COPILOT_SESSION_NOT_FOUND,
COPILOT_SESSION_DELETED,
NO_COPILOT_PROVIDER_AVAILABLE,