Phase 0 — Schema verification checklist

Status: Ready for your review (automated checks passed).

Source of truth: User-provided specification (not DOCX).

Schema version: 1 · Draft storage key: lonham_questionnaire_draft_v1


Automated verification

Run:

npx tsx src/lonham-questionnaire/schema/verify-schema.ts
npx tsx src/lonham-questionnaire/schema/emit-schema-json.ts

Checklist (specification coverage)

# Requirement Status
1 Every numbered question 1–17 present
2 Section headings 11–16 + 17. MATERIAL FACTS + DECLARATION
3 Document title + intro verbatim
4 Underwriter disclaimer notes (intruder alarm + electrical)
5 All Y/N conditionals wired (18 conditional rules)
6 Claims table: 3 columns, verbatim headers
7 Declaration text + confirm checkbox + signature block + printed name + company + date
8 Signature methods: draw, typed, upload
9 10 wizard steps (UX grouping)
10 Unique pdfOrder for PDF document sequence
11 No DOCX parsing references
12 QUESTIONNAIRE_SCHEMA_VERSION + draft key exported

Field count summary

Category Count
Total schema entries 81
Answerable fields (excl. notes/headings) 60
Yes/No fields 28
Conditional detail fields 18
Section headings 9
Static notes / disclaimers 8
Repeatable claims table 1

Wizard step map

Step Fields
1 Account, Q1–3
2 Q4–7
3 Q8–10
4 Q11 Construction
5 Q12 Occupancy
6 Q13 Security
7 Q14 Protections
8 Q15 Exposures / Other
9 Q16 Claims
10 Q17, Declaration, Signature

Conditional logic reference

Child field Shows when
q4_sole_occupancy_details q4_sole_occupancy = no
q7_seasonal_details q7_seasonal_fluctuations = yes
q10_other_activities_details q10_other_activities = yes
q11b_external_walls_other q11b_external_walls includes other_cladding
q11c_roof_other q11c_roof includes other
q11h_lining_details q11h_composite_panels = yes
q12a_hours_* (4 fields) q12a_occupied_24_7 = no
q12b_machinery_details q12b_machinery_unattended = yes
q13d_alarm_remote q13d_intruder_alarm = yes
q13e_cctv_remote q13e_cctv = yes
q14a_sprinkler_remote q14a_sprinkler = yes
q14b_fire_remote q14b_fire_detection = yes
q14c_extinguisher_maintenance q14c_extinguishers = yes
q15b_flood_details q15b_ever_flooded = yes
q15e_lighting_details q15e_high_intensity_lighting = yes

Q15e lighting (spec fidelity)

Rendered as three schema entries (PDF order):

  1. Note: e) Are the premises illuminated by any of the following high intensity lighting bulbs:
  2. Note: bullet list — Metal Halide / Mercury Vapour / Sodium
  3. Yes/No field labelled YES / NO

Files created (Phase 0)

File Purpose
questionnaire.types.ts Types, version constants, response/draft shapes
questionnaire.schema.ts Canonical field definitions
schema-utils.ts Visibility, defaults, PDF ordering helpers
index.ts Public exports
verify-schema.ts Automated spec verification
emit-schema-json.ts JSON export for API/PDF
questionnaire.schema.json Generated JSON snapshot

Review notes for approver

  1. Q15e uses a separate YES / NO label on the toggle (matches paper form layout); confirm this is acceptable vs. inline Y/N on the question line.
  2. Section 13d underwriter note displays whenever step 6 is shown (not gated on alarm = yes), matching “always visible after alarm questions” in the plan.
  3. Q16 claims table allows zero rows (minRows: 0); rows are optional until submit validation rules are added in Phase 2.

Awaiting your approval before Phase 1 (Supabase) or Phase 2 (UI).