fix(arch): resolve all 14 architecture validation warnings
Some checks failed
Some checks failed
- Add missing module dependency declarations (IMPORT-002): analytics requires catalog/inventory/marketplace/orders, orders requires marketplace, inventory requires orders - Replace broad except Exception with specific types (EXC-003): StoreNotFoundException in auth_service, PlatformNotFoundException in admin_subscription_service, SQLAlchemyError in customer_service - Use number_stepper macro in loyalty program-edit template (FE-008) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -101,6 +101,7 @@ analytics_module = ModuleDefinition(
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
requires=["catalog", "inventory", "marketplace", "orders"], # Imports from these modules
|
||||||
is_core=False,
|
is_core=False,
|
||||||
# =========================================================================
|
# =========================================================================
|
||||||
# Self-Contained Module Configuration
|
# Self-Contained Module Configuration
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ from app.modules.billing.models import (
|
|||||||
SubscriptionStatus,
|
SubscriptionStatus,
|
||||||
SubscriptionTier,
|
SubscriptionTier,
|
||||||
)
|
)
|
||||||
|
from app.modules.tenancy.exceptions import PlatformNotFoundException
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -316,7 +317,7 @@ class AdminSubscriptionService:
|
|||||||
try:
|
try:
|
||||||
p = platform_service.get_platform_by_id(db, platform_id)
|
p = platform_service.get_platform_by_id(db, platform_id)
|
||||||
return p.name
|
return p.name
|
||||||
except Exception:
|
except PlatformNotFoundException:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# =========================================================================
|
# =========================================================================
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ from sqlalchemy.orm import Session
|
|||||||
from app.modules.tenancy.exceptions import (
|
from app.modules.tenancy.exceptions import (
|
||||||
EmailNotVerifiedException,
|
EmailNotVerifiedException,
|
||||||
InvalidCredentialsException,
|
InvalidCredentialsException,
|
||||||
|
StoreNotFoundException,
|
||||||
UserNotActiveException,
|
UserNotActiveException,
|
||||||
)
|
)
|
||||||
from app.modules.tenancy.schemas.auth import UserLogin
|
from app.modules.tenancy.schemas.auth import UserLogin
|
||||||
@@ -103,7 +104,7 @@ class AuthService:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
return store_service.get_active_store_by_code(db, store_code)
|
return store_service.get_active_store_by_code(db, store_code)
|
||||||
except Exception:
|
except StoreNotFoundException:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def get_user_store_role(
|
def get_user_store_role(
|
||||||
|
|||||||
@@ -614,7 +614,7 @@ class CustomerService:
|
|||||||
store = store_service.get_store_by_id_optional(db, store_id)
|
store = store_service.get_store_by_id_optional(db, store_id)
|
||||||
if store:
|
if store:
|
||||||
store_code = store.store_code
|
store_code = store.store_code
|
||||||
except Exception:
|
except SQLAlchemyError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
cust_number = self._generate_customer_number(db, store_id, store_code)
|
cust_number = self._generate_customer_number(db, store_id, store_code)
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ inventory_module = ModuleDefinition(
|
|||||||
"transaction history, and bulk imports."
|
"transaction history, and bulk imports."
|
||||||
),
|
),
|
||||||
version="1.0.0",
|
version="1.0.0",
|
||||||
requires=["catalog"], # Depends on catalog module for Product model
|
requires=["catalog", "orders"], # Depends on catalog module for Product model and orders module
|
||||||
# Module-driven permissions
|
# Module-driven permissions
|
||||||
permissions=[
|
permissions=[
|
||||||
PermissionDefinition(
|
PermissionDefinition(
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
{% from 'shared/macros/headers.html' import detail_page_header %}
|
{% from 'shared/macros/headers.html' import detail_page_header %}
|
||||||
{% from 'shared/macros/alerts.html' import loading_state, error_state %}
|
{% from 'shared/macros/alerts.html' import loading_state, error_state %}
|
||||||
{% from 'shared/macros/modals.html' import confirm_modal %}
|
{% from 'shared/macros/modals.html' import confirm_modal %}
|
||||||
|
{% from 'shared/macros/inputs.html' import number_stepper %}
|
||||||
|
|
||||||
{% block title %}Program Configuration{% endblock %}
|
{% block title %}Program Configuration{% endblock %}
|
||||||
|
|
||||||
@@ -61,8 +62,7 @@
|
|||||||
<div class="grid gap-6 md:grid-cols-2">
|
<div class="grid gap-6 md:grid-cols-2">
|
||||||
<div>
|
<div>
|
||||||
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">Points per EUR spent</label>
|
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">Points per EUR spent</label>
|
||||||
<input type="number" min="1" max="100" x-model.number="settings.points_per_euro"
|
{{ number_stepper(model='settings.points_per_euro', min=1, max=100, label='Points per EUR spent') }}
|
||||||
class="w-full px-4 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg focus:border-purple-400 focus:outline-none dark:bg-gray-700 dark:text-gray-300">
|
|
||||||
<p class="mt-1 text-xs text-gray-500">1 EUR = <span x-text="settings.points_per_euro || 1"></span> point(s)</p>
|
<p class="mt-1 text-xs text-gray-500">1 EUR = <span x-text="settings.points_per_euro || 1"></span> point(s)</p>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ orders_module = ModuleDefinition(
|
|||||||
"invoicing, and bulk order operations. Uses the payments module for checkout."
|
"invoicing, and bulk order operations. Uses the payments module for checkout."
|
||||||
),
|
),
|
||||||
version="1.0.0",
|
version="1.0.0",
|
||||||
requires=["payments", "catalog", "inventory"], # Depends on payments, catalog, and inventory modules
|
requires=["payments", "catalog", "inventory", "marketplace"], # Depends on payments, catalog, inventory, and marketplace modules
|
||||||
# Module-driven permissions
|
# Module-driven permissions
|
||||||
permissions=[
|
permissions=[
|
||||||
PermissionDefinition(
|
PermissionDefinition(
|
||||||
|
|||||||
Reference in New Issue
Block a user