feat(subscriptions): migrate subscription management to merchant level and seed tiers
Move subscription create/edit from store detail (broken endpoint) to merchant detail page with proper modal UI. Seed 4 subscription tiers (Essential, Professional, Business, Enterprise) in init_production.py. Also includes cross-module dependency declarations, store domain platform_id migration, platform context middleware, CMS route fixes, and migration backups. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -52,14 +52,25 @@ class StoreDomain(Base, TimestampMixin):
|
||||
is_verified = Column(Boolean, default=False, nullable=False)
|
||||
verified_at = Column(DateTime(timezone=True), nullable=True)
|
||||
|
||||
# Platform association (for platform context resolution from custom domains)
|
||||
platform_id = Column(
|
||||
Integer,
|
||||
ForeignKey("platforms.id", ondelete="SET NULL"),
|
||||
nullable=True,
|
||||
index=True,
|
||||
comment="Platform this domain is associated with (for platform context resolution)",
|
||||
)
|
||||
|
||||
# Relationships
|
||||
store = relationship("Store", back_populates="domains")
|
||||
platform = relationship("Platform")
|
||||
|
||||
# Constraints
|
||||
__table_args__ = (
|
||||
UniqueConstraint("store_id", "domain", name="uq_store_domain"),
|
||||
Index("idx_domain_active", "domain", "is_active"),
|
||||
Index("idx_store_domain_primary", "store_id", "is_primary"),
|
||||
Index("idx_store_domain_platform", "platform_id"),
|
||||
)
|
||||
|
||||
def __repr__(self):
|
||||
|
||||
Reference in New Issue
Block a user