refactor: clean up legacy models and migrate remaining schemas
Delete empty stub files from models/database/: - audit.py, backup.py, configuration.py, monitoring.py - notification.py, payment.py, search.py, task.py Delete re-export files: - models/database/subscription.py → app.modules.billing.models - models/database/architecture_scan.py → app.modules.dev_tools.models - models/database/test_run.py → app.modules.dev_tools.models - models/schema/subscription.py → app.modules.billing.schemas - models/schema/marketplace.py (empty) - models/schema/monitoring.py (empty) Migrate schemas to canonical module locations: - billing.py → app/modules/billing/schemas/ - vendor_product.py → app/modules/catalog/schemas/ - homepage_sections.py → app/modules/cms/schemas/ Keep as CORE (framework-level, used everywhere): - models/schema/: admin, auth, base, company, email, image, media, team, vendor* - models/database/: admin*, base, company, email, feature, media, platform*, user, vendor* Update 30+ files to use canonical import locations. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -32,7 +32,7 @@ from .admin import (
|
||||
from app.modules.messaging.models import AdminNotification
|
||||
from .admin_menu_config import AdminMenuConfig, FrontendType, MANDATORY_MENU_ITEMS
|
||||
from .admin_platform import AdminPlatform
|
||||
from .architecture_scan import (
|
||||
from app.modules.dev_tools.models import (
|
||||
ArchitectureScan,
|
||||
ArchitectureViolation,
|
||||
ViolationAssignment,
|
||||
@@ -82,7 +82,7 @@ from app.modules.marketplace.models import OnboardingStatus, OnboardingStep, Ven
|
||||
from app.modules.orders.models import Order, OrderItem
|
||||
from app.modules.orders.models import OrderItemException
|
||||
from app.modules.catalog.models import Product, ProductTranslation
|
||||
from .subscription import (
|
||||
from app.modules.billing.models import (
|
||||
AddOnCategory,
|
||||
AddOnProduct,
|
||||
BillingHistory,
|
||||
@@ -95,7 +95,7 @@ from .subscription import (
|
||||
VendorAddOn,
|
||||
VendorSubscription,
|
||||
)
|
||||
from .test_run import TestCollection, TestResult, TestRun
|
||||
from app.modules.dev_tools.models import TestCollection, TestResult, TestRun
|
||||
from .user import User
|
||||
from .vendor import Role, Vendor, VendorUser
|
||||
from .vendor_domain import VendorDomain
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
# models/database/architecture_scan.py
|
||||
"""
|
||||
Architecture Scan Models - LEGACY LOCATION
|
||||
|
||||
This file exists for backward compatibility.
|
||||
The canonical location is now: app/modules/dev_tools/models/architecture_scan.py
|
||||
|
||||
All imports should use the new location:
|
||||
from app.modules.dev_tools.models import ArchitectureScan, ArchitectureViolation, ...
|
||||
"""
|
||||
|
||||
# Re-export from canonical location for backward compatibility
|
||||
from app.modules.dev_tools.models.architecture_scan import (
|
||||
ArchitectureScan,
|
||||
ArchitectureViolation,
|
||||
ArchitectureRule,
|
||||
ViolationAssignment,
|
||||
ViolationComment,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"ArchitectureScan",
|
||||
"ArchitectureViolation",
|
||||
"ArchitectureRule",
|
||||
"ViolationAssignment",
|
||||
"ViolationComment",
|
||||
]
|
||||
@@ -1 +0,0 @@
|
||||
# AuditLog, DataExportLog models
|
||||
@@ -1 +0,0 @@
|
||||
# BackupLog, RestoreLog models
|
||||
@@ -1 +0,0 @@
|
||||
# PlatformConfig, VendorConfig, FeatureFlag models
|
||||
@@ -1 +0,0 @@
|
||||
# PerformanceMetric, ErrorLog, SystemAlert models
|
||||
@@ -1 +0,0 @@
|
||||
# NotificationTemplate, NotificationQueue, NotificationLog models
|
||||
@@ -1 +0,0 @@
|
||||
# Payment, PaymentMethod, VendorPaymentConfig models
|
||||
@@ -1 +0,0 @@
|
||||
# SearchIndex, SearchQuery models
|
||||
@@ -1,53 +0,0 @@
|
||||
# models/database/subscription.py
|
||||
"""
|
||||
Legacy location for subscription models.
|
||||
|
||||
MIGRATED: All models have been moved to app.modules.billing.models.subscription.
|
||||
|
||||
New location:
|
||||
from app.modules.billing.models import (
|
||||
VendorSubscription,
|
||||
SubscriptionTier,
|
||||
TierCode,
|
||||
SubscriptionStatus,
|
||||
)
|
||||
|
||||
This file re-exports from the new location for backward compatibility.
|
||||
"""
|
||||
|
||||
# Re-export everything from the new canonical location
|
||||
from app.modules.billing.models.subscription import (
|
||||
# Enums
|
||||
TierCode,
|
||||
SubscriptionStatus,
|
||||
AddOnCategory,
|
||||
BillingPeriod,
|
||||
# Models
|
||||
SubscriptionTier,
|
||||
AddOnProduct,
|
||||
VendorAddOn,
|
||||
StripeWebhookEvent,
|
||||
BillingHistory,
|
||||
VendorSubscription,
|
||||
CapacitySnapshot,
|
||||
# Legacy constants
|
||||
TIER_LIMITS,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
# Enums
|
||||
"TierCode",
|
||||
"SubscriptionStatus",
|
||||
"AddOnCategory",
|
||||
"BillingPeriod",
|
||||
# Models
|
||||
"SubscriptionTier",
|
||||
"AddOnProduct",
|
||||
"VendorAddOn",
|
||||
"StripeWebhookEvent",
|
||||
"BillingHistory",
|
||||
"VendorSubscription",
|
||||
"CapacitySnapshot",
|
||||
# Legacy constants
|
||||
"TIER_LIMITS",
|
||||
]
|
||||
@@ -1 +0,0 @@
|
||||
# TaskLog model
|
||||
@@ -1,23 +0,0 @@
|
||||
# models/database/test_run.py
|
||||
"""
|
||||
Test Run Models - LEGACY LOCATION
|
||||
|
||||
This file exists for backward compatibility.
|
||||
The canonical location is now: app/modules/dev_tools/models/test_run.py
|
||||
|
||||
All imports should use the new location:
|
||||
from app.modules.dev_tools.models import TestRun, TestResult, TestCollection
|
||||
"""
|
||||
|
||||
# Re-export from canonical location for backward compatibility
|
||||
from app.modules.dev_tools.models.test_run import (
|
||||
TestRun,
|
||||
TestResult,
|
||||
TestCollection,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"TestRun",
|
||||
"TestResult",
|
||||
"TestCollection",
|
||||
]
|
||||
Reference in New Issue
Block a user