diff --git a/apps/api/src/app/shared/interceptors/product-feature.interceptor.ts b/apps/api/src/app/shared/interceptors/product-feature.interceptor.ts index dd7b2b3a858..7c0d552d074 100644 --- a/apps/api/src/app/shared/interceptors/product-feature.interceptor.ts +++ b/apps/api/src/app/shared/interceptors/product-feature.interceptor.ts @@ -51,6 +51,7 @@ export class ProductFeatureInterceptor implements NestInterceptor { ); if (!enabled) { + // TODO: Reuse PaymentRequiredException from EE billing module. throw new HttpException('Payment Required', 402); } diff --git a/apps/api/src/app/testing/billing/quota-throttler.guard.e2e-ee.ts b/apps/api/src/app/testing/billing/quota-throttler.guard.e2e-ee.ts index 9cad166be09..1eb9b199ad7 100644 --- a/apps/api/src/app/testing/billing/quota-throttler.guard.e2e-ee.ts +++ b/apps/api/src/app/testing/billing/quota-throttler.guard.e2e-ee.ts @@ -51,6 +51,11 @@ describe('Resource Limiting', () => { const response = await request(pathEvent); expect(response.status).to.equal(402); + expect(response.body.status).to.equal(402); + expect(response.body.error).to.equal('Payment required'); + expect(response.body.message).to.match( + /You have exceeded the number of allowed requests for this resource\. Please visit http.+ to upgrade your subscription./ + ); }); });