Address join in person export (op-infra Step 11 follow-up)

Context

Op-infra Step 11 shipped three bulk-export endpoints. The original follow-up bundled two sub-items (QC role + address join). The QC role half closed in MR !159: Claims::require_admin_or_quality_control exists in canopy-auth and the three /v1/export/* endpoints all use it. This issue scopes down to the address-join half.

Address join in GET /v1/export/persons

The shipped persons export returns the Person record only — no joined addresses. The plan didn't explicitly require addresses but FOIA / portability requesters typically expect contact info too. Adding the join requires:

  • In FOIA mode: address city + state + zip only (street redacted under personal-privacy carve-out).
  • In portability mode: full address record(s).
  • Multiple addresses per person possible — project as nested array or flatten to one row per address?

Worth a design decision before implementing.

Acceptance criteria

  1. Address join shipped in GET /v1/export/persons with the FOIA / portability projections.
  2. CSV vs JSON shape decision documented for the multi-address case (nested array in JSON; one row per address in CSV is the obvious answer but worth pinning).
  3. Runbook updated.

Out of scope

  • Streaming response shape for large exports (separate concern).

Source

Op-infra plan Step 11; QC-role half closed in MR !159 (2026-05-01).

Edited by Ghost User