Replace hardcoded subscription fields (orders_limit, products_limit,
team_members_limit) across 5 frontend pages with dynamic feature
provider APIs. Add admin convenience endpoint for store subscription
lookup. Remove legacy stubs (StoreSubscription, FeatureCode, Feature,
TIER_LIMITS, FeatureInfo, FeatureUpgradeInfo) and schema aliases.
Pages updated:
- Admin subscriptions: dynamic feature overrides editor
- Admin tiers: correct feature catalog/limits API URLs
- Store billing: usage metrics from /store/billing/usage
- Merchant subscription detail: tier.feature_limits rendering
- Admin store detail: new GET /admin/subscriptions/store/{id} endpoint
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
56 lines
1.3 KiB
Python
56 lines
1.3 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 (
|
|
MerchantSubscription,
|
|
SubscriptionTier,
|
|
SubscriptionStatus,
|
|
TierCode,
|
|
TierFeatureLimit,
|
|
MerchantFeatureOverride,
|
|
)
|
|
"""
|
|
|
|
from app.modules.billing.models.merchant_subscription import MerchantSubscription
|
|
from app.modules.billing.models.subscription import (
|
|
AddOnCategory,
|
|
AddOnProduct,
|
|
BillingHistory,
|
|
BillingPeriod,
|
|
CapacitySnapshot,
|
|
StoreAddOn,
|
|
StripeWebhookEvent,
|
|
SubscriptionStatus,
|
|
SubscriptionTier,
|
|
TierCode,
|
|
)
|
|
from app.modules.billing.models.tier_feature_limit import (
|
|
MerchantFeatureOverride,
|
|
TierFeatureLimit,
|
|
)
|
|
|
|
__all__ = [
|
|
# Subscription Enums
|
|
"TierCode",
|
|
"SubscriptionStatus",
|
|
"AddOnCategory",
|
|
"BillingPeriod",
|
|
# Subscription Models
|
|
"SubscriptionTier",
|
|
"AddOnProduct",
|
|
"StoreAddOn",
|
|
"StripeWebhookEvent",
|
|
"BillingHistory",
|
|
"CapacitySnapshot",
|
|
# Merchant Subscription
|
|
"MerchantSubscription",
|
|
# Feature Limits
|
|
"TierFeatureLimit",
|
|
"MerchantFeatureOverride",
|
|
]
|