DEV Community

Carlos Estrada
Carlos Estrada

Posted on

Backend challenge #6

Welcome to the 6 challenge of these series of backend development challenge.

Requirements to start the challenge

Before starting this challenge it’s important that you have finish the #5.

About the challenge

In todays challenge you will be in charge of three important task.

  1. Creating the rating endpoint for the employees
  2. Sending an email with information about some employees.
  3. Exporting your data to a excel/csv file.

Rating endpoint

Add a new endpoint with the crud operation for the ratings of the employee. Here is the body that should be recieved by the backend on the post action.

// Example of post
{
    "employee_id": 1,
    "reviewed_by_name": "User 1",
    "reviewed_by": 2,
    "aspects": [
        {
            "score": 66,
            "aspect_reviewed": "team_work",
        },
        {
            "score": 56,
            "aspect_reviewed": "time_managment",
        }
    ]
}
Enter fullscreen mode Exit fullscreen mode

Sending an email

The first part of the challenge focus on sending an email to someone with the next information (you can use mailpit for testing the emails that you send).

[To]: test@test.com # change for whatever you want
[Subject]: Employee <Employee Name> has a new Rating with an average 
score of <avg_score>

[Body]:
The employee <Employee Name> had a new rating by <Reviewed by Name> with an
average score of <avg_score>

Here a list of the aspect reviewed
- <aspect-1> : <score>
- <aspect-2> : <score>
- ....

Enter fullscreen mode Exit fullscreen mode

The email should be send after the creation of the rating

Export data to excel/csv

Add and option to export your employees data as a csv file, this exported data should containt all the information inside the employees table

It’s not necessary to add and endpoint for this, just create a function/class/etc that creates the csv or excel file.

The file name should be employee_name and then the file extension

Conclusion

This all for this 6 challenge of this backend development series

Top comments (0)