refactor: complete module-driven architecture migration

This commit completes the migration to a fully module-driven architecture:

## Models Migration
- Moved all domain models from models/database/ to their respective modules:
  - tenancy: User, Admin, Vendor, Company, Platform, VendorDomain, etc.
  - cms: MediaFile, VendorTheme
  - messaging: Email, VendorEmailSettings, VendorEmailTemplate
  - core: AdminMenuConfig
- models/database/ now only contains Base and TimestampMixin (infrastructure)

## Schemas Migration
- Moved all domain schemas from models/schema/ to their respective modules:
  - tenancy: company, vendor, admin, team, vendor_domain
  - cms: media, image, vendor_theme
  - messaging: email
- models/schema/ now only contains base.py and auth.py (infrastructure)

## Routes Migration
- Moved admin routes from app/api/v1/admin/ to modules:
  - menu_config.py -> core module
  - modules.py -> tenancy module
  - module_config.py -> tenancy module
- app/api/v1/admin/ now only aggregates auto-discovered module routes

## Menu System
- Implemented module-driven menu system with MenuDiscoveryService
- Extended FrontendType enum: PLATFORM, ADMIN, VENDOR, STOREFRONT
- Added MenuItemDefinition and MenuSectionDefinition dataclasses
- Each module now defines its own menu items in definition.py
- MenuService integrates with MenuDiscoveryService for template rendering

## Documentation
- Updated docs/architecture/models-structure.md
- Updated docs/architecture/menu-management.md
- Updated architecture validation rules for new exceptions

## Architecture Validation
- Updated MOD-019 rule to allow base.py in models/schema/
- Created core module exceptions.py and schemas/ directory
- All validation errors resolved (only warnings remain)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-01 21:02:56 +01:00
parent 09d7d282c6
commit d7a0ff8818
307 changed files with 5536 additions and 3826 deletions

View File

@@ -1,42 +1,20 @@
{
"title": "Kasse",
"description": "Bestellabwicklung und Zahlungsabwicklung",
"session": {
"title": "Checkout-Sitzung",
"expired": "Sitzung abgelaufen",
"invalid": "Ungültige Sitzung"
},
"shipping": {
"title": "Lieferadresse",
"select_address": "Adresse auswählen",
"add_new": "Neue Adresse hinzufügen",
"method": "Versandart",
"select_method": "Versandart auswählen",
"not_available": "Für diese Adresse nicht verfügbar"
},
"payment": {
"title": "Zahlung",
"method": "Zahlungsmethode",
"required": "Zahlung erforderlich",
"failed": "Zahlung fehlgeschlagen"
},
"order": {
"summary": "Bestellübersicht",
"subtotal": "Zwischensumme",
"shipping": "Versand",
"tax": "MwSt.",
"total": "Gesamtsumme",
"place_order": "Bestellung aufgeben"
},
"validation": {
"empty_cart": "Warenkorb ist leer",
"invalid_address": "Ungültige Lieferadresse",
"insufficient_inventory": "Unzureichender Bestand"
},
"messages": {
"storefront": {
"welcome": "Willkommen in unserem Shop",
"browse_products": "Produkte durchstöbern",
"add_to_cart": "In den Warenkorb",
"buy_now": "Jetzt kaufen",
"view_cart": "Warenkorb ansehen",
"checkout": "Zur Kasse",
"continue_shopping": "Weiter einkaufen",
"start_shopping": "Einkaufen starten",
"empty_cart": "Ihr Warenkorb ist leer",
"cart_total": "Warenkorbsumme",
"proceed_checkout": "Zur Kasse gehen",
"payment": "Zahlung",
"place_order": "Bestellung aufgeben",
"order_placed": "Bestellung erfolgreich aufgegeben",
"checkout_failed": "Checkout fehlgeschlagen",
"session_expired": "Ihre Sitzung ist abgelaufen",
"inventory_error": "Einige Artikel sind nicht mehr verfügbar"
"thank_you": "Vielen Dank für Ihre Bestellung",
"order_confirmation": "Bestellbestätigung"
}
}

View File

@@ -1,42 +1,20 @@
{
"title": "Checkout",
"description": "Order checkout and payment processing",
"session": {
"title": "Checkout Session",
"expired": "Session expired",
"invalid": "Invalid session"
},
"shipping": {
"title": "Shipping Address",
"select_address": "Select Address",
"add_new": "Add New Address",
"method": "Shipping Method",
"select_method": "Select Shipping Method",
"not_available": "Not available for this address"
},
"payment": {
"title": "Payment",
"method": "Payment Method",
"required": "Payment required",
"failed": "Payment failed"
},
"order": {
"summary": "Order Summary",
"subtotal": "Subtotal",
"shipping": "Shipping",
"tax": "Tax",
"total": "Total",
"place_order": "Place Order"
},
"validation": {
"empty_cart": "Cart is empty",
"invalid_address": "Invalid shipping address",
"insufficient_inventory": "Insufficient inventory"
},
"messages": {
"order_placed": "Order placed successfully",
"checkout_failed": "Checkout failed",
"session_expired": "Your session has expired",
"inventory_error": "Some items are no longer available"
"storefront": {
"welcome": "Welcome to our store",
"browse_products": "Browse Products",
"add_to_cart": "Add to Cart",
"buy_now": "Buy Now",
"view_cart": "View Cart",
"checkout": "Checkout",
"continue_shopping": "Continue Shopping",
"start_shopping": "Start Shopping",
"empty_cart": "Your cart is empty",
"cart_total": "Cart Total",
"proceed_checkout": "Proceed to Checkout",
"payment": "Payment",
"place_order": "Place Order",
"order_placed": "Order Placed Successfully",
"thank_you": "Thank you for your order",
"order_confirmation": "Order Confirmation"
}
}

View File

@@ -1,42 +1,20 @@
{
"title": "Caisse",
"description": "Traitement des commandes et des paiements",
"session": {
"title": "Session de paiement",
"expired": "Session expirée",
"invalid": "Session invalide"
},
"shipping": {
"title": "Adresse de livraison",
"select_address": "Sélectionner une adresse",
"add_new": "Ajouter une nouvelle adresse",
"method": "Mode de livraison",
"select_method": "Sélectionner un mode de livraison",
"not_available": "Non disponible pour cette adresse"
},
"payment": {
"title": "Paiement",
"method": "Mode de paiement",
"required": "Paiement requis",
"failed": "Paiement échoué"
},
"order": {
"summary": "Récapitulatif de commande",
"subtotal": "Sous-total",
"shipping": "Livraison",
"tax": "TVA",
"total": "Total",
"place_order": "Passer la commande"
},
"validation": {
"empty_cart": "Le panier est vide",
"invalid_address": "Adresse de livraison invalide",
"insufficient_inventory": "Stock insuffisant"
},
"messages": {
"storefront": {
"welcome": "Bienvenue dans notre boutique",
"browse_products": "Parcourir les produits",
"add_to_cart": "Ajouter au panier",
"buy_now": "Acheter maintenant",
"view_cart": "Voir le panier",
"checkout": "Paiement",
"continue_shopping": "Continuer vos achats",
"start_shopping": "Commencer vos achats",
"empty_cart": "Votre panier est vide",
"cart_total": "Total du panier",
"proceed_checkout": "Passer à la caisse",
"payment": "Paiement",
"place_order": "Passer la commande",
"order_placed": "Commande passée avec succès",
"checkout_failed": "Échec du paiement",
"session_expired": "Votre session a expiré",
"inventory_error": "Certains articles ne sont plus disponibles"
"thank_you": "Merci pour votre commande",
"order_confirmation": "Confirmation de commande"
}
}

View File

@@ -1,42 +1,20 @@
{
"title": "Keess",
"description": "Bestellungsofwécklung a Bezuelung",
"session": {
"title": "Checkout-Sëtzung",
"expired": "Sëtzung ofgelaf",
"invalid": "Ongëlteg Sëtzung"
},
"shipping": {
"title": "Liwweradress",
"select_address": "Adress auswielen",
"add_new": "Nei Adress derbäisetzen",
"method": "Liwwermethod",
"select_method": "Liwwermethod auswielen",
"not_available": "Net verfügbar fir dës Adress"
},
"payment": {
"title": "Bezuelung",
"method": "Bezuelungsmethod",
"required": "Bezuelung erfuerderlech",
"failed": "Bezuelung feelgeschloen"
},
"order": {
"summary": "Bestelliwwersiicht",
"subtotal": "Zwëschesumm",
"shipping": "Liwwerung",
"tax": "MwSt.",
"total": "Gesamtsumm",
"place_order": "Bestellung opginn"
},
"validation": {
"empty_cart": "Kuerf ass eidel",
"invalid_address": "Ongëlteg Liwweradress",
"insufficient_inventory": "Net genuch Bestand"
},
"messages": {
"storefront": {
"welcome": "Wëllkomm an eisem Buttek",
"browse_products": "Produkter duerchsichen",
"add_to_cart": "An de Kuerf",
"buy_now": "Elo kafen",
"view_cart": "Kuerf kucken",
"checkout": "Bezuelen",
"continue_shopping": "Weider akafen",
"start_shopping": "Ufänken mat Akafen",
"empty_cart": "Äre Kuerf ass eidel",
"cart_total": "Kuerf Total",
"proceed_checkout": "Zur Bezuelung goen",
"payment": "Bezuelung",
"place_order": "Bestellung opgi",
"order_placed": "Bestellung erfollegräich opginn",
"checkout_failed": "Checkout feelgeschloen",
"session_expired": "Är Sëtzung ass ofgelaf",
"inventory_error": "E puer Artikelen sinn net méi verfügbar"
"thank_you": "Merci fir Är Bestellung",
"order_confirmation": "Bestellungsbestätegung"
}
}

View File

@@ -30,7 +30,7 @@ from app.modules.customers.schemas import CustomerContext
from app.modules.orders.services import order_service
from app.modules.messaging.services.email_service import EmailService # noqa: MOD-004 - Core email service
from middleware.vendor_context import require_vendor_context
from models.database.vendor import Vendor
from app.modules.tenancy.models import Vendor
from app.modules.orders.schemas import OrderCreate, OrderResponse
router = APIRouter()