Skip to content

Feature/plan limits#14

Merged
krakenhavoc merged 5 commits intomainfrom
feature/plan-limits
Mar 10, 2026
Merged

Feature/plan limits#14
krakenhavoc merged 5 commits intomainfrom
feature/plan-limits

Conversation

@krakenhavoc
Copy link
Copy Markdown
Contributor

This pull request introduces a new billing and subscription system to the backend, integrating Stripe for payment processing and enforcing plan-based resource limits. The changes include the addition of a new BillingModule with controller, service, entities, and tests; Stripe integration; and updates to the authentication flow to enforce API key limits based on user subscription plans.

Billing and Subscription System Integration

  • Added a new BillingModule with controller, service, and entity for managing subscriptions, including endpoints for Stripe checkout, customer portal, and webhook handling. [1] [2] [3]
  • Integrated the stripe package for payment processing and added it to dependencies.
  • Registered BillingModule in the main application module and in the authentication module for cross-module usage. [1] [2] [3]

Plan-Based Feature Enforcement

  • Updated AuthService to enforce API key creation limits based on the user's subscription plan, using the new billing service and plan limits. If the user exceeds their plan's API key limit, an HTTP 402 error is returned. [1] [2] [3]
  • Extended the user profile response to include the user's current subscription plan. [1] [2]

Testing and Code Quality

  • Added comprehensive tests for the new billing controller, covering checkout, subscription retrieval, portal creation, and Stripe webhook handling.
  • Updated authentication service tests to mock billing service interactions and plan-based logic. [1] [2] [3] [4]

Miscellaneous

  • Minor refactor in JWT debug script: removed unused promisify import and simplified signature verification. [1] [2]

@krakenhavoc krakenhavoc merged commit 8ad809b into main Mar 10, 2026
12 checks passed
@krakenhavoc krakenhavoc deleted the feature/plan-limits branch March 10, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant