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

+5 -1
View File
@@ -4,8 +4,10 @@ from .domain import (
CoachingResult,
CoachingSession,
InspectionReport,
InspectionResult,
TrainingSession,
TrainingResult,
calculate_inspection,
format_clock,
parse_clock,
)
@@ -38,7 +40,8 @@ def render_training(session: TrainingSession, result: TrainingResult | None = No
)
def render_inspection(report: InspectionReport) -> str:
def render_inspection(report: InspectionReport, result: InspectionResult | None = None) -> str:
result = result or calculate_inspection(report)
if report.inspections == 1:
word = "раз"
else:
@@ -55,4 +58,5 @@ def render_inspection(report: InspectionReport) -> str:
)
else:
lines.append("0")
lines.append(f"Баллы осмотра: {result.points} баллы.")
return "\n".join(lines)