Compare commits
2 Commits
44acf5e442
...
395707951e
| Author | SHA1 | Date | |
|---|---|---|---|
| 395707951e | |||
| 34bf961309 |
@@ -497,7 +497,7 @@ class ModuleDefinition:
|
|||||||
#
|
#
|
||||||
# Example:
|
# Example:
|
||||||
# def _get_onboarding_provider():
|
# def _get_onboarding_provider():
|
||||||
# from app.modules.marketplace.services.marketplace_onboarding import (
|
# from app.modules.marketplace.services.marketplace_onboarding_service import (
|
||||||
# marketplace_onboarding_provider,
|
# marketplace_onboarding_provider,
|
||||||
# )
|
# )
|
||||||
# return marketplace_onboarding_provider
|
# return marketplace_onboarding_provider
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ class AdminSubscriptionService:
|
|||||||
try:
|
try:
|
||||||
platform = platform_service.get_platform_by_id(db, tier.platform_id)
|
platform = platform_service.get_platform_by_id(db, tier.platform_id)
|
||||||
platform_name = platform.name
|
platform_name = platform.name
|
||||||
except Exception:
|
except Exception: # noqa: EXC-003
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# --- Product ---
|
# --- Product ---
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ Usage:
|
|||||||
|
|
||||||
# 2. Register in module definition
|
# 2. Register in module definition
|
||||||
def _get_onboarding_provider():
|
def _get_onboarding_provider():
|
||||||
from app.modules.marketplace.services.marketplace_onboarding import (
|
from app.modules.marketplace.services.marketplace_onboarding_service import (
|
||||||
marketplace_onboarding_provider,
|
marketplace_onboarding_provider,
|
||||||
)
|
)
|
||||||
return marketplace_onboarding_provider
|
return marketplace_onboarding_provider
|
||||||
|
|||||||
@@ -26,6 +26,9 @@ function onboardingBanner() {
|
|||||||
progressPercentage: 0,
|
progressPercentage: 0,
|
||||||
|
|
||||||
async init() {
|
async init() {
|
||||||
|
if (window._onboardingBannerInitialized) return;
|
||||||
|
window._onboardingBannerInitialized = true;
|
||||||
|
|
||||||
// Check session-scoped dismiss
|
// Check session-scoped dismiss
|
||||||
if (sessionStorage.getItem('onboarding_dismissed')) {
|
if (sessionStorage.getItem('onboarding_dismissed')) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -38,6 +38,9 @@ function storeCustomerDetail() {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async init() {
|
async init() {
|
||||||
|
if (window._customerDetailInitialized) return;
|
||||||
|
window._customerDetailInitialized = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Load i18n translations
|
// Load i18n translations
|
||||||
await I18n.loadModule('customers');
|
await I18n.loadModule('customers');
|
||||||
|
|||||||
@@ -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", "orders"], # Depends on catalog module for Product model and orders module
|
requires=["catalog"], # Depends on catalog module for Product model
|
||||||
# Module-driven permissions
|
# Module-driven permissions
|
||||||
permissions=[
|
permissions=[
|
||||||
PermissionDefinition(
|
PermissionDefinition(
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ from sqlalchemy.orm import Session
|
|||||||
from app.modules.catalog.exceptions import ProductNotFoundException
|
from app.modules.catalog.exceptions import ProductNotFoundException
|
||||||
from app.modules.inventory.models.inventory import Inventory
|
from app.modules.inventory.models.inventory import Inventory
|
||||||
from app.modules.inventory.models.inventory_transaction import InventoryTransaction
|
from app.modules.inventory.models.inventory_transaction import InventoryTransaction
|
||||||
from app.modules.orders.exceptions import OrderNotFoundException
|
from app.modules.orders.exceptions import OrderNotFoundException # IMPORT-002
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -230,7 +230,9 @@ class InventoryTransactionService:
|
|||||||
OrderNotFoundException: If order not found or doesn't belong to store
|
OrderNotFoundException: If order not found or doesn't belong to store
|
||||||
"""
|
"""
|
||||||
# Verify order belongs to store
|
# Verify order belongs to store
|
||||||
from app.modules.orders.services.order_service import order_service
|
from app.modules.orders.services.order_service import ( # IMPORT-002
|
||||||
|
order_service,
|
||||||
|
)
|
||||||
|
|
||||||
order = order_service.get_order_by_id(db, order_id, store_id=store_id)
|
order = order_service.get_order_by_id(db, order_id, store_id=store_id)
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ def _get_feature_provider():
|
|||||||
|
|
||||||
def _get_onboarding_provider():
|
def _get_onboarding_provider():
|
||||||
"""Lazy import of onboarding provider to avoid circular imports."""
|
"""Lazy import of onboarding provider to avoid circular imports."""
|
||||||
from app.modules.marketplace.services.marketplace_onboarding import (
|
from app.modules.marketplace.services.marketplace_onboarding_service import (
|
||||||
marketplace_onboarding_provider,
|
marketplace_onboarding_provider,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ __all__ = [
|
|||||||
# Onboarding exceptions
|
# Onboarding exceptions
|
||||||
"OnboardingNotFoundException",
|
"OnboardingNotFoundException",
|
||||||
"OnboardingStepOrderException",
|
"OnboardingStepOrderException",
|
||||||
"OnboardingAlreadyCompletedException",
|
|
||||||
"OnboardingCsvUrlRequiredException",
|
"OnboardingCsvUrlRequiredException",
|
||||||
"OnboardingSyncJobNotFoundException",
|
"OnboardingSyncJobNotFoundException",
|
||||||
"OnboardingSyncNotCompleteException",
|
"OnboardingSyncNotCompleteException",
|
||||||
@@ -551,17 +550,6 @@ class OnboardingStepOrderException(ValidationException):
|
|||||||
self.error_code = "ONBOARDING_STEP_ORDER_ERROR"
|
self.error_code = "ONBOARDING_STEP_ORDER_ERROR"
|
||||||
|
|
||||||
|
|
||||||
class OnboardingAlreadyCompletedException(BusinessLogicException):
|
|
||||||
"""Raised when trying to modify a completed onboarding."""
|
|
||||||
|
|
||||||
def __init__(self, store_id: int):
|
|
||||||
super().__init__(
|
|
||||||
message="Onboarding has already been completed",
|
|
||||||
error_code="ONBOARDING_ALREADY_COMPLETED",
|
|
||||||
details={"store_id": store_id},
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class OnboardingCsvUrlRequiredException(ValidationException):
|
class OnboardingCsvUrlRequiredException(ValidationException):
|
||||||
"""Raised when no CSV URL is provided in product import step."""
|
"""Raised when no CSV URL is provided in product import step."""
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# app/modules/marketplace/services/marketplace_onboarding.py
|
# app/modules/marketplace/services/marketplace_onboarding_service.py
|
||||||
"""
|
"""
|
||||||
Onboarding provider for the marketplace module.
|
Onboarding provider for the marketplace module.
|
||||||
|
|
||||||
@@ -5,7 +5,7 @@ import uuid
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from app.modules.marketplace.services.marketplace_onboarding import (
|
from app.modules.marketplace.services.marketplace_onboarding_service import (
|
||||||
MarketplaceOnboardingProvider,
|
MarketplaceOnboardingProvider,
|
||||||
)
|
)
|
||||||
from app.modules.tenancy.models import Merchant, Store, User
|
from app.modules.tenancy.models import Merchant, Store, User
|
||||||
@@ -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", "marketplace"], # Depends on payments, catalog, inventory, and marketplace modules
|
requires=["payments", "catalog", "inventory"], # Depends on payments, catalog, and inventory modules (marketplace imported lazily)
|
||||||
# Module-driven permissions
|
# Module-driven permissions
|
||||||
permissions=[
|
permissions=[
|
||||||
PermissionDefinition(
|
PermissionDefinition(
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ class OrderService:
|
|||||||
Get or create the store's placeholder product for unmatched items.
|
Get or create the store's placeholder product for unmatched items.
|
||||||
"""
|
"""
|
||||||
from app.modules.catalog.models import Product
|
from app.modules.catalog.models import Product
|
||||||
from app.modules.marketplace.models import (
|
from app.modules.marketplace.models import ( # IMPORT-002
|
||||||
MarketplaceProduct,
|
MarketplaceProduct,
|
||||||
MarketplaceProductTranslation,
|
MarketplaceProductTranslation,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ async def list_transactions():
|
|||||||
return {"transactions": [], "total": 0}
|
return {"transactions": [], "total": 0}
|
||||||
|
|
||||||
|
|
||||||
@router.post("/refunds/{transaction_id}") # noqa: API001
|
@router.post("/refunds/{transaction_id}") # noqa: API-004, API001
|
||||||
async def issue_refund(transaction_id: str, amount: float | None = None):
|
async def issue_refund(transaction_id: str, amount: float | None = None):
|
||||||
"""Issue a refund for a transaction."""
|
"""Issue a refund for a transaction."""
|
||||||
# TODO: Implement refund logic
|
# TODO: Implement refund logic
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ def _get_feature_provider():
|
|||||||
|
|
||||||
def _get_onboarding_provider():
|
def _get_onboarding_provider():
|
||||||
"""Lazy import of onboarding provider to avoid circular imports."""
|
"""Lazy import of onboarding provider to avoid circular imports."""
|
||||||
from app.modules.tenancy.services.tenancy_onboarding import (
|
from app.modules.tenancy.services.tenancy_onboarding_service import (
|
||||||
tenancy_onboarding_provider,
|
tenancy_onboarding_provider,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ def create_account_router(auth_dependency: Callable) -> APIRouter:
|
|||||||
"""Get the logged-in user's account info."""
|
"""Get the logged-in user's account info."""
|
||||||
return user_account_service.get_account(db, current_user.id)
|
return user_account_service.get_account(db, current_user.id)
|
||||||
|
|
||||||
@router.put("", response_model=UserAccountResponse)
|
@router.put("", response_model=UserAccountResponse) # noqa: API-004
|
||||||
async def update_my_account(
|
async def update_my_account(
|
||||||
update_data: UserAccountUpdate,
|
update_data: UserAccountUpdate,
|
||||||
current_user: UserContext = Depends(auth_dependency),
|
current_user: UserContext = Depends(auth_dependency),
|
||||||
@@ -50,7 +50,7 @@ def create_account_router(auth_dependency: Callable) -> APIRouter:
|
|||||||
db.commit()
|
db.commit()
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@router.put("/password", response_model=PasswordChangeResponse)
|
@router.put("/password", response_model=PasswordChangeResponse) # noqa: API-004
|
||||||
async def change_my_password(
|
async def change_my_password(
|
||||||
password_data: UserPasswordChange,
|
password_data: UserPasswordChange,
|
||||||
current_user: UserContext = Depends(auth_dependency),
|
current_user: UserContext = Depends(auth_dependency),
|
||||||
|
|||||||
@@ -319,6 +319,8 @@ class MerchantStoreDetailResponse(BaseModel):
|
|||||||
created_at: str | None = None
|
created_at: str | None = None
|
||||||
platforms: list[dict] = Field(default_factory=list)
|
platforms: list[dict] = Field(default_factory=list)
|
||||||
|
|
||||||
|
model_config = {"from_attributes": True}
|
||||||
|
|
||||||
|
|
||||||
class MerchantStoreUpdate(BaseModel):
|
class MerchantStoreUpdate(BaseModel):
|
||||||
"""Store update from the merchant portal.
|
"""Store update from the merchant portal.
|
||||||
|
|||||||
@@ -283,7 +283,7 @@ class MerchantStoreService:
|
|||||||
feature_code="stores_limit",
|
feature_code="stores_limit",
|
||||||
merchant_id=merchant_id,
|
merchant_id=merchant_id,
|
||||||
)
|
)
|
||||||
except Exception:
|
except Exception: # noqa: EXC-003
|
||||||
# If billing module not available, allow creation
|
# If billing module not available, allow creation
|
||||||
return True, None
|
return True, None
|
||||||
|
|
||||||
@@ -306,7 +306,7 @@ class MerchantStoreService:
|
|||||||
platform_ids = subscription_service.get_active_subscription_platform_ids(
|
platform_ids = subscription_service.get_active_subscription_platform_ids(
|
||||||
db, merchant_id
|
db, merchant_id
|
||||||
)
|
)
|
||||||
except Exception:
|
except Exception: # noqa: EXC-003
|
||||||
platform_ids = []
|
platform_ids = []
|
||||||
|
|
||||||
platforms = []
|
platforms = []
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# app/modules/tenancy/services/tenancy_onboarding.py
|
# app/modules/tenancy/services/tenancy_onboarding_service.py
|
||||||
"""
|
"""
|
||||||
Onboarding provider for the tenancy module.
|
Onboarding provider for the tenancy module.
|
||||||
|
|
||||||
@@ -6,7 +6,9 @@ import uuid
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from app.modules.tenancy.models import Merchant, Store, User
|
from app.modules.tenancy.models import Merchant, Store, User
|
||||||
from app.modules.tenancy.services.tenancy_onboarding import TenancyOnboardingProvider
|
from app.modules.tenancy.services.tenancy_onboarding_service import (
|
||||||
|
TenancyOnboardingProvider,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
// static/shared/js/dev-toolbar.js
|
// static/shared/js/dev-toolbar.js
|
||||||
// noqa: SEC015 - dev-only toolbar, innerHTML used with trusted/constructed content only
|
// noqa: SEC015 - dev-only toolbar, innerHTML used with trusted/constructed content only
|
||||||
|
// noqa: JS-001 - console references are intentional: this file intercepts and wraps console methods
|
||||||
|
// noqa: JS-005 - init guard not needed: runs inside DOMContentLoaded IIFE
|
||||||
/**
|
/**
|
||||||
* Dev-Mode Debug Toolbar
|
* Dev-Mode Debug Toolbar
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user