Topcoder Challenge Service - Update Challenge Detail API To Work With New Challenge Listing Index and Challenge Detail Index

Register
Submit a solution
The challenge is finished.

Challenge Overview

Background

Previously, we have run challenges (see http://www.topcoder.com/challenge-details/30065165/?type=develop&noncache=true for more details) to generate simplified elasticsearch indexes to meet the requirements for challenge listing API and challenge detail API (challenge-listing and challenge-detail indexes).

see listing-detail-indexes branch of elasticsearch feeder service.

- com.appirio.service.challengefeeder.api.challengelisting.ChallengeListingData is the main entity for challenge-listing index.

- com.appirio.service.challengefeeder.api.challengedetail.ChallengeDetailData is the main entity for challenge-detail index.

And the current implementation of Challenge Detail API, it is mainly using the db queries to get the data from informix database.
 

Scope and General Requirements 

For this challenge, we'd like to update the challenge detail api (/v3/challenges/{id}) to read the data from elasticsearch instead of database.

1. The change should be based on mm-features branch of challenge service
2. Use the model (https://github.com/topcoder-platform/tc-elasticsearch-feeder-service/tree/listing-detail-indexes/src/main/java/com/appirio/service/challengefeeder/api) from elasticsearch feeder, including ChallengeListingData and ChallengeDetailData.
2.1 Don't rename the package name, we'd like to extract this model into a separate package, to avoid to reinvent the wheel.
2.2 There are some update for ChallengeListingData class, please incorporate them.
2.3 Add the model classes related to ChallengeDetailData.

3. For a specific challenge, the logic should be changed like 
3.1 Get the corresponding ChallengeListingData from elasticsearch with the challenge id
3.2 Get the correspoding ChallengeDetailData from elasticsearch with the challenge id.
3.3 Populate the corresponding fields for challenge using the data from ChallengeListingData or ChallengeDetailData.
3.4 Principally, all the related data for detail response should be existing in  ChallengeListingData or ChallengeDetailData,
3.5 In case there is any missing, please raised in forum, and use still use DB queries to get the related data, and properly comment in your code, so we can revisit and get these information populated in the challenge-detail index or challenge-listing index.
3.6. Cleanup - please remove useless DAO methods and sql queries, since we will use data from elasticsearch instead. 
4. For testing, please create different type of challenges, like Code, Web Design, Marathon Match challenge type, and make sure the challenge detail api returning the detail response properly.

Local Setup

1. Following https://github.com/appirio-tech/tc-common-tutorials/tree/master/docker/direct-app to run all dependent services

1.1 you need to build from the latest code of direct app (see https://github.com/appirio-tech/tc-common-tutorials/tree/master/docker/direct-app#build-and-run-with-docker-compose)
1.2 also the elasticsearch service should be up, run like (docker-compose up -d elasticsearch)
2. Run the elasticsearch feeder service using mm-features branch, you probably should change the ports (8080, 8081 in src/main/resources/elasticsearch-feeder-service.yaml) due to port conflict.
3. Create some challenges through direct app, so the elasticsearch feeder will get the data populated into elasticsearch and they will be used by challenge service.

Final Submission Guidelines

- Code Changes based on mm-features branch of challenge service
- Setup and Verification Steps

ELIGIBLE EVENTS:

2018 Topcoder(R) Open

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30065752