mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-07-19 17:02:59 +00:00
Builds the bulk-trigger-modelling journey per ADR-0008 on the TDD'd core:
- Server module: triggerModellingRun (app-authored task + config subtask,
BulkUpload trigger convention; dispatch to /v1/plan/trigger-run; failed
dispatch marks the task failed), previewModellingRun (dry-run count proxy
to /v1/plan/preview-run), listModellingRuns (one grouped portfolio-scoped
query; config parsed back, progress from execution-subtask counts),
scenarioIdsWithActiveRuns (third badge state).
- Routes: POST/GET /api/portfolio/[id]/modelling-runs, POST .../preview,
GET /api/portfolio/[id]/postcodes (grouped distinct + counts).
- Page /portfolio/[slug]/modelling/run to the approved mockup in the
scenarios-tab design language: scenario picker with the three badges and
in-flight warning, three filter columns (postcodes from DB, canonical
enums + Unknown), engine-counted summary tray with re-model callouts,
large-run confirm (10k gate), done state with ETA, Recent runs table
with live progress. TanStack Query v4; no useEffect/useMemo.
- "Run modelling" button beside Add properties in PropertyTable.
Backend contract (Model team): the distributor at /v1/plan/trigger-run
accepts {task_id, portfolio_id, scenario_ids, filters, ...} and attaches
execution subtasks to the given task; /v1/plan/preview-run returns
{matched_properties, per_scenario[]} through the same resolution code path.
Verified live against portfolio 814: postcodes, validation errors, unknown
scenarios, dispatch failure marks the task failed and history shows it;
simulated backend execution subtasks drove status to
{in_progress, ready 2, total 4} and the scenario badge to "Modelling in
progress" in the rendered page; portfolio page shows the button. tsc, lint
and all 365 vitest tests pass.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| actions | ||
| api | ||
| auth | ||
| components | ||
| db | ||
| domna | ||
| email_templates | ||
| engineDb | ||
| help | ||
| home | ||
| hooks | ||
| lib | ||
| onboarding | ||
| portfolio/[slug] | ||
| shadcn_components/ui | ||
| types | ||
| utils | ||
| verify/[token] | ||
| globals.css | ||
| layout.tsx | ||
| page.tsx | ||
| ReactQueryProvider.tsx | ||
| utils.test.ts | ||
| utils.ts | ||