Implement the foundation for multi-platform support allowing independent business offerings (OMS, Loyalty, etc.) with their own CMS pages. Database Models: - Add Platform model for business offerings (domain, branding, config) - Add VendorPlatform junction table for many-to-many relationship - Update SubscriptionTier with platform_id and CMS limits - Update ContentPage with platform_id, is_platform_page for three-tier hierarchy - Add CMS feature codes (cms_basic, cms_custom_pages, cms_templates, etc.) Three-Tier Content Resolution: 1. Vendor override (platform_id + vendor_id + slug) 2. Vendor default (platform_id + vendor_id=NULL + is_platform_page=False) 3. Platform marketing pages (is_platform_page=True) New Components: - PlatformContextMiddleware for detecting platform from domain/path - ContentPageService updated with full three-tier resolution - Platform folder structure (app/platforms/oms/, app/platforms/loyalty/) - Alembic migration with backfill for existing data Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
188 lines
4.5 KiB
Python
188 lines
4.5 KiB
Python
# models/database/__init__.py
|
|
"""Database models package."""
|
|
|
|
from .admin import (
|
|
AdminAuditLog,
|
|
AdminNotification,
|
|
AdminSession,
|
|
AdminSetting,
|
|
PlatformAlert,
|
|
)
|
|
from .architecture_scan import (
|
|
ArchitectureScan,
|
|
ArchitectureViolation,
|
|
ViolationAssignment,
|
|
ViolationComment,
|
|
)
|
|
from .base import Base
|
|
from .company import Company
|
|
from .content_page import ContentPage
|
|
from .platform import Platform
|
|
from .vendor_platform import VendorPlatform
|
|
from .customer import Customer, CustomerAddress
|
|
from .password_reset_token import PasswordResetToken
|
|
from .email import EmailCategory, EmailLog, EmailStatus, EmailTemplate
|
|
from .vendor_email_template import VendorEmailTemplate
|
|
from .vendor_email_settings import EmailProvider, VendorEmailSettings, PREMIUM_EMAIL_PROVIDERS
|
|
from .feature import Feature, FeatureCategory, FeatureCode, FeatureUILocation
|
|
from .inventory import Inventory
|
|
from .inventory_transaction import InventoryTransaction, TransactionType
|
|
from .invoice import (
|
|
Invoice,
|
|
InvoiceStatus,
|
|
VATRegime,
|
|
VendorInvoiceSettings,
|
|
)
|
|
from .letzshop import (
|
|
LetzshopFulfillmentQueue,
|
|
LetzshopHistoricalImportJob,
|
|
LetzshopSyncLog,
|
|
VendorLetzshopCredentials,
|
|
)
|
|
from .marketplace_import_job import MarketplaceImportError, MarketplaceImportJob
|
|
from .message import (
|
|
Conversation,
|
|
ConversationParticipant,
|
|
ConversationType,
|
|
Message,
|
|
MessageAttachment,
|
|
ParticipantType,
|
|
)
|
|
from .marketplace_product import (
|
|
DigitalDeliveryMethod,
|
|
MarketplaceProduct,
|
|
ProductType,
|
|
)
|
|
from .media import MediaFile, ProductMedia
|
|
from .marketplace_product_translation import MarketplaceProductTranslation
|
|
from .onboarding import OnboardingStatus, OnboardingStep, VendorOnboarding
|
|
from .order import Order, OrderItem
|
|
from .order_item_exception import OrderItemException
|
|
from .product import Product
|
|
from .product_translation import ProductTranslation
|
|
from .subscription import (
|
|
AddOnCategory,
|
|
AddOnProduct,
|
|
BillingHistory,
|
|
BillingPeriod,
|
|
StripeWebhookEvent,
|
|
SubscriptionStatus,
|
|
SubscriptionTier,
|
|
TierCode,
|
|
TIER_LIMITS,
|
|
VendorAddOn,
|
|
VendorSubscription,
|
|
)
|
|
from .test_run import TestCollection, TestResult, TestRun
|
|
from .user import User
|
|
from .vendor import Role, Vendor, VendorUser
|
|
from .vendor_domain import VendorDomain
|
|
from .vendor_theme import VendorTheme
|
|
|
|
__all__ = [
|
|
# Admin-specific models
|
|
"AdminAuditLog",
|
|
"AdminNotification",
|
|
"AdminSetting",
|
|
"PlatformAlert",
|
|
"AdminSession",
|
|
# Architecture/Code Quality
|
|
"ArchitectureScan",
|
|
"ArchitectureViolation",
|
|
"ViolationAssignment",
|
|
"ViolationComment",
|
|
# Test Runs
|
|
"TestRun",
|
|
"TestResult",
|
|
"TestCollection",
|
|
# Base
|
|
"Base",
|
|
# User & Auth
|
|
"User",
|
|
# Company & Vendor
|
|
"Company",
|
|
"Vendor",
|
|
"VendorUser",
|
|
"Role",
|
|
"VendorDomain",
|
|
"VendorTheme",
|
|
# Content
|
|
"ContentPage",
|
|
# Platform
|
|
"Platform",
|
|
"VendorPlatform",
|
|
# Customer & Auth
|
|
"Customer",
|
|
"CustomerAddress",
|
|
"PasswordResetToken",
|
|
# Email
|
|
"EmailCategory",
|
|
"EmailLog",
|
|
"EmailStatus",
|
|
"EmailTemplate",
|
|
"VendorEmailTemplate",
|
|
"VendorEmailSettings",
|
|
"EmailProvider",
|
|
"PREMIUM_EMAIL_PROVIDERS",
|
|
# Features
|
|
"Feature",
|
|
"FeatureCategory",
|
|
"FeatureCode",
|
|
"FeatureUILocation",
|
|
# Product - Enums
|
|
"ProductType",
|
|
"DigitalDeliveryMethod",
|
|
# Product - Models
|
|
"MarketplaceProduct",
|
|
"MarketplaceProductTranslation",
|
|
"Product",
|
|
"ProductTranslation",
|
|
# Import
|
|
"MarketplaceImportJob",
|
|
"MarketplaceImportError",
|
|
# Inventory
|
|
"Inventory",
|
|
"InventoryTransaction",
|
|
"TransactionType",
|
|
# Media
|
|
"MediaFile",
|
|
"ProductMedia",
|
|
# Invoicing
|
|
"Invoice",
|
|
"InvoiceStatus",
|
|
"VATRegime",
|
|
"VendorInvoiceSettings",
|
|
# Orders
|
|
"Order",
|
|
"OrderItem",
|
|
"OrderItemException",
|
|
# Letzshop Integration
|
|
"VendorLetzshopCredentials",
|
|
"LetzshopFulfillmentQueue",
|
|
"LetzshopSyncLog",
|
|
"LetzshopHistoricalImportJob",
|
|
# Subscription & Billing
|
|
"VendorSubscription",
|
|
"SubscriptionStatus",
|
|
"SubscriptionTier",
|
|
"TierCode",
|
|
"TIER_LIMITS",
|
|
"AddOnProduct",
|
|
"AddOnCategory",
|
|
"BillingPeriod",
|
|
"VendorAddOn",
|
|
"BillingHistory",
|
|
"StripeWebhookEvent",
|
|
# Messaging
|
|
"Conversation",
|
|
"ConversationParticipant",
|
|
"ConversationType",
|
|
"Message",
|
|
"MessageAttachment",
|
|
"ParticipantType",
|
|
# Onboarding
|
|
"OnboardingStatus",
|
|
"OnboardingStep",
|
|
"VendorOnboarding",
|
|
]
|