Register
Submit a solution
The challenge is finished.

Challenge Overview

Challenge Objectives

  • Allow the flags and code attribute on the country model to be updated

  • Fix the tests

 

Project Background

The lookup api aims to provide an api to be used across Topcoder’s front end apps that provide a consistent set of results for actions such as looking up countries, educational institutions and others.

 

We have two apps involved here:

  • Lookup API, which interfaces with Dynamodb as well as Elasticsearch. While the Elasticsearch is for GET requests only, Dynamodb is used for everything.

  • Lookup Processor, which listens for events generated by Lookup API and updates Elasticsearch.

A simple workflow here would be where a user would create a new Country, that gets stored in DynamoDB (Lookup API) and then the created data is picked up the Lookup Processor and stored in Elasticsearch.

 

Technology Stack

  • Nodejs version 10

  • Elasticsearch version 7

 

Code access

You can find the existing code for lookup api here. Use the develop branch as your base branch.

 

You can find the existing code for lookup processor here. Use the develop branch as your base branch.

 

Both apps are in scope for this contest.

 

Individual requirements

Allow the flags and code attribute on the country model to be updated (Major Requirement)

  • We enhanced the country model with 2 attributes - countryFlag and countryCode

  • However, we did not allow updates to these attributes, for both PUT and PATCH requests. Kindly allow these attributes to also be updated

  • You have to verify that the lookup processor is also able to support this

 

Fix the tests (Major Requirement)

  • You can rewrite the tests for the lookup api but we are expecting the following:

    • The tests should not be making actual api requests. You need to use nock or sinon.

    • The tests should not delete the entire database (or alternatively have a dedicated test only database) but only work on the data that it has created / is responsible for

  • Considering that you are interacting with kafka and elasticsearch, you can check out the submission api tests as reference on how to write these tests.

  • You have to carry this out for both unit and e2e tests. Your code coverage should be more than 80%

  • Additionally, for the two new attributes in the country model, we don’t have any tests implemented. You need to implement it too.

  • For the lookup processor, you need to check if any updates are needed to the tests, particularly for the two new attributes in the country resource and implement the tests

 

Deployment guide and validation document

Update the deployment guide as needed

 

Important Notes

  • Follow existing conventions used in the app(s)

  • Ensure there are no lint errors in both the apps

  • The submission api tests are only provided as reference. Also, note that submision api uses generators, but you are expected to use async await pattern



Final Submission Guidelines

Submit a git patch for both lookup api and lookup processor

 

ELIGIBLE EVENTS:

2020 Topcoder(R) Open

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30103927