Challenge Overview

Competition Task Overview

Financial Analysis App consists of a series of screens that allow users to enter various aspects of cost (data entry screens) and in the final screens show comparison using Stacked Column chart.

The purpose of this challenge is to build the REST api for the app. Basically we need to build a REST API that can serve resources as shown in Sample JSON.json file, but you need to pay attention to the following:
1. All endpoints defined in the sample json file are in scope of this challenge.
2. externalID, userID and ssoToken will be used when we do integration with other systems later. In this challenge it's enough if the API accepts them and make them available for use in the code. Logging the parameter using something like
System.Diagnostics.Debug.WriteLine("SomeText") is enough.
3. 
Please double check the database schema and make sure it covers all fields from the sample json. You'll need to complete the schema if it's missing some fields.
4. T
otalValues at bucket level and values at lineItem level are mutually exclusive. If the user enters value directly at total level, all line items lose their values and vice versa. In the prototype we added a confirmation dialog around this functionality, trying that will help you understand this better. If the user updates values at top level, API will send empty values object at lineItem level during a PATCH. Note that, there is not GET endpoint at bucket or lineItem level. The only way to ask REST API to send lineItems and buckets is by doing a GET on analysis resource.
5. Reset wipes all data entered for that analysis allowing users to start with a clean slate. Update updates the line items/buckets sent in request body. By wiping we mean all user entered values will be removed; totalValues at bucket level, values at lineItems level and MyNotes will be deleted leaving only the skeleton rows. That's do an UPDATE on AnalysisBucket and AnalysisLineItem instead of DELETE of these tables.
6. At backend level we want to store only the values the user entered. For example, let's say user enters a value into YEARLY column; then, MONTHLY & % are calculated by the system (UI). In this case, we want only to send YEARLY to the backend. In short, by analyzing backend data, we would like to be able to say which column users entered most often. I assume this will need to be handled by both the frontend and the API.
7. The quote is read-only for this REST API is concerned. Assume data is available in the db. A different process will put the values in there.
8. Buckets should be stored in one or more “master” lookup tables that is used application-wide. Analysis should only store FK to bucket/lineItems along with values either at bucket or lineItem level. Roughly, please see SchemaDesign.pdf for the database schema.

Testing

Unit test are required for the API. Please use Visual Studio Testing Framework for this.

Technology Overview

ASP.NET Web API
Entity Framework (latest version)
C# 5.0+
SQL Server 2012 compatible scripts
Visual Studio 2015



Final Submission Guidelines

1. Code that implements the REST API
2. Complete Database Schema (sql script)
3. Unit Tests
4. Readme in markdown format with details on how to configure, deploy and test the code

ELIGIBLE EVENTS:

2016 TopCoder(R) Open

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30054706