Key Information

Register
Submit
The challenge is finished.

Challenge Overview

[Note: This challenge has 24 hrs Review and 12 hrs Appeals Phase]

Challenge Objectives:

In this challenge, we are looking to enhance the Topcode Lookup APIs. Please note work is to be done in the LookupAPI repo (lookup_devices branch)


Individual requirements

We have devices API working in current state on the branch, we need to fix and enhance the impl in this challenge for Devices Lookup API:
  • Currently, when we push new devices, the validation is not done for unique devices. Look at DeviceService.js, for validateDuplicate(). We need to fix so the validation works, do note a unique record is combination of all fields for Device ('type', 'manufacturer', 'model', 'operatingSystem', 'operatingSystemVersion'). Make sure we don't break the impl for other lookups. 
  • Fix Tests, target to have test coverage as close to 100% as possible. 
  • Build a load script we can use to load data to env (dev / test / prod) using the same:
    • Note: The script shouldn't hard-code anything, like which Lookup we are loading data for, for ex: we could use this to load any kind of lookup.
    • The script should work like we have for create-tables/delete-tables, we would like to have command like `npm run load-data --lookup devices --file path-to-devices.json`. For lookup, we should read supported lookup from config (so if user passed in anything other than supported lookups, the command should throw error something like `The lookup (<lookup name user passed>) is not supported` and exit. 
    • The script should check for duplicates, and skip duplicate entires. In the end of script, we should let user know the stats like `Loaded: 100, Duplicates: 20`. Just log an error to console for duplicates (log the json entry for the record so users can go back and refer logs to find which are duplicates). 
    • Note: You can expect there may or may not be data in Lookup already, no requirement that lookup DB will be always clean. 
    • Make sure this script uses complete flow of adding records like creating kafka event for each record like we do via create API right now. 
    • Sample for Devices.json is below (in your submissions, kindly add this json and add few more records so reviewers can run it and test failures too):
[
    {
    "type": "Desktop",
    "manufacturer": "Apple",
    "model": "Macbook Pro",
    "operatingSystem": "OSX",
    "operatingSystemVersion": "10.14"
    },
    {
    "type": "Mobile",
    "manufacturer": "Samsung",
    "model": "Note8",
    "operatingSystem": "Android",
    "operatingSystemVersion": "10.x"
    }
]
  • Build `npm run clean-data --lookup devices` ( this will clean all records in respective lookup)
  • Update swagger and Postman for Devices Lookup - Make sure we have positive and negative scenarios covered like we do for countries. 
  • Note: Most of the code is common and shared for all lookups, so make sure we don't break it and stick to it. 
 
Code Access

The work is to be done in the LookupAPI repo (lookup_devices branch)

 

Final Submission Guidelines

  • Submit a git patch for the repo (lookup_devices branch).

ELIGIBLE EVENTS:

2020 Topcoder(R) Open

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30109411