Key Information

Register
Submit
The challenge is finished.

Challenge Overview

Project Overview

TopCoder and the TopCoder community have worked hard to get the platform to its currently level of maturity, but we're far from done. It's time to take the platform to the next level. TopCoder is going to start taking some steps to open up the platform API to the outside and community developers so they could incorporate it in their websites, applications or build their own applications (web, mobile or desktop).

The ultimate goal is to open up and build an "API" that is targeting all different type of audiences - Software and Studio Competitors, SRM/MM competitors, Copilots, Admins and TopCoder partners - each audience will have different interests and usages of the API, so it will be a huge project and we need to make sure that we are in the right direction from the beginning.

Competition Task Overview

 Currently, we have provided installation guide for different environments, like CentOS 6.x, Ubuntu, Mac OS and Windows. please check https://github.com/cloudspokes/tc-api/wiki

The updated code must still deploy and work on heroku - any submission which can't be deployed on heroku successfully will be failed in screening phase - primary reviewer must check this.

The implementation will base on the node.js version of TC platform API - https://github.com/cloudspokes/tc-api. Please follow the existing actionhero pattern for your development.

Billing Accounts Permission API

The API will attach existing Billing Accounts with Users.

API Endpoint: /:apiVersion/platform/billing/users

Method: POST

Request:

  • billingAccountId
  • users (the format is "user_handle_1,user_handle_2,user_handle_3")

Response:

  • success or invalid handles

This API would insert into the project_manager table in time_oltp.  

Implementation Notes:

  1. If handle exists in user table,
    • if user doesn't exist in user_account table, we will insert in user_account table
      • user_account_id = create a new sequence to generate the id
      • company_id = 1
      • account_status_id = 1
      • user_name = handle
      • password = not used
      • creation_date = current
      • creation_user = api
      • modifcation_date = current
      • modification_user = api
      • user_status_id = 2
      • user_type_id = 2
      • billable_type = 1
      • insert dummy address/contact, address/contact type is 4 (sample: https://github.com/cloudspokes/tc-api/blob/master/actions/platform.js#L112-L132)
    • then we will insert Billing Detail in project_manager table of time_oltp database linking to that user_account table's record.
      • project_id = billingAccountId (request parameter)
      • payment_rate/cost = 0
      • active = 1
      • creation/modification date = current
      • creation/modification user = api
  2. If handle does not exist in user table, we will return an error message with those handles back as API’s response.
  3. If the list of handles is a mix of valid and invalid handle, we will create records for valid handles based on (1) and return back error for invalid handles as mentioned in above (2)
  4. Rule of insert and delete in project_manager table

    • Use Case 1 - 

      User 1, User 2 handle exist in time_oltp.user and common_oltp.user_account table
      User 3 handle does not exist in common_oltp.user table
      User 4 handle does not exist in time_oltp.user_account table.
      There is no entry of B1 in project_manager table for any user till now.

      Request 1
       Billing B1 - User 1, User 2, User 3 and User 4 
       
       Expected Result -
       insert User 1, B1 - (project_manager)
       insert User 2, B1 - (project_manager),
       insert User 4 in user_account table common_oltp database and
       
       insert User 4, B1 (project_manager)
       Send handle of User 3 in response with some error message.

    • Use Case 2 -
       User 1(also available in last call, User 2(now available) handle exist in time_oltp.user and common_oltp.user_account table
       There is no entry of B2 in project_manager table for any user till now.
       
       Request 2
       Billing B2 - User 1, User 2
       
       Expected Result - 
       insert User 1, B2 (project_manager)
       insert User 1, B2 (project_manager)
       
       Send response of Success message as all handles are inserted.

    • User Case 3 -
       
       User 1, User 2 handle exist in user and user_account table.
       
       Request 3
       Billing B1 - User 1, User 2
       
       We already inserted User1, User 2 in Use Case 1. So project_manager table has aleady billing for B1.
       
       Expected Result -
       Delete all entries for B1 from project_manager table
       Insert new B1, User 1
       Insert new B1, User 2
       
       Send response of Success message as all handles are inserted.

Update API Doc

the apiary.apib  should be updated to describe the updated API.

Standarize Query Naming Convension

we like to use the underscore approach in all SQL queries under the queries directory, please follow same approach.

Notes, for the JSON data returned, we will use camelCase approach.

Testing

The API Framework supports tests. Use supertest with mocha. Don't install mocha globally.

you must use mocha BDD style (which is the default), within that, you can optionally use chai.

Please check Test Creation Guide page in wiki

Code Format

All code must pass jslint. You may use "nomen: true".

Winner Only

Winner will create pull request against the main github repo in final fix phase and help merge with master. The changed files should be unix style, you can use dos2unix command to convert it before commiting.

Virutal Machines (VMs)

VM specific information is found here: http://www.topcoder.com/wiki/display/docs/VM+Image+2.5

Upon registration as a submitter or reviewer you will need to request a VM based on the TopCoder systems image. The VM will be active through aggregation review, after which it will be terminated except for the winner's and the reviewers'. To request your image, please post in contest forum.

Before requesting your VM, you need to ensure that you have an SSH key created and in your member profile. Instructions to do so are here: http://www.topcoder.com/wiki/display/projects/Generate+SSH+Key, and instructions to connect afterwards are here: http://www.topcoder.com/wiki/display/projects/Connect+Using+SSH+Key.

Please realize that VMs are currently issued manually. We make every attempt to issue the VM as soon as it is requested, however, there may be delays of up to 12 hours depending on time of day when you request. We encourage everyone to request a VM as soon as possible to minimize any such delays.



Final Submission Guidelines

Submission Deliverables

Below is an overview of the deliverables:

  • Source Code, be sure to include the commit hash, that your submission based on
  • Deployment guide to configure and verify the application.

Final Submission

For each member, the final submission should be uploaded to the Online Review Tool.

ELIGIBLE EVENTS:

2014 TopCoder(R) Open

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30043590