Key Information

Register
Submit
The challenge is finished.

Challenge Overview

Cloud Hub wants to build another reporting endpoint to provide data for our dashboard. This API will give a list of categories and apps that has the most spend data We will use this data to build a calendar of applications and the dates they renewal their service.

Project Overview
Cloud Hub is trying to help their client solve the problem of knowing what software applications they are spending the most money on over time. Cloud Hub will take in data from credit cards and other sources and attempt to show what software the client has purchased and who is using the applications the most.

Requirements
1. Build new endpoint called /companies/{id}/reporting/categories, add to swagger document and include roleAccess similar to existing API endpoints
2. Update swagger definition for /companies/{id}/reporting/{type}, type can be replaced with renewals.
3. Build logic behind reporting endpoint.
    a. It should return the top 5 categories based on the data in companyApps.spend.
    b. If there are more than 5 categories, the 5th category should be called "Other" and all other apps are placed inside.
    c. Use JSON schema below.
4. Build tests to prove logic works are described above.

[{
    "category": "CRM & Related",
    "spend": 1800000,
    "apps": [{
        "id": "{{_id}}",
        "appLabel": "Hubspot",
        "appDomain": "hubspot.com",
        "spend": 42000
    }, {
        "id": "{{_id}}",
        "appLabel": "Salesforce",
        "appDomain": "salesforce.com",
        "spend": 85000
    }]
}]

Final Submission Guidelines

1. Any additions or modifications to the code project pass on "npm run lint". Any modifications to the base project needs to pass the tests, npm run test.
2. Provide your code and documentation in a single zip file. Please include a git patch for easier integration of changes.
3. The bulk of your documentation should be in the Readme.md and you should assume that this will be open source so make sure you cover all the steps to set up,  If you have specific information that should not be included in a public readme (like links to your video) put them in a file called submission.txt and they will be omitted from the project if it is open sourced.

ELIGIBLE EVENTS:

2016 TopCoder(R) Open

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30054838