challenge-api icon indicating copy to clipboard operation
challenge-api copied to clipboard

WIP Billing Account & Markup

Open rootelement opened this issue 3 years ago • 2 comments

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.

rootelement avatar Mar 02 '21 20:03 rootelement