- Move Feature model from models/database/ to app/modules/billing/models/ (tightly coupled to SubscriptionTier for tier-based access control) - Move ProductMedia from models/database/media.py to app/modules/catalog/models/ (product-specific media associations belong with catalog) - Keep MediaFile as CORE in models/database/media.py (cross-cutting file storage) - Convert legacy feature.py to re-export for backwards compatibility - Update all imports to use canonical module locations Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
70 lines
1.4 KiB
Python
70 lines
1.4 KiB
Python
# app/modules/billing/models/__init__.py
|
|
"""
|
|
Billing module database models.
|
|
|
|
This is the canonical location for billing models. Module models are automatically
|
|
discovered and registered with SQLAlchemy's Base.metadata at startup.
|
|
|
|
Usage:
|
|
from app.modules.billing.models import (
|
|
VendorSubscription,
|
|
SubscriptionTier,
|
|
SubscriptionStatus,
|
|
TierCode,
|
|
Feature,
|
|
FeatureCode,
|
|
)
|
|
"""
|
|
|
|
from app.modules.billing.models.subscription import (
|
|
# Enums
|
|
TierCode,
|
|
SubscriptionStatus,
|
|
AddOnCategory,
|
|
BillingPeriod,
|
|
# Models
|
|
SubscriptionTier,
|
|
AddOnProduct,
|
|
VendorAddOn,
|
|
StripeWebhookEvent,
|
|
BillingHistory,
|
|
VendorSubscription,
|
|
CapacitySnapshot,
|
|
# Legacy constants
|
|
TIER_LIMITS,
|
|
)
|
|
from app.modules.billing.models.feature import (
|
|
# Enums
|
|
FeatureCategory,
|
|
FeatureUILocation,
|
|
# Model
|
|
Feature,
|
|
# Constants
|
|
FeatureCode,
|
|
)
|
|
|
|
__all__ = [
|
|
# Subscription Enums
|
|
"TierCode",
|
|
"SubscriptionStatus",
|
|
"AddOnCategory",
|
|
"BillingPeriod",
|
|
# Subscription Models
|
|
"SubscriptionTier",
|
|
"AddOnProduct",
|
|
"VendorAddOn",
|
|
"StripeWebhookEvent",
|
|
"BillingHistory",
|
|
"VendorSubscription",
|
|
"CapacitySnapshot",
|
|
# Legacy constants
|
|
"TIER_LIMITS",
|
|
# Feature Enums
|
|
"FeatureCategory",
|
|
"FeatureUILocation",
|
|
# Feature Model
|
|
"Feature",
|
|
# Feature Constants
|
|
"FeatureCode",
|
|
]
|