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

Give repair and appearance work separate revision states

Westcoat describes tiled roof restoration in Perth. WA Building and Energy’s roof-coating fact sheet distinguishes the purpose of coating from claims that all tiled roofs need it. The form can capture an initial brief wh

Westcoat describes tiled roof restoration in Perth. WA Building and Energy’s roof-coating fact sheet distinguishes the purpose of coating from claims that all tiled roofs need it. The form can capture an initial brief while leaving the site-specific decision for whoever assesses the job.

What the planner does today

additional-flows.ts supplies the roofing questions; the common renderer produces one selected answer per step. The preview does not have line-item scope approvals. 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 roofing planner to compare the interface to the source.

A proposed data model with a small test

If the project later grows an estimate review screen, accepting the ridge repair must leave appearance work awaiting a decision. Updating scope by ID makes that transition explicit. 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 scope = [{id: 'ridge', status: 'proposed'}, {id: 'coating', status: 'proposed'}];
const revised = scope.map(item => item.id === 'ridge' ? {...item, status: 'accepted'} : item);
assert.equal(revised.find(item => item.id === 'coating').status, 'proposed');

What to check in the browser

Finish the roofing preview and confirm it ends in a brief, without an approval control for coating or any other line item. 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.