Implemented a feature that allows users to upload an Excel sheet containing company and contact data. Upon upload, display the data in a table for review and confirmation before storing it in the database.
-
Upload Feature: Allow users to upload an Excel (.xls or .xlsx) file containing data for companies and contacts:
- Company Model:
- Company Name (string, required)
- Company Address (string, optional)
- Company Phone (string, optional)
- Company Email (string, optional)
- Company Website (string, optional)
- Number of Employees (integer, optional)
- Founded Date (date, optional)
- Industry Type (enum: "Technology", "Finance", "Healthcare", "Retail", "Other", required)
- Contact Model:
- Contact Name (string, required)
- Contact Email (string, required)
- Contact Phone (string, optional)
- Date of Birth (date, optional)
- Contact Type (enum: "Primary", "Secondary", "Other", required)
- Company can have multiple contacts.
- Company Model:
-
Displayed Table: Displayed the contents of the uploaded Excel sheet in a table format for user review.
-
Database Storage: Stored the validated data into the database after user confirmation.
-
Data Validation: Validated the uploaded data to ensure it meets the required format and constraints (e.g., data types, mandatory fields).
-
Error Handling: Handling errors gracefully and provide feedback to users in case of invalid data or other issues during the upload process.
- Click on the "Choose File" button and select an Excel (.xls or .xlsx) file.
- Click on the "Upload" button to upload the file.
- Cancel Upload If you want to.
- After uploading, the data from the Excel file will be displayed in a table format.
- Review the data to ensure it is correct.
- If the data is correct, click on the "Upload" button to store the data in the database.
- If there are errors or issues, click on the "Cancel" button to discard the upload.
- If there are any errors during the upload or validation process, appropriate error messages will be displayed.
- Follow the instructions in the error messages to resolve any issues.
- ReactJs is used for the file upload form and table display.
- Express (Node.js) for handling and database storage.
- Database schema for Company and Contact models.
- Sheet names of Excel files should be Company Data and Contact Data
git clone https://github.com/21CEUOS101/shipments_task1