Spaces:
Sleeping
Sleeping
| """Generate STATIC_L3_SECTIONS for frontend/index.html.""" | |
| from __future__ import annotations | |
| from backend.domain.rics_level3_schema import CANONICAL_SCHEMA | |
| HINTS = { | |
| "A1": "surveyor name 路 RICS number 路 qualifications 路 company 路 contact", | |
| "A2": "inspection date 路 time on site", | |
| "A3": "related party 路 conflict of interest", | |
| "A4": "weather 路 dry 路 wet 路 overcast", | |
| "A5": "occupied 路 vacant 路 furnished 路 access limitations", | |
| "B1": "condition ratings summary 路 Cat 1 路 Cat 2 路 Cat 3", | |
| "B2": "overall opinion 路 key findings", | |
| "B3": "further investigations 路 specialist reports", | |
| "C1": "property type 路 construction 路 detached 路 cavity 路 timber frame", | |
| "C2": "year built 路 approximate age 路 period", | |
| "C3": "accommodation 路 bedrooms 路 bathrooms 路 storeys 路 room matrix", | |
| "C4": "EPC 路 energy efficiency 路 double glazing", | |
| "C5": "location 路 facilities 路 flood 路 radon 路 noise", | |
| "D1": "chimney stacks 路 pots 路 flaunching 路 flashings 路 lean 路 condition rating", | |
| "D2": "roof covering 路 slate 路 tile 路 felt 路 slipped tiles 路 moss 路 condition rating", | |
| "D3": "gutters 路 downpipes 路 rainwater 路 hopper 路 leakage 路 condition rating", | |
| "D4": "main walls 路 cavity 路 render 路 DPC 路 cracking 路 condition rating", | |
| "D5": "windows 路 glazing 路 FENSA 路 frames 路 condition rating", | |
| "D6": "outside doors 路 patio doors 路 entrance door 路 condition rating", | |
| "D7": "conservatory 路 porch 路 glazing 路 condition rating", | |
| "D8": "fascias 路 soffits 路 external joinery 路 condition rating", | |
| "D9": "other outside elements 路 balconies 路 external stairs", | |
| "E1": "roof structure 路 trusses 路 rafters 路 purlins 路 loft access 路 condition rating", | |
| "E2": "ceilings 路 plaster 路 artex 路 cracking 路 condition rating", | |
| "E3": "walls 路 partitions 路 damp 路 cracking 路 condition rating", | |
| "E4": "floors 路 suspended 路 solid 路 springy 路 condition rating", | |
| "E5": "fireplaces 路 chimney breasts 路 flues 路 hearth 路 condition rating", | |
| "E6": "built-in kitchen 路 fitted wardrobes 路 cupboards 路 condition rating", | |
| "E7": "staircase 路 skirting 路 architrave 路 internal doors 路 condition rating", | |
| "E8": "bathroom fittings 路 sanitaryware 路 shower 路 WC 路 condition rating", | |
| "E9": "cellar 路 basement 路 other inside 路 condition rating", | |
| "F1": "electricity 路 consumer unit 路 wiring 路 EICR 路 condition rating", | |
| "F2": "gas 路 oil 路 meter 路 pipework 路 Gas Safe 路 condition rating", | |
| "F3": "water supply 路 stopcock 路 lead pipes 路 condition rating", | |
| "F4": "heating 路 boiler 路 radiators 路 controls 路 condition rating", | |
| "F5": "water heating 路 cylinder 路 combi 路 immersion 路 condition rating", | |
| "F6": "drainage 路 manholes 路 sewers 路 condition rating", | |
| "F7": "common services 路 shared utilities 路 flats only", | |
| "G1": "garage 路 car port 路 door 路 condition rating", | |
| "G2": "outbuildings 路 shed 路 workshop 路 condition rating", | |
| "G3": "boundaries 路 garden 路 driveway 路 shared areas 路 condition rating", | |
| "H1": "regulations 路 planning 路 listed building 路 conservation area", | |
| "H2": "guarantees 路 NHBC 路 FENSA 路 warranties", | |
| "H3": "tenure 路 lease 路 easements 路 other legal matters", | |
| "I1": "structural movement 路 dampness 路 timber defects 路 building risks", | |
| "I2": "flood 路 radon 路 mining 路 knotweed 路 ground risks", | |
| "I3": "asbestos 路 fire safety 路 safety glass 路 people risks", | |
| "I4": "other risks 路 contamination 路 hazards", | |
| "J1": "insulation 路 loft 路 cavity 路 floor insulation", | |
| "J2": "heating efficiency 路 boiler 路 heat pump", | |
| "J3": "lighting 路 LED 路 natural light", | |
| "J4": "ventilation 路 trickle vents 路 extract fans", | |
| "J5": "general energy 路 solar 路 EPC improvements", | |
| "K1": "surveyor declaration 路 signature 路 RICS 路 qualifications", | |
| "L1": "quotations 路 next steps 路 recommended actions", | |
| "M1": "terms of engagement 路 scope 路 fee 路 complaints", | |
| "N1": "typical house diagram 路 illustration reference", | |
| } | |
| lines = ["const STATIC_L3_SECTIONS = ["] | |
| for parent in CANONICAL_SCHEMA["sections"]: | |
| gid = str(parent["id"]) | |
| for sub in parent.get("subsections") or []: | |
| code = str(sub["id"]) | |
| title = str(sub["label"]).replace("'", "\\'") | |
| hint = HINTS.get(code, title) | |
| lines.append( | |
| f" {{ code:'{code}', group:'{gid}', title:'{title}', hint:'{hint}' }}," | |
| ) | |
| lines.append("];") | |
| print("\n".join(lines)) | |