lighthouse-na / skillharbor

Set sail with SkillHarbor, your compass for navigating the seas of skills within your organization. Seamlessly audit, map, and cultivate the diverse talents that propel your team to new horizons. Chart a course for success with SkillHarbor - where skills find their true north.
2 stars 5 forks source link

Feature Request: Export Report Functionality (CSV) #91

Open hpmouton opened 5 days ago

hpmouton commented 5 days ago

Feature Request: Export Report Functionality (CSV)

Issue Title: Add Export Report Functionality to Skills Audit Application

Issue Type: Feature Request

Description:
We need to implement the report export functionality in the Skills Audit tool. The feature will allow users (HR and Managers) to export employee skills data, including ratings and competency levels, in CSV format. The report should include the following columns:

Components:

  1. Frontend:

    • Create a new button on the report page for exporting data to CSV (Export to CSV button).
    • Ensure the button is only visible to authorized users.
    • Add a download link that triggers the CSV generation.
    • Apply UI feedback (loading spinner, success/failure notifications).
  2. Backend:

    • Create an API endpoint (GET /api/reports/export/csv) to handle the export request.
    • Query the database to fetch relevant employee, skill, and rating data based on filters (e.g., department, JCP).
    • Format the data into CSV.
    • Return the CSV as a downloadable file in the API response.

Acceptance Criteria:

  1. A new Export to CSV button is visible on the frontend report page.
  2. When the button is clicked, a CSV file with the required columns is generated and downloaded.
  3. Backend API processes the request, fetches data, and returns a properly formatted CSV file.
  4. CSV export should handle large datasets efficiently.
  5. CSV content should match the filters applied on the report page (e.g., specific department or competency profile).

Dependencies:

Task Breakdown:

  1. Frontend:

    • [ ] Design the Export to CSV button and integrate it into the report page.
    • [ ] Handle API call to the backend to fetch data.
    • [ ] Add notifications for success/failure and loading states.
    • [ ] Implement download functionality for the CSV file.
  2. Backend:

    • [ ] Create API route and controller for CSV export.
    • [ ] Query the database for relevant employee skills data.
    • [ ] Implement CSV generation logic (using PHP’s fputcsv or a library like League\Csv).
    • [ ] Return the CSV file in the response for download.

Additional Information: