Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Billing Account & Markup #393

Open
rootelement opened this issue Mar 2, 2021 · 2 comments
Open

WIP Billing Account & Markup #393

rootelement opened this issue Mar 2, 2021 · 2 comments
Assignees

Comments

@rootelement
Copy link
Contributor

rootelement commented Mar 2, 2021

For this issue, we'll implement billing account on the challenge object and then calculate the markup. This challenge depends on the projects api implementing the sfdc billing account markup property.

1. Implement Challenge API

Allow the challenge api to have a billing object:

{
  "billing": {
    "billingAccountId": 20394002,
    "markup": "<float>0.85"
  }
}
  1. Billing Account ID should NOT be required to create a challenge
  2. Billing Account ID SHOULD be required to Activate a challenge
  3. Billing Account should be "Active" when Activating a challenge, otherwise throw an error. Active means if you query the v5 project for the projectId the billing account ID that comes back should match.
  4. The v5 project should be query-able by the jwt - meaning the user should be on the v5 project
  5. GET /challenge and GET /challenges/:uuid should only return the billing object for Admin or m2m

2. legacy-challenge-processor

There is currently a hack where it pulls the billing account id and writes it to the payload, change this to use the billing.billingAccountId

TBD - project update notification

We might need to listen to project update notifications and update the BA/markup. Will confirm.

@ThomasKranitsas
Copy link
Collaborator

ThomasKranitsas commented Mar 4, 2021

Working on https://github.com/topcoder-platform/challenge-api/tree/feature/v5-ba

The flow will be like this:

  • If the billing information is set, we validate and use that
  • If the billing information is not set, we will try to fetch the default from the Projects API

Assumptions:

  1. The billingAccountId is read-only
  2. The markup can be different than what's in the Project info but we default to the one from the project info. (Values from 0 to 100 as it's a percentage)

@ThomasKranitsas
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants