feat: calculate inspection resource points
This commit is contained in:
1 parent
5809d5a595
commit
21652d0001
6 files changed
+46
-2
No files matched your search
@@ -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)
|
||||
Reference in new issue
Block a user