Phase 1 - Vendor Router Integration: - Wire up vendor module routers in app/api/v1/vendor/__init__.py - Use lazy imports via __getattr__ to avoid circular dependencies Phase 2 - Extract Remaining Modules: - Create 6 new module directories: customers, cms, analytics, messaging, dev_tools, monitoring - Each module has definition.py and route wrappers - Update registry to import from extracted modules Phase 3 - Database Table Migration: - Add PlatformModule junction table for auditable module tracking - Add migration zc2m3n4o5p6q7_add_platform_modules_table.py - Add modules relationship to Platform model - Update ModuleService with JSON-to-junction-table migration Phase 4 - Module-Specific Configuration UI: - Add /api/v1/admin/module-config/* endpoints - Add module-config.html template and JS Phase 5 - Integration Tests: - Add tests/fixtures/module_fixtures.py - Add tests/integration/api/v1/admin/test_modules.py - Add tests/integration/api/v1/modules/test_module_access.py Architecture fixes: - Fix JS-003 errors: use ...data() directly in Alpine components - Fix JS-005 warnings: add init() guards to prevent duplicate init - Fix API-001 errors: add MenuActionResponse Pydantic model - Add FE-008 noqa for dynamic number input in template Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
196 lines
4.8 KiB
Python
196 lines
4.8 KiB
Python
# models/database/__init__.py
|
|
"""Database models package."""
|
|
|
|
from .admin import (
|
|
AdminAuditLog,
|
|
AdminNotification,
|
|
AdminSession,
|
|
AdminSetting,
|
|
PlatformAlert,
|
|
)
|
|
from .admin_menu_config import AdminMenuConfig, FrontendType, MANDATORY_MENU_ITEMS
|
|
from .admin_platform import AdminPlatform
|
|
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 .platform_module import PlatformModule
|
|
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",
|
|
"AdminMenuConfig",
|
|
"FrontendType",
|
|
"AdminNotification",
|
|
"AdminPlatform",
|
|
"AdminSetting",
|
|
"MANDATORY_MENU_ITEMS",
|
|
"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",
|
|
"PlatformModule",
|
|
"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",
|
|
]
|