[FEATURE]: Implement persistence via Ash Create #334

Open
opened 2026-01-07 13:52:14 +01:00 by carla · 0 comments
Owner

Description

Create members and capture errors per row with correct CSV line numbers.

Tasks:

  • Implement process_chunk/3 in service:
    • Input: [{csv_line_number, row_map}]
    • Validate + create sequentially
    • Collect counts + first 50 errors (per import overall; LiveView enforces cap across chunks)
  • Implement Ash error formatter helper:
    • Convert Ash.Error.Invalid into %MemberCSV.Error{}
    • Prefer field-level errors where possible (attach field atom)
    • Handle unique email constraint error as user-friendly message
  • Map row_map to Ash attrs (%{first_name: ..., ...})

Important: Do not recompute line numbers in this layer—use the ones provided by the parser.

External or internal Dependencies

#333

## Description Create members and capture errors per row with correct CSV line numbers. **Tasks:** - [ ] Implement `process_chunk/3` in service: - Input: `[{csv_line_number, row_map}]` - Validate + create sequentially - Collect counts + first 50 errors (per import overall; LiveView enforces cap across chunks) - [ ] Implement Ash error formatter helper: - Convert `Ash.Error.Invalid` into `%MemberCSV.Error{}` - Prefer field-level errors where possible (attach `field` atom) - Handle unique email constraint error as user-friendly message - [ ] Map row_map to Ash attrs (`%{first_name: ..., ...}`) **Important:** **Do not recompute line numbers** in this layer—use the ones provided by the parser. ## External or internal Dependencies #333
carla added this to the I can import members milestone 2026-01-07 13:52:14 +01:00
carla added the
S
label 2026-01-07 13:52:14 +01:00
carla added a new dependency 2026-01-07 14:01:51 +01:00
carla added this to the Sprint 11: 08.01-29.01 project 2026-01-08 12:54:09 +01: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.

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