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:
@@ -19,7 +19,7 @@ from app.services.code_quality_service import (
|
||||
code_quality_service,
|
||||
)
|
||||
from app.tasks.code_quality_tasks import execute_code_quality_scan
|
||||
from models.database.architecture_scan import ArchitectureScan
|
||||
from app.modules.dev_tools.models import ArchitectureScan
|
||||
from models.database.user import User
|
||||
from app.modules.analytics.schemas import CodeQualityDashboardStatsResponse
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ from app.core.database import get_db
|
||||
from app.services.admin_subscription_service import admin_subscription_service
|
||||
from app.services.subscription_service import subscription_service
|
||||
from models.database.user import User
|
||||
from models.schema.billing import (
|
||||
from app.modules.billing.schemas import (
|
||||
BillingHistoryListResponse,
|
||||
BillingHistoryWithVendor,
|
||||
SubscriptionStatsResponse,
|
||||
|
||||
@@ -22,7 +22,7 @@ from app.core.database import get_db
|
||||
from app.services.subscription_service import subscription_service
|
||||
from app.services.vendor_product_service import vendor_product_service
|
||||
from models.database.user import User
|
||||
from models.schema.vendor_product import (
|
||||
from app.modules.catalog.schemas import (
|
||||
CatalogVendor,
|
||||
CatalogVendorsResponse,
|
||||
RemoveProductResponse,
|
||||
|
||||
@@ -15,7 +15,7 @@ from sqlalchemy.orm import Session
|
||||
from app.core.database import get_db
|
||||
from app.exceptions import ResourceNotFoundException
|
||||
from app.services.platform_pricing_service import platform_pricing_service
|
||||
from models.database.subscription import TierCode
|
||||
from app.modules.billing.models import TierCode
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@@ -188,7 +188,7 @@ def get_tiers(db: Session = Depends(get_db)) -> list[TierResponse]:
|
||||
return [_tier_to_response(tier, is_from_db=True) for tier in db_tiers]
|
||||
|
||||
# Fallback to hardcoded tiers
|
||||
from models.database.subscription import TIER_LIMITS
|
||||
from app.modules.billing.models import TIER_LIMITS
|
||||
|
||||
tiers = []
|
||||
for tier_code in TIER_LIMITS:
|
||||
|
||||
2
app/api/v1/vendor/products.py
vendored
2
app/api/v1/vendor/products.py
vendored
@@ -26,7 +26,7 @@ from app.modules.catalog.schemas import (
|
||||
ProductToggleResponse,
|
||||
ProductUpdate,
|
||||
)
|
||||
from models.schema.vendor_product import (
|
||||
from app.modules.catalog.schemas import (
|
||||
VendorDirectProductCreate,
|
||||
VendorProductCreateResponse,
|
||||
)
|
||||
|
||||
@@ -15,7 +15,7 @@ from datetime import datetime, timezone
|
||||
import stripe
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from models.database.subscription import (
|
||||
from app.modules.billing.models import (
|
||||
AddOnProduct,
|
||||
BillingHistory,
|
||||
StripeWebhookEvent,
|
||||
|
||||
@@ -17,7 +17,7 @@ from sqlalchemy import func
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from app.modules.catalog.models import Product
|
||||
from models.database.subscription import SubscriptionTier, VendorSubscription
|
||||
from app.modules.billing.models import SubscriptionTier, VendorSubscription
|
||||
from models.database.vendor import VendorUser
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -19,7 +19,7 @@ from app.api.deps import get_current_admin_api, require_module_access
|
||||
from app.core.database import get_db
|
||||
from app.modules.billing.services import admin_subscription_service, subscription_service
|
||||
from models.database.user import User
|
||||
from models.schema.billing import (
|
||||
from app.modules.billing.schemas import (
|
||||
BillingHistoryListResponse,
|
||||
BillingHistoryWithVendor,
|
||||
SubscriptionStatsResponse,
|
||||
|
||||
@@ -32,24 +32,70 @@ from app.modules.billing.schemas.subscription import (
|
||||
CanAddTeamMemberResponse,
|
||||
FeatureCheckResponse,
|
||||
)
|
||||
from app.modules.billing.schemas.billing import (
|
||||
# Subscription Tier Admin schemas
|
||||
SubscriptionTierBase,
|
||||
SubscriptionTierCreate,
|
||||
SubscriptionTierUpdate,
|
||||
SubscriptionTierResponse,
|
||||
SubscriptionTierListResponse,
|
||||
# Vendor Subscription schemas
|
||||
VendorSubscriptionResponse,
|
||||
VendorSubscriptionWithVendor,
|
||||
VendorSubscriptionListResponse,
|
||||
VendorSubscriptionCreate,
|
||||
VendorSubscriptionUpdate,
|
||||
# Billing History schemas
|
||||
BillingHistoryResponse,
|
||||
BillingHistoryWithVendor,
|
||||
BillingHistoryListResponse,
|
||||
# Checkout & Portal schemas
|
||||
CheckoutRequest,
|
||||
CheckoutResponse,
|
||||
PortalSessionResponse,
|
||||
# Stats schemas
|
||||
SubscriptionStatsResponse,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
# Tier schemas
|
||||
# Tier schemas (subscription.py)
|
||||
"TierFeatures",
|
||||
"TierLimits",
|
||||
"TierInfo",
|
||||
# Subscription CRUD schemas
|
||||
# Subscription CRUD schemas (subscription.py)
|
||||
"SubscriptionCreate",
|
||||
"SubscriptionUpdate",
|
||||
"SubscriptionResponse",
|
||||
# Usage schemas
|
||||
# Usage schemas (subscription.py)
|
||||
"SubscriptionUsage",
|
||||
"UsageSummary",
|
||||
"SubscriptionStatusResponse",
|
||||
# Limit check schemas
|
||||
# Limit check schemas (subscription.py)
|
||||
"LimitCheckResult",
|
||||
"CanCreateOrderResponse",
|
||||
"CanAddProductResponse",
|
||||
"CanAddTeamMemberResponse",
|
||||
"FeatureCheckResponse",
|
||||
# Subscription Tier Admin schemas (billing.py)
|
||||
"SubscriptionTierBase",
|
||||
"SubscriptionTierCreate",
|
||||
"SubscriptionTierUpdate",
|
||||
"SubscriptionTierResponse",
|
||||
"SubscriptionTierListResponse",
|
||||
# Vendor Subscription schemas (billing.py)
|
||||
"VendorSubscriptionResponse",
|
||||
"VendorSubscriptionWithVendor",
|
||||
"VendorSubscriptionListResponse",
|
||||
"VendorSubscriptionCreate",
|
||||
"VendorSubscriptionUpdate",
|
||||
# Billing History schemas (billing.py)
|
||||
"BillingHistoryResponse",
|
||||
"BillingHistoryWithVendor",
|
||||
"BillingHistoryListResponse",
|
||||
# Checkout & Portal schemas (billing.py)
|
||||
"CheckoutRequest",
|
||||
"CheckoutResponse",
|
||||
"PortalSessionResponse",
|
||||
# Stats schemas (billing.py)
|
||||
"SubscriptionStatsResponse",
|
||||
]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# models/schema/billing.py
|
||||
# app/modules/billing/schemas/billing.py
|
||||
"""
|
||||
Pydantic schemas for billing and subscription operations.
|
||||
|
||||
@@ -15,6 +15,23 @@ from app.modules.catalog.schemas.product import (
|
||||
ProductDeleteResponse,
|
||||
ProductToggleResponse,
|
||||
)
|
||||
from app.modules.catalog.schemas.vendor_product import (
|
||||
# List/Detail schemas
|
||||
VendorProductListItem,
|
||||
VendorProductListResponse,
|
||||
VendorProductStats,
|
||||
VendorProductDetail,
|
||||
# Catalog vendor schemas
|
||||
CatalogVendor,
|
||||
CatalogVendorsResponse,
|
||||
# CRUD schemas
|
||||
TranslationUpdate,
|
||||
VendorProductCreate,
|
||||
VendorDirectProductCreate,
|
||||
VendorProductUpdate,
|
||||
VendorProductCreateResponse,
|
||||
RemoveProductResponse,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
# Catalog browsing schemas (storefront)
|
||||
@@ -29,4 +46,17 @@ __all__ = [
|
||||
"ProductListResponse",
|
||||
"ProductDeleteResponse",
|
||||
"ProductToggleResponse",
|
||||
# Vendor Product schemas (admin)
|
||||
"VendorProductListItem",
|
||||
"VendorProductListResponse",
|
||||
"VendorProductStats",
|
||||
"VendorProductDetail",
|
||||
"CatalogVendor",
|
||||
"CatalogVendorsResponse",
|
||||
"TranslationUpdate",
|
||||
"VendorProductCreate",
|
||||
"VendorDirectProductCreate",
|
||||
"VendorProductUpdate",
|
||||
"VendorProductCreateResponse",
|
||||
"RemoveProductResponse",
|
||||
]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# models/schema/vendor_product.py
|
||||
# app/modules/catalog/schemas/vendor_product.py
|
||||
"""
|
||||
Pydantic schemas for vendor product catalog operations.
|
||||
|
||||
@@ -8,7 +8,7 @@ from app.modules.cms.schemas.content_page import (
|
||||
ContentPageCreate,
|
||||
ContentPageUpdate,
|
||||
ContentPageResponse,
|
||||
HomepageSectionsResponse,
|
||||
HomepageSectionsResponse as ContentPageHomepageSectionsResponse,
|
||||
SectionUpdateResponse,
|
||||
# Vendor schemas
|
||||
VendorContentPageCreate,
|
||||
@@ -18,19 +18,46 @@ from app.modules.cms.schemas.content_page import (
|
||||
PublicContentPageResponse,
|
||||
ContentPageListItem,
|
||||
)
|
||||
from app.modules.cms.schemas.homepage_sections import (
|
||||
# Translatable text
|
||||
TranslatableText,
|
||||
# Section components
|
||||
HeroButton,
|
||||
HeroSection,
|
||||
FeatureCard,
|
||||
FeaturesSection,
|
||||
PricingSection,
|
||||
CTASection,
|
||||
# Main structure
|
||||
HomepageSections,
|
||||
# API schemas
|
||||
SectionUpdateRequest,
|
||||
HomepageSectionsResponse,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
# Admin
|
||||
# Content Page - Admin
|
||||
"ContentPageCreate",
|
||||
"ContentPageUpdate",
|
||||
"ContentPageResponse",
|
||||
"HomepageSectionsResponse",
|
||||
"ContentPageHomepageSectionsResponse",
|
||||
"SectionUpdateResponse",
|
||||
# Vendor
|
||||
# Content Page - Vendor
|
||||
"VendorContentPageCreate",
|
||||
"VendorContentPageUpdate",
|
||||
"CMSUsageResponse",
|
||||
# Public
|
||||
# Content Page - Public
|
||||
"PublicContentPageResponse",
|
||||
"ContentPageListItem",
|
||||
# Homepage Sections
|
||||
"TranslatableText",
|
||||
"HeroButton",
|
||||
"HeroSection",
|
||||
"FeatureCard",
|
||||
"FeaturesSection",
|
||||
"PricingSection",
|
||||
"CTASection",
|
||||
"HomepageSections",
|
||||
"SectionUpdateRequest",
|
||||
"HomepageSectionsResponse",
|
||||
]
|
||||
|
||||
@@ -899,7 +899,7 @@ class ContentPageService:
|
||||
ContentPageNotFoundException: If page not found
|
||||
ValidationError: If sections schema invalid
|
||||
"""
|
||||
from models.schema.homepage_sections import HomepageSections
|
||||
from app.modules.cms.schemas import HomepageSections
|
||||
|
||||
page = ContentPageService.get_page_by_id_or_raise(db, page_id)
|
||||
|
||||
@@ -941,7 +941,7 @@ class ContentPageService:
|
||||
ContentPageNotFoundException: If page not found
|
||||
ValueError: If section name is invalid
|
||||
"""
|
||||
from models.schema.homepage_sections import (
|
||||
from app.modules.cms.schemas import (
|
||||
HeroSection,
|
||||
FeaturesSection,
|
||||
PricingSection,
|
||||
@@ -989,7 +989,7 @@ class ContentPageService:
|
||||
Returns:
|
||||
Empty sections dict with language placeholders
|
||||
"""
|
||||
from models.schema.homepage_sections import HomepageSections
|
||||
from app.modules.cms.schemas import HomepageSections
|
||||
|
||||
if languages is None:
|
||||
languages = ["fr", "de", "en"]
|
||||
|
||||
@@ -9,9 +9,9 @@ from datetime import UTC, datetime
|
||||
from sqlalchemy import case, desc, func
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from models.database.architecture_scan import ArchitectureScan
|
||||
from app.modules.dev_tools.models import ArchitectureScan
|
||||
from app.modules.marketplace.models import MarketplaceImportJob
|
||||
from models.database.test_run import TestRun
|
||||
from app.modules.dev_tools.models import TestRun
|
||||
|
||||
|
||||
class BackgroundTasksService:
|
||||
|
||||
@@ -172,7 +172,7 @@ async def homepage(
|
||||
context["platform"] = platform
|
||||
|
||||
# Include subscription tiers for pricing section
|
||||
from models.database.subscription import TIER_LIMITS, TierCode
|
||||
from app.modules.billing.models import TIER_LIMITS, TierCode
|
||||
|
||||
tiers = []
|
||||
for tier_code, limits in TIER_LIMITS.items():
|
||||
@@ -202,7 +202,7 @@ async def homepage(
|
||||
context["platform"] = platform
|
||||
|
||||
# Fetch tiers for display (use API service internally)
|
||||
from models.database.subscription import TIER_LIMITS, TierCode
|
||||
from app.modules.billing.models import TIER_LIMITS, TierCode
|
||||
|
||||
tiers = []
|
||||
for tier_code, limits in TIER_LIMITS.items():
|
||||
@@ -276,7 +276,7 @@ async def pricing_page(
|
||||
context = get_platform_context(request, db)
|
||||
|
||||
# Reuse tier data from homepage
|
||||
from models.database.subscription import TIER_LIMITS, TierCode
|
||||
from app.modules.billing.models import TIER_LIMITS, TierCode
|
||||
|
||||
tiers = []
|
||||
for tier_code, limits in TIER_LIMITS.items():
|
||||
@@ -352,7 +352,7 @@ async def signup_page(
|
||||
context["is_annual"] = annual
|
||||
|
||||
# Get tiers for tier selection step
|
||||
from models.database.subscription import TIER_LIMITS, TierCode
|
||||
from app.modules.billing.models import TIER_LIMITS, TierCode
|
||||
|
||||
tiers = []
|
||||
for tier_code, limits in TIER_LIMITS.items():
|
||||
|
||||
@@ -17,7 +17,7 @@ from sqlalchemy import func
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from app.modules.catalog.models import Product
|
||||
from models.database.subscription import (
|
||||
from app.modules.billing.models import (
|
||||
CapacitySnapshot,
|
||||
SubscriptionStatus,
|
||||
VendorSubscription,
|
||||
|
||||
@@ -35,7 +35,7 @@ from app.exceptions.feature import (
|
||||
TierNotFoundError,
|
||||
)
|
||||
from models.database.feature import Feature, FeatureCode
|
||||
from models.database.subscription import SubscriptionTier, VendorSubscription
|
||||
from app.modules.billing.models import SubscriptionTier, VendorSubscription
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -172,7 +172,7 @@ class PlatformHealthService:
|
||||
|
||||
Returns aggregated limits and current usage for capacity planning.
|
||||
"""
|
||||
from models.database.subscription import VendorSubscription
|
||||
from app.modules.billing.models import VendorSubscription
|
||||
from models.database.vendor import VendorUser
|
||||
|
||||
# Get all active subscriptions with their limits
|
||||
|
||||
@@ -7,7 +7,7 @@ Handles database operations for subscription tiers and add-on products.
|
||||
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from models.database.subscription import (
|
||||
from app.modules.billing.models import (
|
||||
AddOnProduct,
|
||||
SubscriptionTier,
|
||||
TIER_LIMITS,
|
||||
|
||||
@@ -27,7 +27,7 @@ from app.services.onboarding_service import OnboardingService
|
||||
from app.services.stripe_service import stripe_service
|
||||
from middleware.auth import AuthManager
|
||||
from models.database.company import Company
|
||||
from models.database.subscription import (
|
||||
from app.modules.billing.models import (
|
||||
SubscriptionStatus,
|
||||
TierCode,
|
||||
TIER_LIMITS,
|
||||
|
||||
@@ -8,7 +8,7 @@ from datetime import UTC, datetime
|
||||
|
||||
from app.core.database import SessionLocal
|
||||
from app.services.admin_notification_service import admin_notification_service
|
||||
from models.database.architecture_scan import ArchitectureScan, ArchitectureViolation
|
||||
from app.modules.dev_tools.models import ArchitectureScan, ArchitectureViolation
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ from datetime import UTC, datetime, timedelta
|
||||
|
||||
from app.core.database import SessionLocal
|
||||
from app.services.stripe_service import stripe_service
|
||||
from models.database.subscription import SubscriptionStatus, VendorSubscription
|
||||
from app.modules.billing.models import SubscriptionStatus, VendorSubscription
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import logging
|
||||
|
||||
from app.core.database import SessionLocal
|
||||
from app.services.test_runner_service import test_runner_service
|
||||
from models.database.test_run import TestRun
|
||||
from app.modules.dev_tools.models import TestRun
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -435,7 +435,7 @@ class ArchitectureScan(Base):
|
||||
**Import in Service:**
|
||||
```python
|
||||
# app/services/code_quality_service.py
|
||||
from models.database.architecture_scan import ArchitectureScan
|
||||
from app.modules.dev_tools.models import ArchitectureScan
|
||||
```
|
||||
|
||||
**Pydantic Schema:**
|
||||
|
||||
@@ -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",
|
||||
]
|
||||
@@ -1 +0,0 @@
|
||||
# Marketplace import job models
|
||||
@@ -1 +0,0 @@
|
||||
# Monitoring models
|
||||
@@ -1,58 +0,0 @@
|
||||
# models/schema/subscription.py
|
||||
"""
|
||||
Legacy location for subscription schemas.
|
||||
|
||||
MIGRATED: All schemas have been moved to app.modules.billing.schemas.subscription.
|
||||
|
||||
New location:
|
||||
from app.modules.billing.schemas import (
|
||||
SubscriptionCreate,
|
||||
SubscriptionResponse,
|
||||
TierInfo,
|
||||
)
|
||||
|
||||
This file re-exports from the new location for backward compatibility.
|
||||
"""
|
||||
|
||||
# Re-export everything from the new canonical location
|
||||
from app.modules.billing.schemas.subscription import (
|
||||
# Tier schemas
|
||||
TierFeatures,
|
||||
TierLimits,
|
||||
TierInfo,
|
||||
# Subscription CRUD schemas
|
||||
SubscriptionCreate,
|
||||
SubscriptionUpdate,
|
||||
SubscriptionResponse,
|
||||
# Usage schemas
|
||||
SubscriptionUsage,
|
||||
UsageSummary,
|
||||
SubscriptionStatusResponse,
|
||||
# Limit check schemas
|
||||
LimitCheckResult,
|
||||
CanCreateOrderResponse,
|
||||
CanAddProductResponse,
|
||||
CanAddTeamMemberResponse,
|
||||
FeatureCheckResponse,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
# Tier schemas
|
||||
"TierFeatures",
|
||||
"TierLimits",
|
||||
"TierInfo",
|
||||
# Subscription CRUD schemas
|
||||
"SubscriptionCreate",
|
||||
"SubscriptionUpdate",
|
||||
"SubscriptionResponse",
|
||||
# Usage schemas
|
||||
"SubscriptionUsage",
|
||||
"UsageSummary",
|
||||
"SubscriptionStatusResponse",
|
||||
# Limit check schemas
|
||||
"LimitCheckResult",
|
||||
"CanCreateOrderResponse",
|
||||
"CanAddProductResponse",
|
||||
"CanAddTeamMemberResponse",
|
||||
"FeatureCheckResponse",
|
||||
]
|
||||
@@ -6,7 +6,7 @@ Tests the /api/v1/platform/pricing/* endpoints.
|
||||
|
||||
import pytest
|
||||
|
||||
from models.database.subscription import (
|
||||
from app.modules.billing.models import (
|
||||
AddOnProduct,
|
||||
SubscriptionTier,
|
||||
TierCode,
|
||||
|
||||
@@ -9,7 +9,7 @@ from unittest.mock import MagicMock, patch
|
||||
import pytest
|
||||
|
||||
from models.database.company import Company
|
||||
from models.database.subscription import TierCode
|
||||
from app.modules.billing.models import TierCode
|
||||
from models.database.user import User
|
||||
from models.database.vendor import Vendor
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ from app.tasks.subscription_tasks import (
|
||||
reset_period_counters,
|
||||
sync_stripe_status,
|
||||
)
|
||||
from models.database.subscription import SubscriptionStatus, VendorSubscription
|
||||
from app.modules.billing.models import SubscriptionStatus, VendorSubscription
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
@@ -15,7 +15,7 @@ from app.services.billing_service import (
|
||||
SubscriptionNotCancelledError,
|
||||
TierNotFoundError,
|
||||
)
|
||||
from models.database.subscription import (
|
||||
from app.modules.billing.models import (
|
||||
AddOnProduct,
|
||||
BillingHistory,
|
||||
SubscriptionStatus,
|
||||
|
||||
@@ -20,7 +20,7 @@ from app.services.capacity_forecast_service import (
|
||||
CapacityForecastService,
|
||||
capacity_forecast_service,
|
||||
)
|
||||
from models.database.subscription import CapacitySnapshot
|
||||
from app.modules.billing.models import CapacitySnapshot
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
|
||||
@@ -6,7 +6,7 @@ import pytest
|
||||
from app.exceptions import FeatureNotFoundError, InvalidFeatureCodesError, TierNotFoundError
|
||||
from app.services.feature_service import FeatureService, feature_service
|
||||
from models.database.feature import Feature
|
||||
from models.database.subscription import SubscriptionTier, VendorSubscription
|
||||
from app.modules.billing.models import SubscriptionTier, VendorSubscription
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
|
||||
@@ -7,7 +7,7 @@ from unittest.mock import MagicMock, patch
|
||||
import pytest
|
||||
|
||||
from app.handlers.stripe_webhook import StripeWebhookHandler
|
||||
from models.database.subscription import (
|
||||
from app.modules.billing.models import (
|
||||
BillingHistory,
|
||||
StripeWebhookEvent,
|
||||
SubscriptionStatus,
|
||||
|
||||
@@ -5,7 +5,7 @@ import pytest
|
||||
|
||||
from app.services.usage_service import UsageService, usage_service
|
||||
from app.modules.catalog.models import Product
|
||||
from models.database.subscription import SubscriptionTier, VendorSubscription
|
||||
from app.modules.billing.models import SubscriptionTier, VendorSubscription
|
||||
from models.database.vendor import VendorUser
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user