fix(platform): normalize xlsx column headers for reliable import#1086
Conversation
…ield matching parseExcelFile now trims and lowercases all record keys from sheet_to_json, so excel mappers no longer need multiple case variants for each field lookup. Fixes product import "No valid product data found" and customer import loading incorrect data when column headers differ in casing. Closes #1040, closes #1054
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis pull request normalizes Excel column header handling during file imports. The file parsing utility now trims whitespace and converts all column headers to lowercase when reading Excel files. The import mappers for vendors, customers, and products are updated to work with these normalized keys, removing fallbacks for alternate key casings. A comprehensive test suite validates that the Excel parsers correctly handle lowercase keys, apply appropriate defaults, enforce required fields, and normalize specific field names like Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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
parseExcelFile— single point of normalizationFixes #1040, fixes #1054
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Tests