feat(members): unified people search across members and dependents
Overhaul /members/search so one bar finds anyone in the club — the member,
a spouse, a child or a temporary member — and add an advanced filter panel.
MemberSearchService becomes the single source of truth for people search:
- UNIONs members + spouses + children + temporary_members into one normalised
row per matched PERSON (person_type, relation, parent membership, rank).
- Token AND matching on names, so word order no longer matters:
"محمود احمد" finds "أحمد سيد محمود".
- Arabic orthographic folding (أ إ آ ٱ→ا, ى→ي, ة→ه, ؤ→و, ئ→ي) applied to both
the query and the column, so "احمد" matches "أحمد".
- Arabic-Indic and Persian digits folded to ASCII before identifier matching.
- Relevance ranking: exact membership number / national id, then name prefix,
then substring. LIKE wildcards in user input are escaped.
Scopes (member/spouse/child/temporary) and fields (name, membership number,
national id, phone, form number, passport) are selectable; branch, membership
status and membership type filter on the parent membership. A scope whose table
lacks the requested field is skipped rather than matching nothing.
The legacy search() keeps its exact signature and output shape, so the three
existing API consumers are untouched.
Also:
- Split Member::getStatusOptions() (statuses an employee may ASSIGN) from
getAllStatusLabels() (every status, for display/filtering). deceased,
transferred and waived exist in live data but were missing from the list, so
they could not be filtered on; they are deliberately kept out of the
assignable set because the Death, Transfer and Waiver workflows own those
transitions.
- Dependent deep links honour spouse.view / child.view / temp.view and fall
back to the membership file when denied.
- Map children.relationship (son/daughter) and temporary_members.category
(nanny/parent/unmarried_daughter) to Arabic for display.
- The search form submitted to /members, dropping most of what was typed; it
now posts back to /members/search.
- Sidebar declared member.search while the route requires member.view; aligned.
Architecture Map and Dependency Graph updated per project protocol, including
the placeholder-ordering constraint in buildScopeQuery() and the three inline
member-search SQL blocks that remain unconsolidated.
Co-Authored-By:
Claude Opus 5 (1M context) <noreply@anthropic.com>
Showing
This diff is collapsed.
This diff is collapsed.
Please register or sign in to comment