Key Information

Register
Submit
The challenge is finished.

Challenge Overview

Previously, we have build the intial version of TC Billing Account Services (https://github.com/topcoder-platform/tc-billing-account-service)

For this challenge, we'd like to add the endpoints for managing clients, beside some logic changes according to database definition.

1. Add Endpoints For Managing Clients

see the api definition by https://github.com/topcoder-platform/tc-billing-account-service/blob/ab98fb8206b0b3a4e579770dee5ac7574efa798c/swagger.yaml#L23-L131

2. Returns more info About Billing Account, like description, poNumber, paymentTerm, subscriptionNumber.

see the api definition by https://github.com/topcoder-platform/tc-billing-account-service/blob/ab98fb8206b0b3a4e579770dee5ac7574efa798c/swagger.yaml#L605-L618

3. For Billing Account Status, please use active field instead of project_status_id field and project_status_lu table.

1 - Active
0 - Inactive

4. use JOIN in sql statement, like 

FROM time_oltp:project p LEFT OUTER JOIN time_oltp:payment_terms pt ON pt.payment_terms_id = p.payment_terms_id

5. Fix Queries By Checking the following reference

https://github.com/appirio-tech/tc-api/blob/master/queries/get_active_billing_accounts
https://github.com/appirio-tech/tc-api/blob/master/queries/insert_billing
https://github.com/appirio-tech/tc-api/blob/master/queries/insert_client_project
https://github.com/appirio-tech/tc-api/blob/master/queries/insert_project_manager
https://github.com/appirio-tech/tc-api/blob/master/queries/insert_user_account
https://github.com/appirio-tech/tc-api/blob/master/queries/update_billing

6. When Adding Billing Account Users, If the tc handle doesn’t exist in the time_oltp:user_account table, then we’ll need to add it before we can create a project_manager record

7. Use hythens for API Path, change "/billingAccounts"  to "/billing-accounts"

8. Update PostMan script to use environment variables, so for testing in different environment, we can easily switch, the main difference is "http://localhost:8080/", like in our internal dev environment it is "https://api.topcoder-dev.com/"

for JWT token, I am not sure if it is possible to use environment variables, if yes, please make it configurable by environment variable too.

9. For Create and Update Billing Accounts Endpoints, let's support more fields, see https://github.com/appirio-tech/tc-api/blob/master/queries/insert_billing, like companyID, description, poNumber, paymentTerms (let's pass id and name as object for understanding, but use id only), salesTax, subscriptionNumber.

For status field, let's use values like Active, Inactive, you can do decode in query `decode (active, 1, “active”, “inactive")`

10. USE time_oltp instead of tcs_catalog database.

so in query, we just need to use client, project, client_project, project_manager, user_account tables directly, instead of like tt_project, time_oltp:user_account.

 

Final Submission Guidelines

- Code Changes
- Updated README.md file and swagger.yaml file.

ELIGIBLE EVENTS:

2017 TopCoder(R) Open

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30056439