Skip to content

feat(members): every fee-table column is filterable + sortable (spec 50) - #285

Merged
PeterGeers merged 1 commit into
testfrom
fix/50-fee-column-filters
Nov 30, 2026
Merged

PeterGeers merged 1 commit into
testfrom
fix/50-fee-column-filters

Conversation

@PeterGeers

Copy link
Copy Markdown
Owner

Only the membership-type column was wired to the shared table framework (FilterableHeader + useFilterableTable) - the money, period and status columns were plain <Th> cells.

All five columns are now filterable and sortable:

Column Filter Sort field
Membership type text label
Registration fee text on the currency-free amount (12) registrationValue (numeric)
Current period fee text on the currency-free amount (77.9) currentFeeValue (numeric)
Current period text on the range (2026) currentStart (ISO -> chronological)
Status enum select (current / no period for today / not configured) statusRank (semantic order)

Why derived fields: useTableSort only compares values numerically when both are numbers, so sorting formatted money strings would be lexicographic; and filtering must not depend on the currency symbol. The row model now carries registrationText/Value, currentFeeText/Value, currentRange, currentStart, statusKey/Rank; cells keep rendering the formatted money. Rows without a value sort last (framework nullish rule). Default sort: type name asc.

Tests: model 18 -> 21, editor 8 -> 12 (five sortable headers, money filter, numeric current-fee sort, status enum filter) = 40 passed; tsc --noEmit clean; eslint clean.

…50 R14)

Only the membership-type column was wired to the shared table framework; the money, period and
status columns were plain `<Th>` cells.

- `buildFeeRows` now derives the framework fields per row: `registrationText` / `currentFeeText`
  (currency-free decimals, so filtering "12" works), `registrationValue` / `currentFeeValue`
  (numbers — `useTableSort` only compares numbers numerically), `currentRange` / `currentStart`
  (range text + ISO start for chronological sort), and `statusKey` / `statusRank` (enum filter +
  semantic order: current -> planned-only -> not configured). Cells keep rendering formatted money.
- `MembershipFeesEditor`: `FilterableHeader` on all five columns (money + period as text filters,
  status as an enum `Select`), default sort = type asc; the status badge now reads `row.statusKey`.
- tests: model 18 -> 21 (framework fields incl. future-only), editor 8 -> 12 (five sortable headers +
  the three filter controls, money filter, numeric current-fee sort, status enum filter).
- spec: design "Every column is filterable + sortable", tasks 11.2/11.3.

Verified: vitest 40 passed (model 21, editor 12, translations 7), `tsc --noEmit` clean, eslint clean.
@PeterGeers
PeterGeers merged commit 14e246c into test Nov 30, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant