mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-07-27 22:45:03 +00:00
Step 2 of 3's screen, on top of the pure logic in the previous commit. Follows wireframes 08 (value mapping locked) and 09 (unlocked). Writes nothing. Where the step lives Client state inside ImportUpload, not a /import/mapping route: the parsed rows live in that component (#414), so a URL step would drop them and force a re-upload on every Back. "Continue to mapping" — disabled since #414 — now opens the mapping screen. ImportMapping — the screen Owns the two mapping layers and nothing else. Statuses, counts, which values need review and whether Continue is enabled are all derived inline from (file, columnMapping, valueMapping, targets) on each render, so re-pointing the workstream column immediately re-groups the contractor and stage tables — they were never a separate copy of the answer. No useEffect, no useMemo. ColumnMappingTable — file column -> Ara field One row per file column with the wireframe's matched / needs-review affordances, an "e.g. …" sample from the preview, and a shadcn Select per row offering every field plus "Don't import this column". Picking a field another column already holds says so in the option hint rather than moving it silently. Beneath the table, the requirement blockers: which required fields are still unmapped and why. Unmapped *optional* fields are stated, never blocking. ValueMappingTables — values -> the project's own entities Three tables. Workstream values map flat; contractor and stage values are grouped under the workstream they are scoped to, because a contractor assignment and a stage ladder belong to a workstream (ADR-0019) — the same "Acme" under two workstreams is two questions, and each picker offers only that workstream's assignments. Row counts per value, auto-matched marked as such. Notes carry the cases with no row of their own: rows waiting on their workstream mapping, blank contractors (an error downstream), and blank stages (not an error — they start at the workstream's first stage). Gating (AC) The value tables are locked, exactly as wireframe 08 shows, until every required column is mapped — there is nothing to list until we know which column holds the workstream. Continue to validation is disabled until the same condition holds, and names what is missing. Unmapped *values* never block: they surface as "N of M rows will fail validation as mapped". page.tsx Loads the value-mapping targets server-side alongside readiness (read-only, and skipped entirely for a gated project, which has nothing to map to). Container widened to max-w-5xl for the mapping tables; the eyebrow now covers steps 1–2. ADR-0020 — records that the import session, and the mapping persisted alongside it, are client-held. Persisting the mapping without the rows buys nothing: the rows are client-held too, so a refresh loses them either way and a restored mapping has no file to apply to. ImportSession is JSON-clean so a future server-side session can store it unchanged; the ADR names moving the file server-side as the thing that would change the answer. It also records the production-database constraint honestly, as a constraint and not as the reason. Stepping back to the drop zone and forward again keeps the mapping: the session is held above the mapping component, so that component may unmount freely. 225 tests pass across src/lib/projects; tsc and eslint clean. No component tests — this repo runs vitest in a node environment with no DOM setup. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| 0001-data-backfills-outside-drizzle.md | ||
| 0002-effective-performance-is-canonical-current.md | ||
| 0003-app-authored-scenarios.md | ||
| 0007-postcode-search-creates-properties.md | ||
| 0008-modelling-runs-filters-to-distributor.md | ||
| 0009-portfolio-organisation-is-per-user.md | ||
| 0010-compliance-window-is-a-report-view-parameter.md | ||
| 0011-app-owned-task-marker-in-task-source.md | ||
| 0012-portfolio-list-resolves-descriptors-via-override-precedence.md | ||
| 0013-tags-are-app-owned-property-groupings.md | ||
| 0014-epc-cards-count-certificates-not-predictions.md | ||
| 0015-scenario-overlay-is-one-read-model.md | ||
| 0016-sap-epc-threshold-ladder-single-owner.md | ||
| 0017-likely-downgrade-is-band-movement-only.md | ||
| 0018-ara-projects-supersedes-hubspot-live-projects.md | ||
| 0019-uk-date-format-in-form-inputs.md | ||
| 0019-work-order-import-is-setup-gated-and-carries-contractor-per-row.md | ||
| 0020-import-session-and-mapping-are-client-held.md | ||