diff --git a/backend/app/services/tempo_service.py b/backend/app/services/tempo_service.py index a0acd21..7a1b1f4 100644 --- a/backend/app/services/tempo_service.py +++ b/backend/app/services/tempo_service.py @@ -164,6 +164,14 @@ def auto_log_test_worklog( ) return None + # Tempo requires whole minutes. Always round UP to the nearest minute + # and enforce a minimum of 60 seconds (1 minute). + # 2 seconds → 60 s (1 min, minimum) + # 3 min 20 s (200s) → 240 s (4 min, ceiling) + # 5 min 0 s (300s) → 300 s (5 min, exact) + import math + duration_seconds = max(60, math.ceil(duration_seconds / 60) * 60) + # Per-user token required if not has_tempo_configured(user): logger.debug(