Skip to main content
Version: MNSR

Excel Data Upload and Validation

Author(s)

  • Arpita Dey
  • Dipak Mourya

Last Updated Date

2025-02-13


SRS References


Version History

VersionDateChangesAuthor
1.02025-02-13Initial draftArpita Dey, Dipak Mourya

Feature Overview

Objective:
This feature allows users to upload Excel files containing data for different categories such as Employee, Department, Designation, Geozone, and Shift. The objective is to validate the uploaded Excel file against the selected format type and perform cell-by-cell data validation before processing.

Scope:

  • Validate Excel file structure against the selected format type.
  • Perform data validation for mandatory fields and data integrity checks.
  • Support for downloading the format template for each data type.
  • Ensure seamless integration with the backend validation API.
  • Provide user feedback for any validation errors.

Dependencies:

  • Excel file parsing library (e.g., ClosedXML)
  • Backend validation API
  • Database for verifying Designation, Department, Geozone, and Shift existence

Requirements

  1. User must select an Excel data format type (Employee, Department, Designation, Geozone, Shift) before uploading.
  2. User can optionally download the format template for the selected type.
  3. If the format is known, the user can directly upload the Excel file.
  4. On clicking the submit button, the system should:
    • Call the validation API to check if the Excel format matches the selected type.
    • Validate data cell by cell if the format is correct.
    • Display error messages for any format mismatches or data validation failures.
  5. Employee Data Validation:
    • Employee code must not be empty.
    • Contact number must not be empty and should be an unique 10-digit number.
    • Employee name must not be empty.
    • UANNumber must not be empty.
    • DesignationName must exist in the system.
    • DepartmentName must exist in the system.
    • GeozoneName must exist in the system.
    • Skill name must exist in the system.
    • Category name must exist in the system.
    • Highest Qualification name must exist in the system.
    • Total experience should be in decimal format.

Design Specifications

  • UI/UX Design:
    alt text

  • Data Models:

    public record ImportEmployeeData
    {
    public string? EmployeeCode { get; init; }
    public string? EmployeeName { get; init; }
    public string? DesignationName { get; init; }
    public string? DepartmentName { get; init; }
    public string? ShiftName { get; set; }
    public string? ContactNumber { get; init; }
    public string? DateOfJoining { get; init; }
    public string? Skill { get; init; }
    public string? Category { get; init; }
    public string? UANNumber { get; init; }
    public string? HighestQualification { get; init; }
    public string? GeoZoneName { get; init; }
    public string? EmailId { get; init; }
    public string? ReportingPersonCode { get; init; }
    public string? EmploymentCardNumber { get; init; }
    public string? DateOfBirth { get; init; }
    public string? NomineeName { get; init; }
    public string? NomineeRelation { get; init; }
    public string? TotalExperience { get; init; }
    public string? ParentName { get; init; }
    public string? EmergencyContactName { get; init; }
    public string? EmergencyContactNumber { get; init; }
    public string? Reference { get; init; }
    public string? Address { get; init; }
    public string? AppointedBy { get; init; }
    }

    public record ImportDepartmentData
    {
    public string? DepartmentName { get; init; }
    }

    public record ImportDesignationData
    {
    public string? DesignationName { get; init; }
    public string? DesignationDisplayName { get; init; }

    }

    public record ImportShiftData
    {
    public string? ShiftName { get; init; }
    public string? ShiftStartTime { get; init; }
    public string? ShiftEndTime { get; init; }

    }

    public record ImportGeozoneData
    {
    public string? GeoZoneName { get; init; }
    public string? Latitude { get; init; }
    public string? Longitude { get; init; }
    public string? Radius { get; init; }

    }

    public enum ExcelFormatType
    {
    Employee,Department,Designation,Geozone,Shift
    }
  • API Interfaces:

    EndpointMethodParametersResponseResponse Status Codes
    /download/formatGETformatTypeExcel file200, 400, 500
    /validate/excelPOSTstring formatType, FormFile excelFileList of string cellNumber,string message200, 400, 500
    /upload/excelPOSTFormFileStatus Code200, 400, 500
  • Third-Party Integrations:

    • ClosedXML for Excel file parsing.
  • Workflow:
    alt text


Development Tasks & Estimates

NoTask NameEstimate (Hours)DependenciesNotes
1API to validate excel data Cell-by-cell5NoneBackend API
2API to import excel data4NoneBackend API
3Create a new page for Bulk-Upload1.5None
4Implement a Stepper Component in the modal and all the UI with excel mapping5None
5Integrate API for excel UploadFormat1On Backend API
6Create a Responsive Table for API Error Handling2On Backend API
7Implement API for Final Submission1On Backend API
8Final Testing1.5None
9Total21

Testing & Quality Assurance

  • Unit Tests:

    • Test file format validation logic.
    • Test individual cell validations (e.g., empty fields, incorrect data types).
  • Integration Tests:

    • Test complete workflow from upload to validation.
  • Acceptance Criteria:

    • Correct error messages are displayed for each validation failure.
    • Only correctly formatted and valid data is accepted.
  • Testing Tools:

    • xUnit for unit and integration testing.

Deployment Considerations

  • Configuration Changes:

  • Rollout Plan:


Risks & Mitigations

RiskImpactLikelihoodMitigation Strategy

Review & Approval

  • Reviewer:
    Ramit Ray, Ayon Das

  • Approval Date:
    2025-02-24

Notes