fix(): business logic fixes and code refactoring

This commit is contained in:
ITQ
2026-02-24 09:58:07 +03:00
parent e51b74a133
commit 16b48fee40
18 changed files with 307 additions and 140 deletions
+2 -2
View File
@@ -129,7 +129,7 @@ def calculate_metric_value(
if not decision_ids:
return None
metric_type = rule.get("type", metric.metric_type)
metric_type = metric.metric_type
if metric_type == MetricType.RATIO:
numerator = _count_events(
@@ -145,7 +145,7 @@ def calculate_metric_value(
end_date,
)
if denominator == 0:
return Decimal(0)
return None
return Decimal(str(round(numerator / denominator, 6)))
if metric_type == MetricType.COUNT: