Topcoder Legacy Challenge Migration Script - Phases Business logic

Key Information

Register
Submit
The challenge is finished.

Challenge Overview

Challenge Objectives

  • Update the logic behind the challenge phases based on the requirements below.

Tech Stack

  • Node.js

  • DynamoDB

  • ElasticSearch

Project Background

In this series of challenges, we will build the version 5 (V5) of the challenge API.

Code Access

Legacy Challenge Migration Script

Repo: https://github.com/topcoder-platform/legacy-challenge-migration-script

Branch: develop

 

You may also have to run the following apps locally: https://github.com/topcoder-platform/resources-api (develop branch)

https://github.com/topcoder-platform/challenge-api (develop branch)

https://github.com/topcoder-platform/challenge-processor-es (develop branch)

Detailed requirements

As part of this challenge, you need to make the following changes on the legacy challenge migration script:

 
  1. Rename the `isActive` property of the phases to `isOpen`.

  2. The `isOpen` property is used to indicate the status of the phase. From `phase_status_lu`, table use the `description` as `phaseStatus` to set its value. If it's 'Open' then `isOpen` should be set to `true` otherwise set to `false`. The `isOpen` property in the Phases model indicates if the Phase can be used or not but the same field in a phase that’s associated with a challenge indicates if a phase is open or not.

  3. Based on the challenge type ID, find the associated timeline template by calling the /challengeTimelines/:typeId endpoint and set the `timelineTemplateId` properly. Currently, there's a `TODO` comment and its default value is `FIX ME`. Let's fix it :)
    This endpoint is currently not implemented. Check the link to the other challenge at the end of this specification to see how this endpoint will work so you can mock it.

  4. The phase duration should be saved in seconds and not in hours. If we have any specific calculations/restrictions, update them to be in seconds instead of hours.

 

We’re running the following challenge in parallel in order to make the required changes in the Challenge API.

https://www.topcoder.com/challenges/30113051/?type=develop

For testing purposes, you may have to mock some endpoints.

 

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.

Make sure to mention the exact commit you used so we can apply your patch without issues.

 


Final Submission Guidelines

Please read above

ELIGIBLE EVENTS:

2020 Topcoder(R) Open

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30113052