Step 2 of the new-campaign wizard previously dropped unpaired contacts
silently (Math.min(contacts, gifts) iteration) — if you uploaded 5
contacts and 3 gift links, you got 3 recipients in the table with no
visible signal that 2 contacts were left out. Step 1 only showed
"contacts skipped: N" in a small banner, easy to miss.
Surface the imbalance explicitly so the user can decide before sending:
Backend (POST /campaigns/parse):
- Return unpaired_contacts[] and unused_gifts[] arrays (with row_index
for source-CSV cross-reference), in addition to the existing
recipients[]. Old leftover_gifts / leftover_contacts counters kept
for backward compat.
UI (CampaignNewPage Step 2):
- New columns in the recipients table:
• # (row index from the source CSVs)
• Lien-cadeau (truncated shortlink, clickable to verify)
These let the user eyeball the contact↔link pairing line by line.
- New counter strip:
Paires / À envoyer / Client lié / Sans client / Sans lien / Liens surplus
- "Sans lien" and "Liens surplus" counters appear only when relevant.
- Explicit warning banner explaining what unpaired/unused means
(acquire more links and re-upload, or proceed knowing N won't get).
- Expansion panel listing each unpaired contact with their row_index +
details, so the user can verify which specific contacts will be
excluded before approving.
- Expansion panel listing each unused gift URL (extra capacity).
- "Approuver" button now shows the exact send count: "Approuver — N à
envoyer". Disabled when 0. Step 3 recap also reflects sendableCount.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>