Import/Export consolidation #536

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

Motivation

The CSV import god module and three parallel export pipelines carry duplication and an inline reimplementation.
Consolidate them; move one business rule into the domain so it holds for all callers.

Scope (ordered steps, CI green each)

  • R-029 — split import/member_csv.ex (1065 LOC). Extract CustomFieldCoercer and ImportErrorFormatter;
    narrow the over-broad rescue. Pure refactoring.
  • R-014 — collapse export pipelines. Route the three export paths through MemberExport.Build.build/3
    (~250 LOC inline reimplementation in member_export_controller.ex:248-558 removed); fixes the CSV/PDF
    boolean-filter divergence. The CSV controller must accept a label_fn so output matches byte-for-byte.
  • R-026 — rule into Ash. Move the interval-compatibility business rule out of the LiveView
    (membership_fees_component.ex:618-676) into an Ash action so it applies on UI + import + API (mild behavior
    extension: the rule now runs on all paths, not just the UI).

Out of scope

Import create-member + group-link atomicity (F-025) is documented deliberate behavior, not a bug — see ISSUES.md
Discussion F. Do not change it here.

Acceptance criteria

  • Import/export output pinned by fixtures (no behavior change for R-029/R-014; in particular CSV column order and
    sort unchanged).
  • R-026 rule verified on the import and API paths, not just the UI.
  • just ci-dev green.

Dependencies

After issue "Mechanical cleanup …" (R-003 deletes the dead MemberExport.fetch/2 chain first).

## Motivation The CSV import god module and three parallel export pipelines carry duplication and an inline reimplementation. Consolidate them; move one business rule into the domain so it holds for all callers. ## Scope (ordered steps, CI green each) - **R-029 — split `import/member_csv.ex` (1065 LOC).** Extract `CustomFieldCoercer` and `ImportErrorFormatter`; narrow the over-broad `rescue`. Pure refactoring. - **R-014 — collapse export pipelines.** Route the three export paths through `MemberExport.Build.build/3` (~250 LOC inline reimplementation in `member_export_controller.ex:248-558` removed); fixes the CSV/PDF boolean-filter divergence. The CSV controller must accept a `label_fn` so output matches byte-for-byte. - **R-026 — rule into Ash.** Move the interval-compatibility business rule out of the LiveView (`membership_fees_component.ex:618-676`) into an Ash action so it applies on UI + import + API (mild behavior extension: the rule now runs on all paths, not just the UI). ## Out of scope Import create-member + group-link atomicity (F-025) is documented deliberate behavior, not a bug — see ISSUES.md Discussion F. Do not change it here. ## Acceptance criteria - Import/export output pinned by fixtures (no behavior change for R-029/R-014; in particular CSV column order and sort unchanged). - R-026 rule verified on the import and API paths, not just the UI. - `just ci-dev` green. ## Dependencies After issue "Mechanical cleanup …" (R-003 deletes the dead `MemberExport.fetch/2` chain first).
moritz added this to the Code and Test Refactoring | TI I milestone 2026-06-15 22:16:58 +02:00
moritz added this to the Sprint 18: Juli 2026 project 2026-06-15 22:16:58 +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#536
No description provided.