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

[DEPLOYMENT] 입찰 시, 입찰자 필터링에 auctionUuid 추가 #212

Merged
merged 2 commits into from
Jun 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ private void isBiddingPossible(OfferBiddingPriceDto offerBiddingPriceDto, RoundI
log.info("입찰 시간 통과");

// 조건2. 해당 라운드에 참여 여부
checkBiddingRound(offerBiddingPriceDto.getBiddingUuid(), offerBiddingPriceDto.getRound());
checkBiddingRound(offerBiddingPriceDto.getAuctionUuid(), offerBiddingPriceDto.getBiddingUuid(),
offerBiddingPriceDto.getRound());
log.info("현재 라운드에 참여한 적 없음");

// 조건3. 남은 인원이 1 이상
Expand All @@ -208,8 +209,9 @@ private void isBiddingPossible(OfferBiddingPriceDto offerBiddingPriceDto, RoundI
log.info("라운드 및 입찰가 통과");
}

private void checkBiddingRound(String biddingUuid, int round) {
if (auctionHistoryRepository.findByBiddingUuidAndRound(biddingUuid, round).isPresent()) {
private void checkBiddingRound(String auctionUuid, String biddingUuid, int round) {
if (auctionHistoryRepository.findByAuctionUuidAndBiddingUuidAndRound(
auctionUuid, biddingUuid, round).isPresent()) {
throw new CustomException(ResponseStatus.ALREADY_BID_IN_ROUND);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public interface AuctionHistoryRepository extends MongoRepository<AuctionHistory

List<AuctionHistory> findByAuctionUuidAndRoundOrderByBiddingTime(String auctionUuid, int round);

Optional<AuctionHistory> findByBiddingUuidAndRound(String biddingUuid, int round);
Optional<AuctionHistory> findByAuctionUuidAndBiddingUuidAndRound(String auctionUuid, String biddingUuid, int round);

Optional<AuctionHistory> findFirstByAuctionUuidOrderByBiddingTimeDesc(String auctionUuid);
}
Loading