refactor: migrate templates and static files to self-contained modules
Templates Migration: - Migrate admin templates to modules (tenancy, billing, monitoring, marketplace, etc.) - Migrate vendor templates to modules (tenancy, billing, orders, messaging, etc.) - Migrate storefront templates to modules (catalog, customers, orders, cart, checkout, cms) - Migrate public templates to modules (billing, marketplace, cms) - Keep shared templates in app/templates/ (base.html, errors/, partials/, macros/) - Migrate letzshop partials to marketplace module Static Files Migration: - Migrate admin JS to modules: tenancy (23 files), core (5 files), monitoring (1 file) - Migrate vendor JS to modules: tenancy (4 files), core (2 files) - Migrate shared JS: vendor-selector.js to core, media-picker.js to cms - Migrate storefront JS: storefront-layout.js to core - Keep framework JS in static/ (api-client, utils, money, icons, log-config, lib/) - Update all template references to use module_static paths Naming Consistency: - Rename static/platform/ to static/public/ - Rename app/templates/platform/ to app/templates/public/ - Update all extends and static references Documentation: - Update module-system.md with shared templates documentation - Update frontend-structure.md with new module JS organization Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -19,9 +19,9 @@ from sqlalchemy import and_, func
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from app.exceptions import ValidationException
|
||||
from app.exceptions.invoice import (
|
||||
InvoiceNotFoundException,
|
||||
from app.modules.orders.exceptions import (
|
||||
InvoiceSettingsNotFoundException,
|
||||
InvoiceNotFoundException,
|
||||
OrderNotFoundException,
|
||||
)
|
||||
from app.modules.orders.models.invoice import (
|
||||
|
||||
@@ -13,12 +13,12 @@ All operations are logged to the inventory_transactions table for audit trail.
|
||||
import logging
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from app.exceptions import (
|
||||
from app.exceptions import ValidationException
|
||||
from app.modules.inventory.exceptions import (
|
||||
InsufficientInventoryException,
|
||||
InventoryNotFoundException,
|
||||
OrderNotFoundException,
|
||||
ValidationException,
|
||||
)
|
||||
from app.modules.orders.exceptions import OrderNotFoundException
|
||||
from app.modules.inventory.models.inventory import Inventory
|
||||
from app.modules.inventory.models.inventory_transaction import (
|
||||
InventoryTransaction,
|
||||
|
||||
@@ -15,12 +15,12 @@ from datetime import UTC, datetime
|
||||
from sqlalchemy import and_, func, or_
|
||||
from sqlalchemy.orm import Session, joinedload
|
||||
|
||||
from app.exceptions import (
|
||||
from app.modules.orders.exceptions import (
|
||||
ExceptionAlreadyResolvedException,
|
||||
InvalidProductForExceptionException,
|
||||
OrderItemExceptionNotFoundException,
|
||||
ProductNotFoundException,
|
||||
)
|
||||
from app.modules.catalog.exceptions import ProductNotFoundException
|
||||
from app.modules.orders.exceptions import OrderItemExceptionNotFoundException
|
||||
from app.modules.orders.models.order import Order, OrderItem
|
||||
from app.modules.orders.models.order_item_exception import OrderItemException
|
||||
from app.modules.catalog.models import Product
|
||||
|
||||
@@ -24,12 +24,10 @@ from typing import Any
|
||||
from sqlalchemy import and_, func, or_
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from app.exceptions import (
|
||||
CustomerNotFoundException,
|
||||
InsufficientInventoryException,
|
||||
OrderNotFoundException,
|
||||
ValidationException,
|
||||
)
|
||||
from app.exceptions import ValidationException
|
||||
from app.modules.customers.exceptions import CustomerNotFoundException
|
||||
from app.modules.inventory.exceptions import InsufficientInventoryException
|
||||
from app.modules.orders.exceptions import OrderNotFoundException
|
||||
from app.modules.customers.models.customer import Customer
|
||||
from app.modules.orders.models.order import Order, OrderItem
|
||||
from app.modules.orders.schemas.order import (
|
||||
@@ -39,7 +37,7 @@ from app.modules.orders.schemas.order import (
|
||||
OrderItemCreate,
|
||||
OrderUpdate,
|
||||
)
|
||||
from app.services.subscription_service import (
|
||||
from app.modules.billing.services.subscription_service import (
|
||||
subscription_service,
|
||||
TierLimitExceededException,
|
||||
)
|
||||
@@ -1293,7 +1291,7 @@ class OrderService:
|
||||
order_id: int,
|
||||
) -> dict[str, Any]:
|
||||
"""Get shipping label information for an order (admin only)."""
|
||||
from app.services.admin_settings_service import admin_settings_service # noqa: MOD-004
|
||||
from app.modules.core.services.admin_settings_service import admin_settings_service # noqa: MOD-004
|
||||
|
||||
order = db.query(Order).filter(Order.id == order_id).first()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user