feat: add multilingual support to vendor onboarding workflow
- Add language selector with English, French, and German translations - Fix API key help text to reference Letzshop Support team - Update shop slug input with URL prefix and clearer example - Fix step validation bug by adding db.commit() to all POST endpoints - Translate all form labels, buttons, and messages 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
20
app/api/v1/vendor/onboarding.py
vendored
20
app/api/v1/vendor/onboarding.py
vendored
@@ -92,7 +92,7 @@ def save_company_profile(
|
||||
Updates vendor and company records with provided data.
|
||||
"""
|
||||
service = OnboardingService(db)
|
||||
return service.complete_company_profile(
|
||||
result = service.complete_company_profile(
|
||||
vendor_id=current_user.token_vendor_id,
|
||||
company_name=request.company_name,
|
||||
brand_name=request.brand_name,
|
||||
@@ -105,6 +105,8 @@ def save_company_profile(
|
||||
default_language=request.default_language,
|
||||
dashboard_language=request.dashboard_language,
|
||||
)
|
||||
db.commit() # Commit at API level for transaction control
|
||||
return result
|
||||
|
||||
|
||||
# =============================================================================
|
||||
@@ -142,12 +144,14 @@ def save_letzshop_api(
|
||||
Tests connection first, only saves if successful.
|
||||
"""
|
||||
service = OnboardingService(db)
|
||||
return service.complete_letzshop_api(
|
||||
result = service.complete_letzshop_api(
|
||||
vendor_id=current_user.token_vendor_id,
|
||||
api_key=request.api_key,
|
||||
shop_slug=request.shop_slug,
|
||||
letzshop_vendor_id=request.vendor_id,
|
||||
)
|
||||
db.commit() # Commit at API level for transaction control
|
||||
return result
|
||||
|
||||
|
||||
# =============================================================================
|
||||
@@ -181,7 +185,7 @@ def save_product_import_config(
|
||||
At least one CSV URL must be provided.
|
||||
"""
|
||||
service = OnboardingService(db)
|
||||
return service.complete_product_import(
|
||||
result = service.complete_product_import(
|
||||
vendor_id=current_user.token_vendor_id,
|
||||
csv_url_fr=request.csv_url_fr,
|
||||
csv_url_en=request.csv_url_en,
|
||||
@@ -190,6 +194,8 @@ def save_product_import_config(
|
||||
delivery_method=request.delivery_method,
|
||||
preorder_days=request.preorder_days,
|
||||
)
|
||||
db.commit() # Commit at API level for transaction control
|
||||
return result
|
||||
|
||||
|
||||
# =============================================================================
|
||||
@@ -209,12 +215,14 @@ def trigger_order_sync(
|
||||
Creates a background job that imports orders from Letzshop.
|
||||
"""
|
||||
service = OnboardingService(db)
|
||||
return service.trigger_order_sync(
|
||||
result = service.trigger_order_sync(
|
||||
vendor_id=current_user.token_vendor_id,
|
||||
user_id=current_user.id,
|
||||
days_back=request.days_back,
|
||||
include_products=request.include_products,
|
||||
)
|
||||
db.commit() # Commit at API level for transaction control
|
||||
return result
|
||||
|
||||
|
||||
@router.get(
|
||||
@@ -251,7 +259,9 @@ def complete_order_sync(
|
||||
This also marks the entire onboarding as complete.
|
||||
"""
|
||||
service = OnboardingService(db)
|
||||
return service.complete_order_sync(
|
||||
result = service.complete_order_sync(
|
||||
vendor_id=current_user.token_vendor_id,
|
||||
job_id=request.job_id,
|
||||
)
|
||||
db.commit() # Commit at API level for transaction control
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user