Skip to content

Commit 52e5069

Browse files
committed
refactor: Refactored variable names
1 parent 49a7753 commit 52e5069

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/main/java/com/f_lab/la_planete/domain/Food.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ public BigDecimal calculateCost(int quantity) {
4949
return price.multiply(BigDecimal.valueOf(quantity));
5050
}
5151

52-
public void minusQuantity(int deductions) {
53-
if (totalQuantity - deductions < 0)
52+
public void minusQuantity(int quantity) {
53+
if (totalQuantity - quantity < 0)
5454
throw new IllegalStateException("수량이 부족합니다. 따라서 구매가 진행될 수 없습니다.");
5555

56-
totalQuantity -= deductions;
56+
totalQuantity -= quantity;
5757
}
5858
}

src/main/java/com/f_lab/la_planete/domain/Voucher.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public BigDecimal apply(BigDecimal totalCost, Currency currency) {
3636
if (ObjectUtils.isEmpty(currency))
3737
throw new IllegalStateException("화페 값이 비어있습니다. 적절히 변경 후 다시 시도해주시길 바랍니다.");
3838

39-
BigDecimal afterDiscounts = BigDecimal.ONE.subtract(discountRate);
40-
return totalCost.multiply(afterDiscounts).setScale(currency.getRoundingScale(), currency.getRoundingMode());
39+
BigDecimal multiplier = BigDecimal.ONE.subtract(discountRate);
40+
return totalCost.multiply(multiplier).setScale(currency.getRoundingScale(), currency.getRoundingMode());
4141
}
4242
}

0 commit comments

Comments
 (0)