DEV Community

Carlos Estrada
Carlos Estrada

Posted on

3 1 1

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

Billboard image

Imagine monitoring that's actually built for developers

Join Vercel, CrowdStrike, and thousands of other teams that trust Checkly to streamline monitor creation and configuration with Monitoring as Code.

Start Monitoring

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay