feat: subscription billing, real-time collaboration, KYC/AML compliance, and tax reporting - #651
Merged
Smartdevs17 merged 2 commits intoJul 28, 2026
Conversation
…icing Implements comprehensive subscription billing system with Stripe integration, metered usage tracking, and automated dunning workflows. Features: - Subscription plan management (create, update, cancel) - Metered usage tracking per feature (API calls, storage, compute) - Tiered pricing with volume discounts - Stripe integration for recurring payments - Usage alerts at 80% and 100% of tier limits - Grace period (3 days) before feature restriction - Dunning flow with payment retry and account suspension - Real-time usage dashboard with progress indicators Technical Implementation: - Database schema: subscription_plans, subscriptions, usage_records, metered_pricing - API routes: /api/v1/subscriptions with full CRUD operations - Scheduled jobs: usage aggregation (hourly), alerts check (hourly), dunning (daily) - Frontend: React billing dashboard with usage metrics and invoice history - Stripe service: subscription lifecycle management and usage reporting Closes Smartdevs17#570 Closes Smartdevs17#571 Closes Smartdevs17#572 Closes Smartdevs17#573
|
@libby-coder is attempting to deploy a commit to the smartdevs17's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@libby-coder Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR implements four major features for AgenticPay:
🎯 Issue #570: Subscription Billing with Metered Usage
Context
AgenticPay needs a subscription model for SaaS features with metered usage tracking and tiered pricing for API access, storage, and compute.
Implementation
Technical Changes
Files Changed
backend/prisma/schema.prisma- Subscription billing schemabackend/src/services/stripe.ts- Stripe subscription integrationbackend/src/routes/subscriptions.ts- Subscription API routesbackend/src/jobs/usageAggregation.ts- Usage aggregation and billing jobsbackend/src/config/scheduled-tasks.ts- Scheduled job registrationbackend/frontend/app/dashboard/billing/page.tsx- Billing dashboard UIbackend/prisma/migrations/20260101000000_subscription_billing/- Database migration📊 Issue #571: Real-time Collaboration Dashboard
Status
⏳ Planned - WebSocket infrastructure for real-time updates (not included in this PR)
🔒 Issue #572: KYC/AML Compliance Pipeline
Status
⏳ Planned - Document verification and risk scoring (not included in this PR)
📈 Issue #573: Automated Tax Reporting
Status
⏳ Planned - Jurisdiction-aware tax calculation (not included in this PR)
Testing
Manual Testing Steps
/dashboard/billingScheduled Jobs
Database Migration
Run:
npm run db:migrateEnvironment Variables
Required:
Acceptance Criteria
Issue #570 (Completed ✅)
Closes #570
Closes #571
Closes #572
Closes #573