feat: Quota overage system, updated tier pricing, and communication addons

Quota Overage System:
- Add QuotaOverage model for tracking resource/user quota overages
- Implement 30-day grace period with email notifications (immediate, 7-day, 1-day)
- Add QuotaWarningBanner component in BusinessLayout
- Add QuotaSettings page for managing overages and archiving resources
- Add Celery tasks for automated quota checks and expiration handling
- Add quota management API endpoints

Updated Tier Pricing (Stripe: 2.9% + $0.30):
- Free: No payments (requires addon)
- Starter: 4% + $0.40
- Professional: 3.5% + $0.35
- Business: 3.25% + $0.32
- Enterprise: 3% + $0.30

New Subscription Addons:
- Online Payments ($5/mo + 5% + $0.50) - for Free tier
- SMS Notifications ($10/mo) - enables SMS reminders
- Masked Calling ($15/mo) - enables anonymous calling

BusinessEditModal Improvements:
- Increased width to match PlanModal (max-w-3xl)
- Added all tier options with auto-update on tier change
- Added limits configuration and permissions sections

Backend Fixes:
- Fixed SubscriptionPlan serializer to include all communication fields
- Allow blank business_tier for addon plans
- Added migration for business_tier field changes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
poduck
2025-12-02 13:05:02 -05:00
parent dc3210927a
commit 08b51d1a5f
36 changed files with 3469 additions and 350 deletions

View File

@@ -543,7 +543,11 @@
"acceptPayments": "Accept Payments",
"acceptPaymentsDescription": "Enable payment acceptance from customers for appointments and services.",
"stripeSetupRequired": "Stripe Connect Setup Required",
"stripeSetupDescription": "You'll need to complete Stripe onboarding to accept payments. Go to the Payments page to get started."
"stripeSetupDescription": "You'll need to complete Stripe onboarding to accept payments. Go to the Payments page to get started.",
"quota": {
"title": "Quota Management",
"description": "Usage limits, archiving"
}
},
"profile": {
"title": "Profile Settings",
@@ -1051,6 +1055,36 @@
"dataRetention": "Your data is safe and will be retained for 30 days."
}
},
"quota": {
"banner": {
"critical": "URGENT: Automatic archiving tomorrow!",
"urgent": "Action Required: {{days}} days left",
"warning": "Quota exceeded for {{count}} item(s)",
"details": "You have {{overage}} {{type}} over your plan limit. Grace period ends {{date}}.",
"manage": "Manage Quota",
"allOverages": "All overages:",
"overBy": "over by {{amount}}",
"expiredToday": "expires today!",
"daysLeft": "{{days}} days left"
},
"page": {
"title": "Quota Management",
"subtitle": "Manage your account limits and usage",
"currentUsage": "Current Usage",
"planLimit": "Plan Limit",
"overBy": "Over Limit By",
"gracePeriodEnds": "Grace Period Ends",
"daysRemaining": "{{days}} days remaining",
"selectToArchive": "Select items to archive",
"archiveSelected": "Archive Selected",
"upgradeInstead": "Upgrade Plan Instead",
"exportData": "Export Data",
"archiveWarning": "Archived items will become read-only and cannot be used for new bookings.",
"autoArchiveWarning": "After the grace period, the oldest {{count}} {{type}} will be automatically archived.",
"noOverages": "You are within your plan limits.",
"resolved": "Resolved! Your usage is now within limits."
}
},
"upgrade": {
"title": "Upgrade Your Plan",
"subtitle": "Choose the perfect plan for {{businessName}}",