feat: Refactor step status checking from if-else to switch statement in GetStepSuccessRate

- Replace if-else chain with switch statement for step.Status evaluation in monitor.go
- Maintain completed and failed case handling with cleaner control flow
This commit is contained in:
nutcas3
2026-05-03 09:49:37 +03:00
parent 9296bc567b
commit 192b4ce7ff
@@ -121,9 +121,10 @@ func (m *OnboardingMonitor) GetStepSuccessRate() map[string]float64 {
stepStats[step.Name] = map[string]int{"completed": 0, "failed": 0, "total": 0}
}
stepStats[step.Name]["total"]++
if step.Status == "completed" {
switch step.Status {
case "completed":
stepStats[step.Name]["completed"]++
} else if step.Status == "failed" {
case "failed":
stepStats[step.Name]["failed"]++
}
}