Register
Submit a solution
The challenge is finished.

Challenge Overview

This is another challenge in the series for Cloud Hub, where we want to enhance our spending alerts and functionality. Currently their is an API endpoint that creates a document on elasticsearch for the company’s total spend for the month. We want to expand this service to update the spend amount for each app and update the spend per user. Also we want to expand some of the functionality that happens when a charge is added or updated.

 

Add and Update Charge

  1. If appId is null we want to try to automatically match the application. Both of these matches should not be case sensitive.
    1. First we want to try to match charge.sourceChargeName to app.creditCard. If that matches exactly then we want to set the charge.status = A and set appId on the charge.
    2. If we can’t match to app.creditCard, next we want to see if app.appName is within the sourceChargeName. If that name appears within the charge name we want to set the status = P and set appId on the charge.
    3. If either of the match attempts on #1 and #2, we want to set the status of the charge = D.
  2. Next we want to update company.companyApps for any new apps that were found using step 1. If we found a match we want to make sure that app is setup under company.companyApps. If the app hasn’t been created we want to add it with a status = P.

 

Update to /jobs/{apiKey}/spend

  1. Update company.companyApps.spend with total for each app. Any apps that didn’t have charges during that month would get a value of 0. Example: If an app has 2 charges of $49.25 during the previous month, we would sum that to $98.50 and update companyApps.spend.
  2. Update users.spend with a percentage of the total spend per user assigned to all apps. The value for users.spend needs to divide the total number of people assigned to the app and add that value across all apps.


Final Submission Guidelines

  1. Any additions or modifications to the code project pass on "npm run lint" and "npm run test".
  2. Provide your code and documentation in a single zip file.
  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.
  4. Provide a quick video of your solution in action (feel free to annotate your video if you are not comfortable with spoken English or don’t like the sound of your own voice). Video may be private on youtube or added to the submission files.
  5. Please provide a list of files that were modified in submission.txt, or a clean git history.

ELIGIBLE EVENTS:

2016 TopCoder(R) Open

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30053773