Challenge Overview
Challenge Objectives
-
Implement the logic behind the challenge terms based on the requirements below.
Tech Stack
-
Node.js
-
Swagger
-
DynamoDB
-
ElasticSearch
Project Background
In this series of challenges, we will build the version 5 (V5) of the challenge API.
Code Access
Challenge API
Repo: https://github.com/topcoder-platform/challenge-api
Branch: develop
Challenge Processor ES
Repo: https://github.com/topcoder-platform/challenge-processor-es
Branch: develop
You may also have to run the Resources API locally https://github.com/topcoder-platform/resources-api (develop branch)
Detailed requirements
As part of this challenge, you need to implement the logic behind challenge terms the same way they are currently implemented on the legacy codebase (provided on the challenge forum, available after registration).
-
Update all related endpoints to add support for the challenge terms.
-
Update the challenge model to include the terms information (array of objects with the same format of the current API - v4).
-
When creating a new challenge, call the Projects API (http://api.topcoder-dev.com/v5/projects/:projectId) to get the default project terms and associate them with the challenge. The request body may include additional terms (array of IDs) but those that belong by default on the project must be associated with the challenge. If additional terms are provided, they need to be validated and all additional information (role, agreeabilityType, title, url) will be populated using the Terms API (https://api.topcoder.com/v2/terms/detail/:termId).
-
When updating a challenge, do not allow removing any of the default project terms.
-
Update the ES processor so the terms are also being saved in ElasticSearch.
-
Update the Swagger definition to reflect the changes.
-
Make sure all existing tests pass and cover any new code with new tests.
Should you have any questions, feel free to ask on the challenge forum!
What to Submit
Submit a git patch file for the latest commit in the develop branch of each repo.
Make sure to mention the exact commit you used so we can apply your patch without issues.