feat(elections): admin voter roll CSV import and token generation
Open
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 33
- Forks
- 104
- Avg merge
- 12h 3m
- Merged PRs (30d)
- 10
Description
Summary
Let admins upload a voter roll CSV and generate one-time voting tokens for each voter.
Part of #1933.
Requirements
- CSV upload UI on the election detail page (columns: email, name)
- Validate CSV: unique emails, valid email format, row count limits
- Preview imported rows before committing
- Generate a cryptographically random token per voter, store only the salted hash
- Provide a "regenerate token" per-voter action (invalidates the previous hash, records audit entry)
- Provide a "revoke voter" action that invalidates the token without deletion (audit-preserving)
- Support appending additional voters to an already-imported roll
- Download a CSV of invited voters with status (invited/voted/revoked) — no tokens included
- All voter-roll mutations write to the audit log
Context
- Epic: #1933
- Depends on the Convex schema issue and admin UI issue
Implementation notes
- Tokens: 32 bytes of randomness, base64url-encoded → stored as sha256(salt + token) in `voterTokens.tokenHash`
- Plaintext token is only ever in the email that gets sent and the URL the voter clicks; server stores the hash
- Large imports should stream rows to avoid Convex mutation size limits
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.