Split the Member resource #537

Open
opened 2026-06-15 22:17:52 +02:00 by moritz · 0 comments
Owner

Motivation

Member (lib/mv/membership/member.ex after the layout-unification issue) is the domain's fan-in hub (~28
incoming deps, 58 module deps, 1491 LOC). It mixes the resource declaration, cycle-sync logic, search logic, and
several inline anonymous-function validations. Highest blast radius — so test scaffolding comes first.

Scope (ordered steps, CI green each)

  • Step 1: resource-boundary test scaffolding pinning search, cycle regeneration, and custom-field behavior.
  • Step 2: extract the cycle-sync logic into a CycleSync module.
  • Step 3: extract the search logic into a Search module.
  • Step 4: extract the inline validations into named Validation modules (consistent with the sibling rules that
    are already named modules). Fix along the way, each with a regression test:
    • F-021 the async-then-await pattern;
    • F-026 the nil fee-type handling;
    • F-052 the hand-rolled inline validations (member.ex:427-477).

Acceptance criteria

  • Member resource materially thinner; extracted modules unit-tested.
  • The three folded bugs (F-021, F-026, F-052) each covered by a regression test.
  • just ci-dev green after each step.

Dependencies

Run after the layout-unification issue (so the resource is already at its final lib/mv/membership/ path).

## Motivation `Member` (`lib/mv/membership/member.ex` after the layout-unification issue) is the domain's fan-in hub (~28 incoming deps, 58 module deps, 1491 LOC). It mixes the resource declaration, cycle-sync logic, search logic, and several inline anonymous-function validations. Highest blast radius — so test scaffolding comes first. ## Scope (ordered steps, CI green each) - Step 1: resource-boundary test scaffolding pinning search, cycle regeneration, and custom-field behavior. - Step 2: extract the cycle-sync logic into a `CycleSync` module. - Step 3: extract the search logic into a `Search` module. - Step 4: extract the inline validations into named `Validation` modules (consistent with the sibling rules that are already named modules). Fix along the way, each with a regression test: - F-021 the async-then-await pattern; - F-026 the nil fee-type handling; - F-052 the hand-rolled inline validations (`member.ex:427-477`). ## Acceptance criteria - `Member` resource materially thinner; extracted modules unit-tested. - The three folded bugs (F-021, F-026, F-052) each covered by a regression test. - `just ci-dev` green after each step. ## Dependencies Run after the layout-unification issue (so the resource is already at its final `lib/mv/membership/` path).
moritz added this to the Code and Test Refactoring | TI I milestone 2026-06-15 22:17:52 +02:00
moritz added this to the Sprint 18: Juli 2026 project 2026-06-15 22:18:03 +02:00
Sign in to join this conversation.
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: local-it/mitgliederverwaltung#537
No description provided.