fix(client-detail): payment step gate matches shipped key payment_received

The status-line payment picker only fired for advance_payment/balance_payment,
which no shipped template contains (the composed tails and the migration both
standardise on payment_received) — so payment linking was unreachable and
project_milestone.payment_id was never written by the UI. Keeps the legacy keys
for projects not yet migrated. Also refreshes the stale STATUS test count.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
main
Thomas Joise 1 day ago
parent ac16d8c896
commit 7494f53e2f

@ -68,7 +68,7 @@ header stacks instead of overlapping the title).
| --- | --- |
| `npm install` | clean |
| `npm run typecheck` (root + workspaces) | clean, no errors |
| `npm test` (`vitest run`) | **416 tests pass across 85 files** (5 Postgres-gated skipped) |
| `npm test` (`vitest run`) | **473 tests pass across 94 files** (5 Postgres-gated skipped) |
The 416 figure is the live `vitest run` count measured 2026-07-19; the suite has
grown from the D18 go-live cluster through the D20–D33 work (tickets, module fields,

@ -1391,9 +1391,10 @@ function SecretField(props: { cm: ClientModule; field: FieldDef; managerial: boo
* module status (installed/live) exactly as before. Three steps instead hand off to a
* dialog the parent (`ClientDetail`) owns, because each needs data this component does
* not hold:
* - the advance/balance **payment** steps call `onTickPayment` `PaymentPickerDialog`,
* which links a real ledger payment (`setMilestone(..., paymentId)`) rather than
* stamping a bare date;
* - the **payment** step (`payment_received`, plus the legacy `advance_payment` /
* `balance_payment` keys on un-migrated projects) calls `onTickPayment`
* `PaymentPickerDialog`, which links a real ledger payment
* (`setMilestone(..., paymentId)`) rather than stamping a bare date;
* - the `account_creation` **credentials** step calls `onTickCreds`
* `CredentialsDialog`, which captures the module's provider/username/password
* (managerial gate) at the moment the account actually exists;
@ -1439,7 +1440,10 @@ function StatusLine(props: {
const done = ms?.filter((m) => m.done).length ?? 0
// current = first not-done step
const currentKey = ms?.find((m) => !m.done)?.key
const isPaymentStep = (key: string) => key === 'advance_payment' || key === 'balance_payment'
// `payment_received` is the key every shipped template uses; advance_/balance_payment are
// legacy keys that still exist on projects not yet run through the onboarding migration.
const isPaymentStep = (key: string) =>
key === 'payment_received' || key === 'advance_payment' || key === 'balance_payment'
const isCredsStep = (key: string) => key === 'account_creation'
const isDocumentStep = (key: string) => key === 'quotation_sent'

Loading…
Cancel
Save