Bill room-in-roof surfaces with the surveyed roof insulation, stud-wall commons 🟥

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-07-14 22:28:10 +00:00
parent 955b4dc1e8
commit 25c3f0b2a0

View file

@ -167,16 +167,30 @@ class TestRoomInRoofMapping:
assert rir.construction_age_band == "B"
surfaces = rir.detailed_surfaces
assert surfaces is not None
# Common walls lodge as Detailed-mode stud walls (Table 17 col 3) —
# "common_wall" is a §3.9.2 Simplified-Type-2-only concept; every
# worksheet-validated Detailed fixture uses stud_wall for this low
# internal wall.
kinds_areas = [(s.kind, round(s.area_m2, 2)) for s in surfaces]
assert kinds_areas == [
("gable_wall_external", round(6.64 * 2.74, 2)),
("gable_wall", round(6.64 * 2.74, 2)),
("slope", round(4.94 * 1.73, 2)),
("slope", round(5.0 * 2.95, 2)),
("common_wall", round(4.94 * 1.45, 2)),
("common_wall", round(4.94 * 1.3, 2)),
("stud_wall", round(4.94 * 1.45, 2)),
("stud_wall", round(4.94 * 1.3, 2)),
("flat_ceiling", round(4.94 * 5.17, 2)),
]
# PasHub lodges roof insulation once at roof-space level (the fixture's
# "Joists"/100mm) — thread it into the roof-going surfaces so they
# aren't billed at the Table 18 "unknown" full-uninsulated default
# while the same survey says the roof is insulated. Gables keep None
# (walls — insulation described by the wall fields, not the loft).
by_kind = {s.kind: s.insulation_thickness_mm for s in surfaces}
assert by_kind["slope"] == 100
assert by_kind["stud_wall"] == 100
assert by_kind["flat_ceiling"] == 100
assert by_kind["gable_wall"] is None
def test_no_rooms_in_roof_stays_absent(self) -> None:
# Arrange — the fixture as lodged (rooms_in_roof=false).