diff --git a/src/main/java/com/zufar/icedlatte/cart/api/AddItemsToShoppingCartHelper.java b/src/main/java/com/zufar/icedlatte/cart/api/AddItemsToShoppingCartHelper.java index 10b35468..cbfd56b9 100644 --- a/src/main/java/com/zufar/icedlatte/cart/api/AddItemsToShoppingCartHelper.java +++ b/src/main/java/com/zufar/icedlatte/cart/api/AddItemsToShoppingCartHelper.java @@ -58,13 +58,13 @@ private List createItems(Set itemsToAd Map productsWithQuantity = itemsToAdd.stream() .collect(Collectors.toMap(NewShoppingCartItemDto::getProductId, NewShoppingCartItemDto::getProductQuantity)); - Set existedProductIds = shoppingCart.getItems().stream() + Set existingProductIds = shoppingCart.getItems().stream() .map(ShoppingCartItem::getProductInfo) .map(ProductInfo::getProductId) .collect(Collectors.toSet()); Set newProductIds = productsWithQuantity.keySet().stream() - .filter(productId -> !existedProductIds.contains(productId)) + .filter(productId -> !existingProductIds.contains(productId)) .collect(Collectors.toSet()); return productInfoRepository.findAllById(newProductIds).stream() diff --git a/src/main/java/com/zufar/icedlatte/email/exception/TimeTokenException.java b/src/main/java/com/zufar/icedlatte/email/exception/TimeTokenException.java index 1eeb58cd..a86b7c9c 100644 --- a/src/main/java/com/zufar/icedlatte/email/exception/TimeTokenException.java +++ b/src/main/java/com/zufar/icedlatte/email/exception/TimeTokenException.java @@ -17,9 +17,9 @@ public TimeTokenException(String email, OffsetDateTime expireTime) { private static String buildMessageError(String email, OffsetDateTime expireTime) { StringBuilder stringBuilder = new StringBuilder(); - Duration restTime = Duration.between(OffsetDateTime.now(), expireTime); - long minutes = restTime.toMinutesPart(); - long seconds = restTime.toSecondsPart(); + Duration remainingTime = Duration.between(OffsetDateTime.now(), expireTime); + long minutes = remainingTime.toMinutesPart(); + long seconds = remainingTime.toSecondsPart(); stringBuilder.append("Token for email '").append(email).append("' will be expired after: "); if (minutes != 0) {