feat: calculate inspection resource points

This commit is contained in:
nyan404 committed 2026-08-16 16:41:31 +03:00
1 parent 5809d5a595
commit 21652d0001
6 files changed
+46 -2

No files matched your search

+3 -1
View File
@@ -8,6 +8,7 @@ from .domain import (
InspectionReport,
TrainingSession,
calculate_coaching,
calculate_inspection,
calculate_training,
)
from .reports import render_coaching, render_inspection, render_training
@@ -139,7 +140,8 @@ def calculate_payload(payload: dict[str, Any]) -> dict[str, Any]:
inspections=_int(payload, "inspections"),
resources=resources,
)
return {"mode": mode, "message": render_inspection(report)}
result = calculate_inspection(report)
return {"mode": mode, "result": asdict(result), "message": render_inspection(report, result)}
except (KeyError, IndexError, TypeError, ValueError) as exc:
if isinstance(exc, ApiError):
raise