Fix inherited contract handling and document smoke test blockers

This commit is contained in:
Rob committed 2026-04-21 15:48:52 +02:00
1 parent 0be2646952
commit 418d8336f5
4 files changed
+258 -210

No files matched your search

+14 -5
View File
@@ -194,22 +194,31 @@ def validate_sources(
if len(month_matches) == 1:
month_column = month_matches[0]
employee_col = column_index_from_string(allocation_cols["employee_name"])
contract_col = column_index_from_string(allocation_cols["contract_hours_weekly"])
project_col = column_index_from_string(allocation_cols["project_key"])
current_contract_value: float | None = None
for row_idx in range(header_row + 1, allocation_ws.max_row + 1):
employee_value = _to_text(allocation_ws.cell(row=row_idx, column=employee_col).value)
contract_raw = allocation_ws.cell(row=row_idx, column=contract_col).value
parsed_contract = _to_float_or_none(contract_raw)
if employee_value:
current_contract_value = parsed_contract
project_key = _to_text(allocation_ws.cell(row=row_idx, column=project_col).value)
if not project_key:
continue
contract_value = _to_float_or_none(
allocation_ws.cell(row=row_idx, column=contract_col).value
)
if contract_value is None or contract_value <= 0:
if current_contract_value is None or current_contract_value <= 0:
issues.append(
ValidationIssue(
code="INVALID_CONTRACT_HOURS",
message=f"Invalid contract weekly hours at row {row_idx}.",
message=(
f"Invalid inherited contract weekly hours at row {row_idx}."
),
severity="error",
)
)