Drone Series - Nearest Drone Distance Updates

Register
Submit a solution
The challenge is finished.

Challenge Overview


When a drone updates it's position in DSP, an array or nearest drones is returned, but the actual distance to between them is not returned. In this challenge, you should do three things:
1. Refactor the DroneService.doUpdateLocation and checkLocation to remove duplicate code.
2. Update DroneService.doUpdateLocation to return an additional distance field for each of the drones in the nearestDrones list. Preferred approach is to get the distance directly fron Mongo.
3. If nearDronesLimit parameter isn't specified, right now the API returns only the nearest drone. Change that so it returns all drones in the radius by default (if nearDronesLimit isn't set)

Make sure the above changes affect these three endpoints
PUT /drones/:id
PUT drones/position/:serialNumber
GET drones/checklocation

 

Use the latest code from the dev branch of the backend repository

Final Submission Guidelines

Submit a git patch for your changes to the base code
Submit a short video demonstrating the implemented features

Review style

Final Review

Community Review Board

Approval

User Sign-Off

Challenge links

ID: 30056158