Commit Graph

3 Commits

Author SHA1 Message Date
8114db9988 test(ssr): assert bank-account edits persist through the Client wizard save
Locks in the sub-editor → session → save-client! round-trip the earlier blank-address
fix unblocked: edit the seeded account's nickname via the bank-account sub-editor, Accept,
save the client, reopen, walk back to the bank-accounts step, and confirm the new nickname
is shown and the old one is gone (renamed in place, not duplicated). Full e2e suite 72/72.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 08:37:47 -07:00
7b0e8bfd65 refactor(ssr): Phase 10 — migrate Client wizard onto the engine (7 steps + bank-account sub-editor)
The largest SSR modal, moved off the mm/* multi-step wizard protocol machinery
(ClientWizard/*Modal records, MultiStepFormState, fc/* form-cursors, EDN-snapshot
round-trip) onto the session-backed engine (wizard2 + wizard-state): flat de-cursored
field names, whole-form HTMX swaps, per-step session state combined by the done-fn.

Seven linear steps (info → matches → contact → bank-accounts → integrations → cash-flow
→ other-settings), each a data-driven {:decode :validate :render :next}. The grid, form
schemas, and the sales power-query export are preserved unchanged.

The parameterized [:bank-account which] mm sub-step (which the linear engine can't model)
becomes a sub-editor of the bank-accounts step: the list view and per-account editor are
whole-form swaps of #wizard-form, driven by dedicated routes (new/edit/accept/discard/
sort) that mutate the :bank-accounts step-data in the session directly and re-render via
the engine's render-wizard. The bank-accounts step's :decode is a pass-through that
re-affirms the session-managed list (read via a `wiz` hidden the engine doesn't strip),
so Next never wipes it.

Notable fixes carried over from prior phases:
- New vs edit is keyed off :db/id presence (the engine always POSTs, so the old PUT/POST
  split no longer distinguishes them).
- Client + bank-account dates are coerced to #inst for EDN-safe session storage
  (clj-time DateTime has no cookie-session reader).
- An empty Contact-step address posts blank fields → decodes to an all-nil, db/id-less
  map; blank-address? drops it before upsert (else datomic: "tempid used only as value").

Routes: drop ::navigate/::discard; add the four bank-account sub-editor routes.
Full e2e suite green (71/71); client-wizard acceptance spec rewritten for the engine
(flat field names, data-primary nav, bank-account open/accept/discard sub-flows).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 00:49:56 -07:00
b0fe7cc70d test(ssr): Phase 10 parity gate — characterization spec for the Client wizard
Pin the current (pre-migration) behavior of the Client wizard — the largest SSR
modal: seven linear steps (info → matches → contact → bank-accounts → integrations
→ cash-flow → other-settings) plus the parameterized bank-account sub-editor — so
the upcoming engine migration preserves it.

- e2e/client-wizard.spec.ts: new dialog renders info + the 7-step timeline; edit
  opens prefilled with a disabled code; the bank-accounts step shows the seeded
  account card and the add-account affordance (the crux sub-step); and an
  edit-through-to-save round-trip keeps the client in the grid.
- test_server.clj: give the seeded TEST client a :client/name so the row is
  selectable in the admin grid (its base query requires :client/name); also honor
  a TEST_SERVER_PORT env var so a from-disk e2e JVM can run on a free port
  alongside a REPL-held one (the same parallel-run need the playwright config notes).

Full e2e suite green (69/69) against a fresh from-disk server.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 00:13:03 -07:00