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

Reduce mixed currency money #14

Merged
merged 11 commits into from
Sep 29, 2022

Conversation

kaiosilveira
Copy link
Owner

Our Bank class is already able to reduce Money instances with the same currency. This PR expands this implementation to also handle Money instances of different currencies.

Task list:

  • $5 + 10CHF = $10 if rate is 2:1 🎯
  • $5 + $5 = $10 ✅
  • Return Money from $5 + $5
  • Bank.reduce(Money) ✅
  • Reduce Money with conversion ✅
  • Reduce(Bank, String) ✅

Task list:
- $5 + 10CHF = $10 if rate is 2:1 🎯
- $5 + $5 = $10 👈🏼
- Return Money from $5 + $5
- Bank.reduce(Money)
- Reduce Money with conversion
- Reduce(Bank, String)
Task list:
- $5 + 10CHF = $10 if rate is 2:1 🎯
- $5 + $5 = $10 👈🏼
- Return Money from $5 + $5
- Bank.reduce(Money)
- Reduce Money with conversion
- Reduce(Bank, String)
Task list:
- $5 + 10CHF = $10 if rate is 2:1 🎯
- $5 + $5 = $10 👈🏼
- Return Money from $5 + $5
- Bank.reduce(Money)
- Reduce Money with conversion
- Reduce(Bank, String)
Task list:
- $5 + 10CHF = $10 if rate is 2:1 🎯
- $5 + $5 = $10 👈🏼
- Return Money from $5 + $5
- Bank.reduce(Money) ✅
- Reduce Money with conversion
- Reduce(Bank, String)
Task list:
- $5 + 10CHF = $10 if rate is 2:1 🎯
- $5 + $5 = $10
- Return Money from $5 + $5
- Bank.reduce(Money) ✅
- Reduce Money with conversion 👈🏼
- Reduce(Bank, String)
Task list:
- $5 + 10CHF = $10 if rate is 2:1 🎯
- $5 + $5 = $10
- Return Money from $5 + $5
- Bank.reduce(Money) ✅
- Reduce Money with conversion 👈🏼
- Reduce(Bank, String)
Task list:
- $5 + 10CHF = $10 if rate is 2:1 🎯
- $5 + $5 = $10
- Return Money from $5 + $5
- Bank.reduce(Money) ✅
- Reduce Money with conversion 👈🏼
- Reduce(Bank, String)
Task list:
- $5 + 10CHF = $10 if rate is 2:1 🎯
- $5 + $5 = $10
- Return Money from $5 + $5
- Bank.reduce(Money) ✅
- Reduce Money with conversion 👈🏼
- Reduce(Bank, String)
Task list:
- $5 + 10CHF = $10 if rate is 2:1 🎯
- $5 + $5 = $10
- Return Money from $5 + $5
- Bank.reduce(Money) ✅
- Reduce Money with conversion 👈🏼
- Reduce(Bank, String)
Task list:
- $5 + 10CHF = $10 if rate is 2:1 🎯
- $5 + $5 = $10
- Return Money from $5 + $5
- Bank.reduce(Money) ✅
- Reduce Money with conversion 👈🏼
- Reduce(Bank, String)
Task list:
- $5 + 10CHF = $10 if rate is 2:1 🎯
- $5 + $5 = $10 ✅
- Return Money from $5 + $5
- Bank.reduce(Money) ✅
- Reduce Money with conversion ✅
- Reduce(Bank, String) ✅
@kaiosilveira kaiosilveira force-pushed the chapter14/reduce-money-of-different-currencies branch from 47001c3 to b95f324 Compare September 29, 2022 16:28
@kaiosilveira kaiosilveira merged commit 73df2eb into main Sep 29, 2022
@kaiosilveira kaiosilveira deleted the chapter14/reduce-money-of-different-currencies branch September 30, 2022 16:05
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.

1 participant