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

[NT-164] Consume Rewards converted minimum from v1 #830

Merged
merged 6 commits into from
Sep 11, 2019

Conversation

Scollaco
Copy link
Contributor

@Scollaco Scollaco commented Sep 9, 2019

📲 What

  • Shows Rewards converted minimum based on the value of convertedMinimum returned by the API.

🤔 Why

  • This allows us to have one source of truth and avoids the calculation of conversions to be done on the client side.

🛠 How

  • Added a new property convertedMinimum to our Reward model.
  • Changed logic to present the value of that property instead of calculating conversion value based on project conversion rate.
  • Updated tests.

✅ Acceptance criteria

  • iOS and web should show the same values for conversion minimum on Reward cells.

@@ -5,6 +5,7 @@ import Runes

public struct Reward {
public let backersCount: Int?
public let convertedMinimum: Double
Copy link
Contributor

Choose a reason for hiding this comment

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

Is convertedMinimum guaranteed to always be returned? If no conversion is required (ie. project's currency is the same as the user's currency) is the convertedMinimum just the same as the minimum?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exactly

@@ -24,6 +25,7 @@ extension Reward {

public static let noReward = Reward(
backersCount: nil,
convertedMinimum: 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

I know this is just a template, but I think a convertedMinimum would never be 0 🤔 Maybe make this 1 so it's more realistic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I set convertedMinimum to 0 so it matches the minimum. For this template, all properties are either nil or 0.

@Scollaco Scollaco changed the title V1 conversion minimum [NT-164] Consume Rewards converted minimum from v1 Sep 10, 2019
@Scollaco Scollaco merged commit a2638c0 into master Sep 11, 2019
@Scollaco Scollaco deleted the v1_conversion_minimum branch September 11, 2019 15:29
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