diff --git a/app/api/v1/vendor/onboarding.py b/app/api/v1/vendor/onboarding.py
index 81c18a71..583566e2 100644
--- a/app/api/v1/vendor/onboarding.py
+++ b/app/api/v1/vendor/onboarding.py
@@ -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
diff --git a/app/templates/vendor/onboarding.html b/app/templates/vendor/onboarding.html
index 7cb94b21..8153a15d 100644
--- a/app/templates/vendor/onboarding.html
+++ b/app/templates/vendor/onboarding.html
@@ -23,8 +23,33 @@
Wizamart
-
- of 4 steps completed
+
+
+
+
+
+
+
+
+
+
+
+
+ / 4
+
@@ -74,15 +99,14 @@
-
Loading your setup...
+
-
@@ -92,77 +116,75 @@
-
Company Profile
-
- Let's set up your company information. This will be used for invoices and customer communication.
-
+
+
-
+
-
+
-
-
-
+
-
+
-
+
-
-
+
-
+
-
+
-
+
@@ -172,53 +194,52 @@
-
Letzshop API Configuration
-
- Connect your Letzshop marketplace account to sync orders automatically.
-
+
+
-
-
+
- Get your API key from Letzshop Vendor Portal > Settings > API Access
+ (support@letzshop.lu)