feat: complete billing module migration (Phase 5)
Migrates billing module to self-contained structure: - Create app/modules/billing/services/ with subscription, stripe, admin services - Create app/modules/billing/models/ re-exporting from central location - Create app/modules/billing/schemas/ re-exporting from central location - Create app/modules/billing/tasks/ with 4 scheduled Celery tasks - Create app/modules/billing/exceptions.py with module-specific exceptions - Update definition.py with is_self_contained=True and scheduled_tasks Celery task migration: - reset_period_counters -> billing module - check_trial_expirations -> billing module - sync_stripe_status -> billing module - cleanup_stale_subscriptions -> billing module - capture_capacity_snapshot remains in legacy (will go to monitoring) Backward compatibility: - Create re-exports in app/services/ for subscription, stripe, admin services - Old import paths continue to work - Update celery_config.py to use module-defined schedules Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,7 @@ This module provides:
|
||||
- Vendor subscription CRUD
|
||||
- Billing history and invoices
|
||||
- Stripe integration
|
||||
- Scheduled tasks for subscription lifecycle
|
||||
|
||||
Routes:
|
||||
- Admin: /api/v1/admin/subscriptions/*
|
||||
@@ -15,8 +16,17 @@ Routes:
|
||||
Menu Items:
|
||||
- Admin: subscription-tiers, subscriptions, billing-history
|
||||
- Vendor: billing, invoices
|
||||
|
||||
Usage:
|
||||
from app.modules.billing import billing_module
|
||||
from app.modules.billing.services import subscription_service, stripe_service
|
||||
from app.modules.billing.models import VendorSubscription, SubscriptionTier
|
||||
from app.modules.billing.exceptions import TierLimitExceededException
|
||||
"""
|
||||
|
||||
from app.modules.billing.definition import billing_module
|
||||
from app.modules.billing.definition import billing_module, get_billing_module_with_routers
|
||||
|
||||
__all__ = ["billing_module"]
|
||||
__all__ = [
|
||||
"billing_module",
|
||||
"get_billing_module_with_routers",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user