Skip to content

Commit

Permalink
Updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kamil.jedrzejuk committed Oct 8, 2024
1 parent 9e8ea6b commit 2ee37f5
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,21 +117,6 @@ class Account private constructor(
)
}

fun exchangeUsdToPln(amountUsd: Money, exchangeRate: ExchangeRate) {
require(!amountUsd.isZero()) {
throw InvalidAmountException("Amount must be greater than 0")
}
require(amountUsd <= balanceUsd) {
throw InsufficientFundsException(
"Insufficient USD balance",
)
}

val amountPln = Money(exchangeRate.convertToPln(amountUsd.amount), "PLN")
balanceUsd -= amountUsd
balancePln += amountPln
}

private fun addEvent(event: AccountEvent) {
events.add(event)
}
Expand Down

0 comments on commit 2ee37f5

Please sign in to comment.