diff --git a/app/services/onboarding_service.py b/app/services/onboarding_service.py index fd9c6e4f..083d4c69 100644 --- a/app/services/onboarding_service.py +++ b/app/services/onboarding_service.py @@ -541,28 +541,31 @@ class OnboardingService: elif job.status == "failed": progress = 0 elif job.status == "processing": - if job.total_shipments and job.total_shipments > 0: - progress = int((job.processed_shipments or 0) / job.total_shipments * 100) + # Use orders_processed and shipments_fetched for progress + total = job.shipments_fetched or 0 + processed = job.orders_processed or 0 + if total > 0: + progress = int(processed / total * 100) else: progress = 50 # Indeterminate + elif job.status == "fetching": + # Show partial progress during fetch phase + if job.total_pages and job.total_pages > 0: + progress = int((job.current_page or 0) / job.total_pages * 50) + else: + progress = 25 # Indeterminate # Determine current phase - current_phase = None - if job.status == "fetching": - current_phase = "fetching" - elif job.status == "processing": - current_phase = "orders" - elif job.status == "completed": - current_phase = "complete" + current_phase = job.current_phase or job.status return { "job_id": job.id, "status": job.status, "progress_percentage": progress, "current_phase": current_phase, - "orders_imported": job.processed_shipments or 0, - "orders_total": job.total_shipments, - "products_imported": 0, # TODO: Track this + "orders_imported": job.orders_imported or 0, + "orders_total": job.shipments_fetched, + "products_imported": job.products_matched or 0, "started_at": job.started_at, "completed_at": job.completed_at, "estimated_remaining_seconds": None, # TODO: Calculate diff --git a/app/templates/vendor/onboarding.html b/app/templates/vendor/onboarding.html index 8153a15d..e866cc0c 100644 --- a/app/templates/vendor/onboarding.html +++ b/app/templates/vendor/onboarding.html @@ -23,51 +23,45 @@ Wizamart -
- -
- -
- -
-
- -
- / 4 + +
+ +
+
-
+
-