[Feature] Bulk Transaction Import via CSV and JSON with Validation Engine #578#609
Conversation
Add server- and client-side support for importing transactions from CSV or JSON files. - New controllers/importController.js: parses CSV (via exceljs) and JSON uploads, normalizes fields, validates each record with Joi, checks for duplicates (±60s window), and creates Transaction records. Returns import stats and errors. Supports common amount/date formats and falls back to user's preferred currency. - New public/js/import-modal.js and transactions.html updates: add an Import button, modal UI, client-side validation/preview, and upload flow that posts to /api/expenses/import. Shows success/error messages and triggers a transactions refresh. - routes/expenses.js: register POST /import route using existing upload middleware and requireAuth. - services/fileUploadService.js: add validateFile(file) to enforce allowed mimetypes and 10MB size limit; minor whitespace cleanup. - Add sample test_data.csv and test_data.json templates for testing/import templates. Notes: accepts .csv and .json, enforces file size/type limits, and reports skipped duplicates and validation errors in the response.
🎉 Thanks for the PR, @rishabh0510rishabh!We really appreciate you taking the time to contribute to ExpenseFlow! 💙 ⭐ Love this project?Please give us a star! It helps the project grow and reach more developers! 🌟 🔗 https://github.com/Renu-code123/ExpenseFlow ✅ PR ChecklistBefore we review, please ensure:
🙌 Thank You for Contributing!We truly appreciate your interest in contributing to this project.
We'll review your PR as soon as possible. Keep up the great work! ✨ |
|
@rishabh0510rishabh is attempting to deploy a commit to the Renu's projects Team on Vercel. A member of the Team first needs to authorize it. |
3 similar comments
|
@rishabh0510rishabh is attempting to deploy a commit to the Renu's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@rishabh0510rishabh is attempting to deploy a commit to the Renu's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@rishabh0510rishabh is attempting to deploy a commit to the Renu's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Description
This PR implements the Bulk Import feature, allowing users to upload CSV and JSON files to add multiple transactions at once. This solves the user pain point of manual data entry and facilitates migration from other platforms.
Key Changes
exceljsstreams) and JSON files from memory buffer.POST /api/expenses/importendpoint.Features
Verification
Breaking Changes
Related Issue: #578
Label: ECWoC26