Skip to content

Update parameter validation #29

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

Merged
merged 4 commits into from
Mar 30, 2021
Merged

Update parameter validation #29

merged 4 commits into from
Mar 30, 2021

Conversation

pcothenet
Copy link
Contributor

@pcothenet pcothenet commented Mar 30, 2021

What

  • Updates default values for the API
  • Add the renewables project type

Why

  • The allowed query parameter for total_price_cents_usd was incorrect and affecting the Python library. This PR brings all libraries on the same base.

SDK Release Checklist

  • Have you added an integration test for the changes?
  • Have you built the gem locally and made queries against it successfully?
  • Did you update the changelog?
  • Did you bump the package version?
  • For breaking changes, did you plan for the release of the new SDK versions and deploy the API to production?

@pcothenet pcothenet changed the title Update parameters for orders Update parameter validation Mar 30, 2021
expect(create_order_response.data.patch_fee_cents_usd).not_to be_empty
expect(order.id).not_to be_nil
expect(order.mass_g).to eq(order_mass_g)
expect(order.price_cents_usd.to_i).to be_between(expected_price - 1, expected_price + 1)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We added offsets to the project used in this test and it threw things slightly out of bounds.

Because of the rounded nature of the calculation, the new average_price calculation disturbed this test. I am adding a tiny bit of slack to it (+1 / - 1 is small and keep things from bigger deviations)

@pcothenet pcothenet requested a review from biglovisa March 30, 2021 20:12
@pcothenet pcothenet marked this pull request as ready for review March 30, 2021 20:12
@pcothenet pcothenet merged commit 7b154a0 into main Mar 30, 2021
@pcothenet pcothenet deleted the pc/price branch March 30, 2021 20:24
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

Successfully merging this pull request may close these issues.

2 participants