feat(db): add explicit 'Pitched, sloping ceiling' roof_type values

Sloping-ceiling roofs (source EPC field PitchedWithSlopingCeiling) were being
flattened onto the horizontal-loft ladder ("Pitched, N mm loft insulation"),
which mis-models a roof whose insulation sits at the rafter/slope line. Add a
dedicated sloping-ceiling family to RoofTypeValues — an "as built" variant
(insulation deferred to construction age band) plus a 12 mm … 400+ mm depth
ladder mirroring the loft one — and the matching ALTER TYPE roof_type ADD VALUE
migration (0278).

property_overrides.override_value is text, so no change there; only the
landlord_roof_type_overrides.value pgEnum is constrained.

Backend counterpart (Model#1676): the roof overlay must model these at rafter
level, and the ColumnClassifier must map PitchedWithSlopingCeiling:<depth|As
Built|Unknown> to the new members. Once live, the affected property_overrides
snapshots + portfolio vocab rows get backfilled.

Note: numbered 0278 off current HEAD; if another in-flight migration also lands
0278, this needs a regenerate/renumber at merge.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-07-23 12:43:03 +00:00
parent 82897aa524
commit 2303d41c2b
4 changed files with 13537 additions and 0 deletions

View file

@ -0,0 +1,17 @@
ALTER TYPE "public"."roof_type" ADD VALUE 'Pitched, sloping ceiling, as built' BEFORE 'Roof room(s), insulated';--> statement-breakpoint
ALTER TYPE "public"."roof_type" ADD VALUE 'Pitched, sloping ceiling, 12 mm insulation' BEFORE 'Roof room(s), insulated';--> statement-breakpoint
ALTER TYPE "public"."roof_type" ADD VALUE 'Pitched, sloping ceiling, 25 mm insulation' BEFORE 'Roof room(s), insulated';--> statement-breakpoint
ALTER TYPE "public"."roof_type" ADD VALUE 'Pitched, sloping ceiling, 50 mm insulation' BEFORE 'Roof room(s), insulated';--> statement-breakpoint
ALTER TYPE "public"."roof_type" ADD VALUE 'Pitched, sloping ceiling, 75 mm insulation' BEFORE 'Roof room(s), insulated';--> statement-breakpoint
ALTER TYPE "public"."roof_type" ADD VALUE 'Pitched, sloping ceiling, 100 mm insulation' BEFORE 'Roof room(s), insulated';--> statement-breakpoint
ALTER TYPE "public"."roof_type" ADD VALUE 'Pitched, sloping ceiling, 125 mm insulation' BEFORE 'Roof room(s), insulated';--> statement-breakpoint
ALTER TYPE "public"."roof_type" ADD VALUE 'Pitched, sloping ceiling, 150 mm insulation' BEFORE 'Roof room(s), insulated';--> statement-breakpoint
ALTER TYPE "public"."roof_type" ADD VALUE 'Pitched, sloping ceiling, 175 mm insulation' BEFORE 'Roof room(s), insulated';--> statement-breakpoint
ALTER TYPE "public"."roof_type" ADD VALUE 'Pitched, sloping ceiling, 200 mm insulation' BEFORE 'Roof room(s), insulated';--> statement-breakpoint
ALTER TYPE "public"."roof_type" ADD VALUE 'Pitched, sloping ceiling, 225 mm insulation' BEFORE 'Roof room(s), insulated';--> statement-breakpoint
ALTER TYPE "public"."roof_type" ADD VALUE 'Pitched, sloping ceiling, 250 mm insulation' BEFORE 'Roof room(s), insulated';--> statement-breakpoint
ALTER TYPE "public"."roof_type" ADD VALUE 'Pitched, sloping ceiling, 270 mm insulation' BEFORE 'Roof room(s), insulated';--> statement-breakpoint
ALTER TYPE "public"."roof_type" ADD VALUE 'Pitched, sloping ceiling, 300 mm insulation' BEFORE 'Roof room(s), insulated';--> statement-breakpoint
ALTER TYPE "public"."roof_type" ADD VALUE 'Pitched, sloping ceiling, 350 mm insulation' BEFORE 'Roof room(s), insulated';--> statement-breakpoint
ALTER TYPE "public"."roof_type" ADD VALUE 'Pitched, sloping ceiling, 400 mm insulation' BEFORE 'Roof room(s), insulated';--> statement-breakpoint
ALTER TYPE "public"."roof_type" ADD VALUE 'Pitched, sloping ceiling, 400+ mm insulation' BEFORE 'Roof room(s), insulated';

File diff suppressed because it is too large Load diff

View file

@ -1940,6 +1940,13 @@
"when": 1784801404980,
"tag": "0277_woozy_prism",
"breakpoints": true
},
{
"idx": 278,
"version": "7",
"when": 1784810497155,
"tag": "0278_living_baron_strucker",
"breakpoints": true
}
]
}

View file

@ -130,6 +130,30 @@ export const RoofTypeValues: [string, ...string[]] = [
"Pitched, 350 mm loft insulation",
"Pitched, 400 mm loft insulation",
"Pitched, 400+ mm loft insulation",
// Pitched roof with a sloping ceiling — insulation sits at the rafter/slope
// line, NOT a horizontal loft, so it is modelled explicitly rather than
// flattened onto the "Pitched, N mm loft insulation" ladder. Depth ladder
// mirrors the loft one (12 mm … 400+ mm); "as built" defers the insulation
// assumption to the construction age band. Source EPC field is
// "PitchedWithSlopingCeiling"; this canonical name is intentionally our own.
// See Hestia-Homes/Model#1676 (roof overlay must model these at rafter level).
"Pitched, sloping ceiling, as built",
"Pitched, sloping ceiling, 12 mm insulation",
"Pitched, sloping ceiling, 25 mm insulation",
"Pitched, sloping ceiling, 50 mm insulation",
"Pitched, sloping ceiling, 75 mm insulation",
"Pitched, sloping ceiling, 100 mm insulation",
"Pitched, sloping ceiling, 125 mm insulation",
"Pitched, sloping ceiling, 150 mm insulation",
"Pitched, sloping ceiling, 175 mm insulation",
"Pitched, sloping ceiling, 200 mm insulation",
"Pitched, sloping ceiling, 225 mm insulation",
"Pitched, sloping ceiling, 250 mm insulation",
"Pitched, sloping ceiling, 270 mm insulation",
"Pitched, sloping ceiling, 300 mm insulation",
"Pitched, sloping ceiling, 350 mm insulation",
"Pitched, sloping ceiling, 400 mm insulation",
"Pitched, sloping ceiling, 400+ mm insulation",
"Roof room(s), insulated",
"Roof room(s), insulated (assumed)",
"Roof room(s), limited insulation",