feat: Contact Import — CSV/Excel with column mapping and duplicate detection#156
feat: Contact Import — CSV/Excel with column mapping and duplicate detection#156Systemsaholic merged 6 commits intomainfrom
Conversation
ContactImportService with duplicate matching (email → name+DOB → name), ownership rules, fill-only merge, multi-match resolution. POST /contacts/import/preview and POST /contacts/import/confirm. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…hooks React Query mutations following the cruise booking import pattern. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Column auto-detection, date/phone/country normalization, CSV/Excel parsing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Column mapping UI with auto-detected defaults, override dropdowns, and tag input for import tagging. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Preview table with per-row selection, disposition coloring, and action dropdowns for possible_match rows. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4-step wizard: Upload → Column Mapping → Preview → Import. Import button added to contacts page header. Also fixes pre-existing strict-mode type errors in parse-contacts, column-detection, and normalize-contacts (non-null assertions for regex capture groups and array accesses). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
📝 WalkthroughWalkthroughThis PR introduces a comprehensive contacts import workflow for the admin panel and backend. The changes include a multi-step import wizard UI (file upload → column mapping → preview → results), file parsing for CSV/Excel, data normalization utilities, duplicate detection and contact merge logic, and corresponding API endpoints for preview and confirmation phases. Changes
Sequence Diagram(s)sequenceDiagram
participant User as User
participant Wizard as Import Wizard
participant Admin as Admin Frontend
participant Preview as Preview API
participant Service as Import Service
participant DB as Database
User->>Wizard: 1. Upload file + map columns
Wizard->>Admin: Parse & normalize rows
Admin->>Admin: Auto-detect mapping
User->>Wizard: 2. Review preview & select actions
Wizard->>Preview: POST /contacts/import/preview
Preview->>Service: preview(rows, auth)
Service->>DB: Query duplicates (email, name+DOB, name)
DB-->>Service: Match candidates
Service-->>Preview: Dispositions (new/update/possible_match/skip)
Preview-->>Admin: Preview results with summary
Wizard->>Wizard: Display preview table with action dropdown
User->>Wizard: 3. Confirm import & assign tags
Wizard->>Wizard: Collect row actions & selected tags
Wizard->>Preview: POST /contacts/import/confirm
Preview->>Service: confirm(rows, tags, auth)
Service->>DB: Create new contacts
Service->>DB: Merge (fill-only) existing contacts
Service->>DB: Assign tags to contacts
DB-->>Service: Success/error per-row results
Service-->>Preview: Confirmation summary & errors
Preview-->>Admin: Import complete with statistics
Admin-->>User: Display results dialog
Estimated code review effort🎯 4 (Complex) | ⏱️ ~70 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Full contact import system: upload CSV/Excel files, map columns to Tailfire fields, preview with duplicate detection, import with auto-tagging and ownership rules.
Backend (706 lines)
POST /contacts/import/preview+POST /contacts/import/confirmFrontend
New Dependencies
papaparse+@types/papaparse— CSV parsingxlsx(SheetJS) — Excel parsingTest plan
🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes