Add detailed skip tracking for phone imports

- Track skipped_no_phone and skipped_no_id separately
- Display skip information in admin UI with warning icon
- Clarify that empty phone numbers cannot be imported (PK constraint)
- Update documentation to explain expected skip behavior
- Example: 143 rows without phone numbers is correct, not an error

When importing PHONE.csv with empty phone numbers:
- Rows are properly skipped (cannot have NULL in primary key)
- User sees: '⚠️ Skipped: 143 rows without phone number'
- This is expected behavior, not a bug
This commit is contained in:
HotSwapp
2025-10-13 08:46:53 -05:00
parent 63809d46fb
commit ac98bded69
6 changed files with 26474 additions and 4 deletions

View File

@@ -55,9 +55,23 @@ The function now returns detailed statistics:
- `inserted`: New records added
- `updated`: Existing records updated
- `skipped`: Duplicate combinations within the CSV
- `skipped_no_phone`: Rows without a phone number (cannot import - phone is part of primary key)
- `skipped_no_id`: Rows without an ID (cannot import - required field)
- `errors`: List of error messages for failed rows
- `total_rows`: Total rows in CSV
### Understanding Skipped Rows
**Important**: The `phone` field is part of the composite primary key `(id, phone)`. This means:
- You **cannot** import a phone record without a phone number
- Empty phone numbers will be skipped (this is expected and correct behavior)
- The web UI will display: `⚠️ Skipped: X rows without phone number`
**Example**: If your CSV has 26,437 rows and 143 have empty phone numbers:
- Total rows: 26,437
- Success: 26,294
- Skipped (no phone): 143
- **This is working correctly** - those 143 rows don't have phone numbers to import
## Testing
After deploying this fix:
1. Uploading `PHONE.csv` for the first time will insert all records