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>
57 lines
1.3 KiB
Python
57 lines
1.3 KiB
Python
# app/modules/billing/schemas/__init__.py
|
|
"""
|
|
Billing module Pydantic schemas.
|
|
|
|
Re-exports subscription schemas from the central schemas location.
|
|
Provides a module-local import path while maintaining backwards compatibility.
|
|
|
|
Usage:
|
|
from app.modules.billing.schemas import (
|
|
SubscriptionCreate,
|
|
SubscriptionResponse,
|
|
TierInfo,
|
|
)
|
|
"""
|
|
|
|
from models.schema.subscription import (
|
|
# Tier schemas
|
|
TierFeatures,
|
|
TierLimits,
|
|
TierInfo,
|
|
# Subscription CRUD schemas
|
|
SubscriptionCreate,
|
|
SubscriptionUpdate,
|
|
SubscriptionResponse,
|
|
# Usage schemas
|
|
SubscriptionUsage,
|
|
UsageSummary,
|
|
SubscriptionStatusResponse,
|
|
# Limit check schemas
|
|
LimitCheckResult,
|
|
CanCreateOrderResponse,
|
|
CanAddProductResponse,
|
|
CanAddTeamMemberResponse,
|
|
FeatureCheckResponse,
|
|
)
|
|
|
|
__all__ = [
|
|
# Tier schemas
|
|
"TierFeatures",
|
|
"TierLimits",
|
|
"TierInfo",
|
|
# Subscription CRUD schemas
|
|
"SubscriptionCreate",
|
|
"SubscriptionUpdate",
|
|
"SubscriptionResponse",
|
|
# Usage schemas
|
|
"SubscriptionUsage",
|
|
"UsageSummary",
|
|
"SubscriptionStatusResponse",
|
|
# Limit check schemas
|
|
"LimitCheckResult",
|
|
"CanCreateOrderResponse",
|
|
"CanAddProductResponse",
|
|
"CanAddTeamMemberResponse",
|
|
"FeatureCheckResponse",
|
|
]
|