Challenge Overview
A Large IoT and Power Management Company would like to consolidate all of their employee technical competency into a single tool which can be used to track at multiple levels. The goal is to have an application that allows CoE leaders to define roles with their competency requirements, and actions or trainings which prove each competency level. Managers and Directors will be able to track profiles with roll ups of competency in specific sections of the workforce.
In the previous challenge, we created the base code for our backend API and the first set of endpoints covering all endpoints with the tags:
-
Authentication
-
User
-
Competency
-
SubCompetencies
-
Levels
-
Activities
In this challenge, we need your help to create the next set of endpoints as defined in the provided Swagger API definition (attached on the challenge forum, available on registration) and you also need to update some of the logic (see more details in the Detailed Requirements section).
You will work based on the provided starter pack.
Tech Stack Overview
-
Node.js (latest version)
-
Express.js (latest version)
-
MSSQL as DB with Sequelize
Security
All endpoints must be protected and JWT passed in the request header must be used for authentication.
User Roles
-
Leader
-
Director
-
Manager
Detailed Requirements
-
You need to implement all endpoints with the tags:
-
Employee (remove the currentMaturity & expectedMaturity properties from the model)
-
CompletedLevels (Only POST. This will mark all activities that belong to a given SubCompetencyLevel as completed (same funtionality as the POST /employees{EID}/activities endpoint))
-
CompletedActivities
-
Logs
-
-
Add the following (required-string) properties to the Activity model and update all required endpoints to support them: skillAcquired and lifeExperience.
-
Update the GET /competencies/:id endpoint to return 403 FORBIDDEN instead of 404 NOT FOUND if the call was made from a different leader (leader who hasn’t created the competency). Ref: https://gitlab.com/eaton-tech-assessment/backend/issues/1
-
Create both positive and negative POSTMAN tests for the new/updated endpoints.
-
Update the Swagger document where needed and include the latest version in the /docs folder.
-
Update the README with any new details/instructions needed on how to setup and run the app (if they don’t already exist).
General Notes
-
If any of the requirements described in the challenge specification doesn’t match with the Swagger document, you need to follow the challenge specification and update the Swagger to match the specification. If you have any doubt, please confirm in the challenge forum.
-
All POST, PUT & DELETE operations must be logged in a separate table.
-
Users with Director, or Manager role only have access to the /statistics endpoint.
-
All entities must have timestamps (createdBy, createdAt, modifiedBy, modifiedAt).
-
Follow the best practices for creating Node.js API.