feat(billing): migrate frontend templates to feature provider system
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>
This commit is contained in:
@@ -7,40 +7,31 @@ discovered and registered with SQLAlchemy's Base.metadata at startup.
|
||||
|
||||
Usage:
|
||||
from app.modules.billing.models import (
|
||||
VendorSubscription,
|
||||
MerchantSubscription,
|
||||
SubscriptionTier,
|
||||
SubscriptionStatus,
|
||||
TierCode,
|
||||
Feature,
|
||||
FeatureCode,
|
||||
TierFeatureLimit,
|
||||
MerchantFeatureOverride,
|
||||
)
|
||||
"""
|
||||
|
||||
from app.modules.billing.models.merchant_subscription import MerchantSubscription
|
||||
from app.modules.billing.models.subscription import (
|
||||
# Enums
|
||||
TierCode,
|
||||
SubscriptionStatus,
|
||||
AddOnCategory,
|
||||
BillingPeriod,
|
||||
# Models
|
||||
SubscriptionTier,
|
||||
AddOnProduct,
|
||||
VendorAddOn,
|
||||
StripeWebhookEvent,
|
||||
BillingHistory,
|
||||
VendorSubscription,
|
||||
BillingPeriod,
|
||||
CapacitySnapshot,
|
||||
# Legacy constants
|
||||
TIER_LIMITS,
|
||||
StoreAddOn,
|
||||
StripeWebhookEvent,
|
||||
SubscriptionStatus,
|
||||
SubscriptionTier,
|
||||
TierCode,
|
||||
)
|
||||
from app.modules.billing.models.feature import (
|
||||
# Enums
|
||||
FeatureCategory,
|
||||
FeatureUILocation,
|
||||
# Model
|
||||
Feature,
|
||||
# Constants
|
||||
FeatureCode,
|
||||
from app.modules.billing.models.tier_feature_limit import (
|
||||
MerchantFeatureOverride,
|
||||
TierFeatureLimit,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
@@ -52,18 +43,13 @@ __all__ = [
|
||||
# Subscription Models
|
||||
"SubscriptionTier",
|
||||
"AddOnProduct",
|
||||
"VendorAddOn",
|
||||
"StoreAddOn",
|
||||
"StripeWebhookEvent",
|
||||
"BillingHistory",
|
||||
"VendorSubscription",
|
||||
"CapacitySnapshot",
|
||||
# Legacy constants
|
||||
"TIER_LIMITS",
|
||||
# Feature Enums
|
||||
"FeatureCategory",
|
||||
"FeatureUILocation",
|
||||
# Feature Model
|
||||
"Feature",
|
||||
# Feature Constants
|
||||
"FeatureCode",
|
||||
# Merchant Subscription
|
||||
"MerchantSubscription",
|
||||
# Feature Limits
|
||||
"TierFeatureLimit",
|
||||
"MerchantFeatureOverride",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user