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

  • 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 make the following changes on the challenge API, the ES processor as well as the legacy challenge migration script:

 
  1. Both apps: Rename the `isActive` property to `isOpen`.

  2. Challenge API: Create a new model that will be used to associate ChallengeTypes with TimelineTemplates. Create CRUD endpoints (/challengeTimelines) for that new model. For READ, we just need `get all` with support for filtering based on the challenge type ID or timeline template ID.

  3. Challenge API: Remove the `predecessor` property from the Phase model and update all related endpoints. This property should only exist in phases associated with a challenge (Challenge.phases). Add a new `typeId` property (required) which is an auto-generated UUID.

  4. Challenge API: Update all related endpoints that create/update challenge phases (phases that belong to a challenge) so only the `typeId` and the duration are passed and all other fields are populated/calculated by the API. You also need to update all existing validation that currently happens for phases.

  5. Challenge API: In the phase object that’s associated with a challenge (Challenge.phases), we need to keep the `predecessor` property that was removed (above requirement) and we also need to add a few new properties.
    1. typeId which is a required UUID. Get it from the actual phase definition.
    2. scheduledStartDate which is a required date (String) and it’s being calculated based on the challenge start date and the duration of each phase.
    3. scheduledEndDate which is a required date (String) and it’s being calculated based on the challenge start date and the duration of each phase.
    4. actualStartDate and actualEndDate that currently behave similarly to the scheduledStartDate/scheduledEndDate fields.

    Create a helper method similar to the Helper.calculateChallengeEndDate to help you calculate the start/end dates.

  6. Challenge API: Update the TimelineTemplate and all related endpoints so the phases array is an array of objects and each object has the following properties:
    typeId: Required UUID, should match to the typeId of an existing phase
    predecessor: Optional UUID, should match to the id of an existing phase
    defaultDuration: Required integer representing the phase duration in seconds.

  7. Both apps: 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.

  8. Challenge API: When creating/updating a challenge (for the update, only if the phases are actually being updated), use the TimelineTempate ID to get the TimelineTemplate and use it to set the `predecessor` property of each phase. Also, if the duration of a phase is not provided, use the `defaultDuration` from the timeline template.

  9. ES Processor: Make sure to update the processor to reflect all the above changes.

  10. Make sure to update the Swagger as well as the POSTMAN collection to reflect all changes.

  11. Update existing tests to pass and make sure to cover all new code with 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.

 


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: 30113051