diff --git a/app/api/v1/admin/code_quality.py b/app/api/v1/admin/code_quality.py index cac3cfe1..17f75a88 100644 --- a/app/api/v1/admin/code_quality.py +++ b/app/api/v1/admin/code_quality.py @@ -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 diff --git a/app/api/v1/admin/subscriptions.py b/app/api/v1/admin/subscriptions.py index b181c700..22700495 100644 --- a/app/api/v1/admin/subscriptions.py +++ b/app/api/v1/admin/subscriptions.py @@ -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, diff --git a/app/api/v1/admin/vendor_products.py b/app/api/v1/admin/vendor_products.py index d56abc57..659786f3 100644 --- a/app/api/v1/admin/vendor_products.py +++ b/app/api/v1/admin/vendor_products.py @@ -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, diff --git a/app/api/v1/platform/pricing.py b/app/api/v1/platform/pricing.py index e62a5455..a49746fd 100644 --- a/app/api/v1/platform/pricing.py +++ b/app/api/v1/platform/pricing.py @@ -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: diff --git a/app/api/v1/vendor/products.py b/app/api/v1/vendor/products.py index 132cab15..c51f9664 100644 --- a/app/api/v1/vendor/products.py +++ b/app/api/v1/vendor/products.py @@ -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, ) diff --git a/app/handlers/stripe_webhook.py b/app/handlers/stripe_webhook.py index 6a530881..910a2152 100644 --- a/app/handlers/stripe_webhook.py +++ b/app/handlers/stripe_webhook.py @@ -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, diff --git a/app/modules/analytics/services/usage_service.py b/app/modules/analytics/services/usage_service.py index 0bf81891..02732a8c 100644 --- a/app/modules/analytics/services/usage_service.py +++ b/app/modules/analytics/services/usage_service.py @@ -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__) diff --git a/app/modules/billing/routes/api/admin.py b/app/modules/billing/routes/api/admin.py index a76fdc5b..0ef8b0b2 100644 --- a/app/modules/billing/routes/api/admin.py +++ b/app/modules/billing/routes/api/admin.py @@ -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, diff --git a/app/modules/billing/schemas/__init__.py b/app/modules/billing/schemas/__init__.py index 04324717..61302cc1 100644 --- a/app/modules/billing/schemas/__init__.py +++ b/app/modules/billing/schemas/__init__.py @@ -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", ] diff --git a/models/schema/billing.py b/app/modules/billing/schemas/billing.py similarity index 99% rename from models/schema/billing.py rename to app/modules/billing/schemas/billing.py index 7837e0d7..b0f9bd87 100644 --- a/models/schema/billing.py +++ b/app/modules/billing/schemas/billing.py @@ -1,4 +1,4 @@ -# models/schema/billing.py +# app/modules/billing/schemas/billing.py """ Pydantic schemas for billing and subscription operations. diff --git a/app/modules/catalog/schemas/__init__.py b/app/modules/catalog/schemas/__init__.py index 44b033a3..a0deaf8b 100644 --- a/app/modules/catalog/schemas/__init__.py +++ b/app/modules/catalog/schemas/__init__.py @@ -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", ] diff --git a/models/schema/vendor_product.py b/app/modules/catalog/schemas/vendor_product.py similarity index 99% rename from models/schema/vendor_product.py rename to app/modules/catalog/schemas/vendor_product.py index cec20768..ffc05084 100644 --- a/models/schema/vendor_product.py +++ b/app/modules/catalog/schemas/vendor_product.py @@ -1,4 +1,4 @@ -# models/schema/vendor_product.py +# app/modules/catalog/schemas/vendor_product.py """ Pydantic schemas for vendor product catalog operations. diff --git a/app/modules/cms/schemas/__init__.py b/app/modules/cms/schemas/__init__.py index 231a1600..4b139dd4 100644 --- a/app/modules/cms/schemas/__init__.py +++ b/app/modules/cms/schemas/__init__.py @@ -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", ] diff --git a/models/schema/homepage_sections.py b/app/modules/cms/schemas/homepage_sections.py similarity index 100% rename from models/schema/homepage_sections.py rename to app/modules/cms/schemas/homepage_sections.py diff --git a/app/modules/cms/services/content_page_service.py b/app/modules/cms/services/content_page_service.py index 292400f4..4add69bd 100644 --- a/app/modules/cms/services/content_page_service.py +++ b/app/modules/cms/services/content_page_service.py @@ -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"] diff --git a/app/modules/monitoring/services/background_tasks_service.py b/app/modules/monitoring/services/background_tasks_service.py index c8382652..4234bd4e 100644 --- a/app/modules/monitoring/services/background_tasks_service.py +++ b/app/modules/monitoring/services/background_tasks_service.py @@ -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: diff --git a/app/routes/platform_pages.py b/app/routes/platform_pages.py index a140f437..491efc16 100644 --- a/app/routes/platform_pages.py +++ b/app/routes/platform_pages.py @@ -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(): diff --git a/app/services/capacity_forecast_service.py b/app/services/capacity_forecast_service.py index 4e59b56b..f68bb36b 100644 --- a/app/services/capacity_forecast_service.py +++ b/app/services/capacity_forecast_service.py @@ -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, diff --git a/app/services/feature_service.py b/app/services/feature_service.py index 8d29150d..153bfc11 100644 --- a/app/services/feature_service.py +++ b/app/services/feature_service.py @@ -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__) diff --git a/app/services/platform_health_service.py b/app/services/platform_health_service.py index 64777ffd..d26c2549 100644 --- a/app/services/platform_health_service.py +++ b/app/services/platform_health_service.py @@ -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 diff --git a/app/services/platform_pricing_service.py b/app/services/platform_pricing_service.py index 5519c37f..9f26f001 100644 --- a/app/services/platform_pricing_service.py +++ b/app/services/platform_pricing_service.py @@ -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, diff --git a/app/services/platform_signup_service.py b/app/services/platform_signup_service.py index 87c29a70..def0225e 100644 --- a/app/services/platform_signup_service.py +++ b/app/services/platform_signup_service.py @@ -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, diff --git a/app/tasks/code_quality_tasks.py b/app/tasks/code_quality_tasks.py index 36ccbe66..d8271283 100644 --- a/app/tasks/code_quality_tasks.py +++ b/app/tasks/code_quality_tasks.py @@ -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__) diff --git a/app/tasks/subscription_tasks.py b/app/tasks/subscription_tasks.py index 02837de6..63067bd0 100644 --- a/app/tasks/subscription_tasks.py +++ b/app/tasks/subscription_tasks.py @@ -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__) diff --git a/app/tasks/test_runner_tasks.py b/app/tasks/test_runner_tasks.py index 63afd900..116ad2c1 100644 --- a/app/tasks/test_runner_tasks.py +++ b/app/tasks/test_runner_tasks.py @@ -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__) diff --git a/docs/architecture/models-structure.md b/docs/architecture/models-structure.md index 7d57f078..d1e0056d 100644 --- a/docs/architecture/models-structure.md +++ b/docs/architecture/models-structure.md @@ -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:** diff --git a/models/database/__init__.py b/models/database/__init__.py index bd23fd2f..0237963e 100644 --- a/models/database/__init__.py +++ b/models/database/__init__.py @@ -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 diff --git a/models/database/architecture_scan.py b/models/database/architecture_scan.py deleted file mode 100644 index d2caf3fe..00000000 --- a/models/database/architecture_scan.py +++ /dev/null @@ -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", -] diff --git a/models/database/audit.py b/models/database/audit.py deleted file mode 100644 index 05461a88..00000000 --- a/models/database/audit.py +++ /dev/null @@ -1 +0,0 @@ -# AuditLog, DataExportLog models diff --git a/models/database/backup.py b/models/database/backup.py deleted file mode 100644 index a9ac9d64..00000000 --- a/models/database/backup.py +++ /dev/null @@ -1 +0,0 @@ -# BackupLog, RestoreLog models diff --git a/models/database/configuration.py b/models/database/configuration.py deleted file mode 100644 index ae38c260..00000000 --- a/models/database/configuration.py +++ /dev/null @@ -1 +0,0 @@ -# PlatformConfig, VendorConfig, FeatureFlag models diff --git a/models/database/monitoring.py b/models/database/monitoring.py deleted file mode 100644 index 22938930..00000000 --- a/models/database/monitoring.py +++ /dev/null @@ -1 +0,0 @@ -# PerformanceMetric, ErrorLog, SystemAlert models diff --git a/models/database/notification.py b/models/database/notification.py deleted file mode 100644 index 3eb5495b..00000000 --- a/models/database/notification.py +++ /dev/null @@ -1 +0,0 @@ -# NotificationTemplate, NotificationQueue, NotificationLog models diff --git a/models/database/payment.py b/models/database/payment.py deleted file mode 100644 index cf4bb549..00000000 --- a/models/database/payment.py +++ /dev/null @@ -1 +0,0 @@ -# Payment, PaymentMethod, VendorPaymentConfig models diff --git a/models/database/search.py b/models/database/search.py deleted file mode 100644 index 1d8f6e66..00000000 --- a/models/database/search.py +++ /dev/null @@ -1 +0,0 @@ -# SearchIndex, SearchQuery models diff --git a/models/database/subscription.py b/models/database/subscription.py deleted file mode 100644 index c40ea6db..00000000 --- a/models/database/subscription.py +++ /dev/null @@ -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", -] diff --git a/models/database/task.py b/models/database/task.py deleted file mode 100644 index ef22426a..00000000 --- a/models/database/task.py +++ /dev/null @@ -1 +0,0 @@ -# TaskLog model diff --git a/models/database/test_run.py b/models/database/test_run.py deleted file mode 100644 index 159bc18e..00000000 --- a/models/database/test_run.py +++ /dev/null @@ -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", -] diff --git a/models/schema/marketplace.py b/models/schema/marketplace.py deleted file mode 100644 index 4097cbf4..00000000 --- a/models/schema/marketplace.py +++ /dev/null @@ -1 +0,0 @@ -# Marketplace import job models diff --git a/models/schema/monitoring.py b/models/schema/monitoring.py deleted file mode 100644 index c7ab11c1..00000000 --- a/models/schema/monitoring.py +++ /dev/null @@ -1 +0,0 @@ -# Monitoring models diff --git a/models/schema/subscription.py b/models/schema/subscription.py deleted file mode 100644 index baeeeed2..00000000 --- a/models/schema/subscription.py +++ /dev/null @@ -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", -] diff --git a/tests/integration/api/v1/platform/test_pricing.py b/tests/integration/api/v1/platform/test_pricing.py index 9c200a78..0cd789dd 100644 --- a/tests/integration/api/v1/platform/test_pricing.py +++ b/tests/integration/api/v1/platform/test_pricing.py @@ -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, diff --git a/tests/integration/api/v1/platform/test_signup.py b/tests/integration/api/v1/platform/test_signup.py index 1b38a609..3f5e7b0d 100644 --- a/tests/integration/api/v1/platform/test_signup.py +++ b/tests/integration/api/v1/platform/test_signup.py @@ -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 diff --git a/tests/integration/tasks/test_subscription_tasks.py b/tests/integration/tasks/test_subscription_tasks.py index bfb2d3c9..b27f4776 100644 --- a/tests/integration/tasks/test_subscription_tasks.py +++ b/tests/integration/tasks/test_subscription_tasks.py @@ -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 diff --git a/tests/unit/services/test_billing_service.py b/tests/unit/services/test_billing_service.py index bfcb4fcb..d51e6e07 100644 --- a/tests/unit/services/test_billing_service.py +++ b/tests/unit/services/test_billing_service.py @@ -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, diff --git a/tests/unit/services/test_capacity_forecast_service.py b/tests/unit/services/test_capacity_forecast_service.py index a89a75c4..25eba4bd 100644 --- a/tests/unit/services/test_capacity_forecast_service.py +++ b/tests/unit/services/test_capacity_forecast_service.py @@ -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 diff --git a/tests/unit/services/test_feature_service.py b/tests/unit/services/test_feature_service.py index 6f9a1116..d4e87cb1 100644 --- a/tests/unit/services/test_feature_service.py +++ b/tests/unit/services/test_feature_service.py @@ -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 diff --git a/tests/unit/services/test_stripe_webhook_handler.py b/tests/unit/services/test_stripe_webhook_handler.py index a439b6c6..11c14fe0 100644 --- a/tests/unit/services/test_stripe_webhook_handler.py +++ b/tests/unit/services/test_stripe_webhook_handler.py @@ -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, diff --git a/tests/unit/services/test_usage_service.py b/tests/unit/services/test_usage_service.py index cf20eee1..50def26b 100644 --- a/tests/unit/services/test_usage_service.py +++ b/tests/unit/services/test_usage_service.py @@ -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