demo seed change 2

This commit is contained in:
Urtzi Alfaro
2025-12-14 11:58:14 +01:00
parent ff830a3415
commit a030bd14c8
44 changed files with 3093 additions and 977 deletions

View File

@@ -22,7 +22,7 @@ from pathlib import Path
# Add shared utilities to path
sys.path.insert(0, str(Path(__file__).parent.parent.parent.parent))
from shared.utils.demo_dates import adjust_date_for_demo, BASE_REFERENCE_DATE
from shared.utils.demo_dates import adjust_date_for_demo
from app.core.config import settings
@@ -117,7 +117,7 @@ async def clone_demo_data(
# This calculates the offset from BASE_REFERENCE_DATE and applies it to session creation time
if base_run.started_at:
new_started_at = adjust_date_for_demo(
base_run.started_at, reference_time, BASE_REFERENCE_DATE
base_run.started_at, reference_time
)
else:
new_started_at = reference_time - timedelta(hours=2)
@@ -125,7 +125,7 @@ async def clone_demo_data(
# Adjust completed_at using the same utility
if base_run.completed_at:
new_completed_at = adjust_date_for_demo(
base_run.completed_at, reference_time, BASE_REFERENCE_DATE
base_run.completed_at, reference_time
)
# Ensure completion is after start (in case of edge cases)
if new_completed_at and new_started_at and new_completed_at < new_started_at:
@@ -139,7 +139,7 @@ async def clone_demo_data(
def adjust_timestamp(original_timestamp):
if not original_timestamp:
return None
return adjust_date_for_demo(original_timestamp, reference_time, BASE_REFERENCE_DATE)
return adjust_date_for_demo(original_timestamp, reference_time)
# Create new orchestration run for virtual tenant
# Update run_number to have current year instead of original year, and make it unique