Dev.to WebDev 🛠 Dev 👁 0 📖 1 min read

Keep drainage observations apart from diagnoses in a form

JRC Paving describes concrete soakwell installation and repairs. City of Perth’s undertaking-work guidance provides a City of Perth process and forms for property drainage connections. The form can capture an initial bri

JRC Paving describes concrete soakwell installation and repairs. City of Perth’s undertaking-work guidance provides a City of Perth process and forms for property drainage connections. The form can capture an initial brief while leaving the site-specific decision for whoever assesses the job.

What the planner does today

flows.ts provides symptom, location and access options. project-flow.ts renders the selected text into the summary, with no classification of the underlying cause. The shared script in frontend/src/scripts/project-flow.ts keeps answers in a map and builds summary rows from the selected labels. The six-step layout is declared in frontend/src/components/ProjectFlow.astro. You can inspect the Perth Quotes drainage planner to compare the interface to the source.

A proposed data model with a small test

A drainage intake can carry two sightings through to review. It should need a distinct evidence-backed transition before it shows a diagnosis. The following self-contained example uses illustrative values only. Save the block as example.cjs and run node example.cjs.

const assert = require('node:assert/strict');

const observations = ['pooling near the door', 'overflow at another corner'];
const brief = { observations, diagnosis: null };
assert.equal(brief.observations.length, 2);
assert.equal(brief.diagnosis, null);

What to check in the browser

Complete the drainage preview with pooling as the symptom. Inspect the summary for the symptom label and check there is no inferred soakwell recommendation. This is a manual test design. The isolated Node example passed its assertions when executed locally for this draft. The browser interaction above was specified and has not been executed as part of this editorial run.

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.