Admin: CSV member reconciliation (missing accounts / missing targets)

Open
#61 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
12/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
php
Domain
full-stack

Research direction

Start by settling the open questions: the CSV columns, separator and encoding, the cutoff date, and whether name fallback is wanted. The new endpoint is POST /admin/members/reconcile, and it should be stateless. The existing /admin/users/csvimport is explicitly not the model. The work depends on #57 (upgraded stack) and #51 (inactive users). Done means the listed backend tests pass and the Mitgliederabgleich screen is built.

Written by the indexing model from the issue text.

Description

Backend enhancement Frontend

Goal

Admins upload a CSV of all club members and get a reconciliation report:

  • Missing accounts: every member who is an adult, or turns 18 by the end of the reference cycle, needs an account.
  • Missing target: existing accounts without a target value (Zielstand) for that cycle.

Deviations are allowed. The result is a list of hints the admin can act on or ignore, and nothing is blocked or changed automatically. This is a check, not an import. The old one-off CSV import (/admin/users/csvimport) is not the model for this.

Open questions

  1. CSV columns: proposed Lizenz (matching key, maps to User::license), Vorname, Nachname, Geburtsdatum, optional E-Mail. Which columns does the real export have? Separator and encoding?
  2. Cutoff date: proposed Cycle::toDate of the chosen cycle (default: current).
  3. Fallback: should name matching be a fallback when Lizenz is missing or differs, flagged as uncertain?

Backend

  • POST /admin/members/reconcile (ROLE_ADMIN), multipart CSV plus optional cycle id. It is stateless: the file and birth dates are only processed in memory, never stored or logged.
  • Parse and validate (header check, date format, size limit), with per-row errors such as an invalid birth date or missing key.
  • Response:
    • missingAccounts[]: name, license, turnsAdultOn if they become adult during the cycle
    • missingTarget[]: user IRI, name, license
    • uncertainMatches[]: CSV row ↔ user candidates
    • notInList[]: active accounts not found in the CSV, which ties in with inactive users (#51)
    • rowErrors[]
  • Tests: adult / turns 18 exactly on the cutoff date / turns 18 after it / minor; account present with and without a target; duplicate rows; malformed CSV; non-admin → 403; anonymous → 401.

Frontend

"Mitgliederabgleich" screen under Verwaltung (designed in the redesign mockup):

  1. Upload step with a cycle selector and a privacy note.
  2. Result tabs with info styling (not errors).
  3. Row actions: "Mitglied anlegen" (prefilled), "Zielstand setzen" (single and bulk), "Ignorieren".

Impact

  • Privacy: birth dates are personal data. Not storing them keeps the impact minimal, but this should still be noted in the club's privacy documentation.
  • Data model: none if the file is processed statelessly. Persisting "ignored" decisions would need a small table, so decide whether that is needed.
  • Depends on: #57 (write it against the upgraded stack), and #51 for the "not in list → set inactive" follow-up action.
Dominant language
PHP
Stars
1
Forks
0
Avg merge
7h 58m
Merged PRs (30d)
3

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from RunningJoke/allipunkte

All issues in RunningJoke/allipunkte

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.