Topcoder - Create Challenge Fee Management APIs For Billing Accounts

Register
Submit a solution
The challenge is finished.

Challenge Overview

Previously, we have logic about managing challenge fee for billing account in direct app, you can check https://github.com/appirio-tech/direct-app/tree/dev/src/java/main/com/topcoder/direct/services/view/action/accounting

For this challenge, we'd like to convert the logic to API style.

1. Create Challenge Fee For A Billing Account - POST /v3/billing-accounts/{billingAccountId}/fees
This will create the challenge fees for the given billing account, there are two types of configuration
- Fixed Challenge Fee
-  Member Cost Percentage Based Challenge Fee

see https://cl.ly/0H3s3H3F3l2I

the logic should similar to https://github.com/appirio-tech/direct-app/blob/dev/src/java/main/com/topcoder/direct/services/view/action/accounting/CreateContestFeesAction.java, but no need to call  DirectUtils.updateBillingAccountDirectProjectsBugContestFees

If there are fees already configured for the given billing account, should return proper error.

2.Update Challenge Fee For A Billing Account - PUT /v3/billing-accounts/{billingAccountId}/fees 

This will update the challenge fees for the given billing account similar as creation.

If there is no challenge fees configured for the gievn billing account, proper error should be returned.

the logic should similar to https://github.com/appirio-tech/direct-app/blob/dev/src/java/main/com/topcoder/direct/services/view/action/accounting/CreateContestFeesAction.java, but no need to call  DirectUtils.updateBillingAccountDirectProjectsBugContestFees

3. Get Challenge Fee For A Billing Account - GET /v3/billing-accounts/{billingAccountId}/fees

This will return the challenge fees for the given billing account that is previously set.

4. The above three endpoints will only be available to administrator now.

About Implementation

- The change should be applied to the dev branch of https://github.com/topcoder-platform/tc-billing-account-service
- You can reuse or mimic the implementation in  client_project_entities_dao component but only limited to the DAO implementation, not EJB3 implementation.
- swagger.yaml should be properly updated to describe the new APIs.



 

Final Submission Guidelines

- Code Changes
- Verification Steps with Postman Scripts
- Updated swagger.yaml file

ELIGIBLE EVENTS:

2018 Topcoder(R) Open

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30059282