Skip to content

Commit

Permalink
YEL-183 [feat] code review reflect
Browse files Browse the repository at this point in the history
  • Loading branch information
hyeonjeongs committed Jan 23, 2024
1 parent 573af69 commit 16e4a46
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import com.yello.server.domain.purchase.entity.ProductType;
import com.yello.server.domain.purchase.entity.Purchase;
import com.yello.server.domain.purchase.entity.PurchaseState;
import com.yello.server.domain.purchase.exception.PurchaseNotFoundException;
import com.yello.server.domain.purchase.repository.PurchaseRepository;
import com.yello.server.domain.user.entity.User;
Expand Down Expand Up @@ -92,8 +93,8 @@ public Purchase getEndByStateAndUserId(User user) {
return data.stream()
.filter(purchase -> {
return purchase.getUser().equals(user) &&
purchase.getProductType().equals("yello_plus") &&
purchase.getState().equals("active");
purchase.getProductType().equals(ProductType.YELLO_PLUS) &&
purchase.getState().equals(PurchaseState.ACTIVE);
})
.sorted(Comparator.comparing(Purchase::getUpdatedAt).reversed())
.findFirst()
Expand Down

0 comments on commit 16e4a46

Please sign in to comment.