Improve the sales import

This commit is contained in:
Urtzi Alfaro
2025-10-15 21:09:42 +02:00
parent 8f9e9a7edc
commit dbb48d8e2c
21 changed files with 992 additions and 409 deletions

View File

@@ -91,7 +91,8 @@ async def publish_data_analysis(
job_id: str,
tenant_id: str,
analysis_details: Optional[str] = None,
estimated_time_remaining_seconds: Optional[int] = None
estimated_time_remaining_seconds: Optional[int] = None,
estimated_completion_time: Optional[str] = None
) -> bool:
"""
Event 2: Data Analysis (20% progress)
@@ -101,6 +102,7 @@ async def publish_data_analysis(
tenant_id: Tenant identifier
analysis_details: Details about the analysis
estimated_time_remaining_seconds: Estimated time remaining in seconds
estimated_completion_time: ISO timestamp of estimated completion
"""
event_data = {
"service_name": "training-service",
@@ -112,7 +114,8 @@ async def publish_data_analysis(
"progress": 20,
"current_step": "Data Analysis",
"step_details": analysis_details or "Analyzing sales, weather, and traffic data",
"estimated_time_remaining_seconds": estimated_time_remaining_seconds
"estimated_time_remaining_seconds": estimated_time_remaining_seconds,
"estimated_completion_time": estimated_completion_time
}
}
@@ -138,7 +141,8 @@ async def publish_product_training_completed(
product_name: str,
products_completed: int,
total_products: int,
estimated_time_remaining_seconds: Optional[int] = None
estimated_time_remaining_seconds: Optional[int] = None,
estimated_completion_time: Optional[str] = None
) -> bool:
"""
Event 3: Product Training Completed (contributes to 20-80% progress)
@@ -154,6 +158,7 @@ async def publish_product_training_completed(
products_completed: Number of products completed so far
total_products: Total number of products
estimated_time_remaining_seconds: Estimated time remaining in seconds
estimated_completion_time: ISO timestamp of estimated completion
"""
event_data = {
"service_name": "training-service",
@@ -167,7 +172,8 @@ async def publish_product_training_completed(
"total_products": total_products,
"current_step": "Model Training",
"step_details": f"Completed training for {product_name} ({products_completed}/{total_products})",
"estimated_time_remaining_seconds": estimated_time_remaining_seconds
"estimated_time_remaining_seconds": estimated_time_remaining_seconds,
"estimated_completion_time": estimated_completion_time
}
}