Skip to content

Commit

Permalink
refactor: 경매 마감 시, round_info 도큐먼트에 endStatus를 true로 저장(#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
chanchanwoong committed Jun 30, 2024
1 parent 2887721 commit 55ad6f3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,17 @@ public void auctionClose(String auctionUuid) {
.price(price)
.build());
log.info("Auction Result Save!");

// round_info 마감됐음을 endStatus에 저장
RoundInfo currenctRoundInfo = roundInfoRepository.
findFirstByAuctionUuidOrderByCreatedAtDesc(auctionUuid).orElseThrow(
() -> new CustomException(ResponseStatus.NO_DATA)
);

roundInfoRepository.save(RoundInfo.builder()
.auctionUuid(auctionUuid)
.endStatus(true)
.build());
}

private MemberUuidsAndPrice getMemberUuidsAndPrice(int round, String auctionUuid, long numberOfParticipants) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@ public class RoundInfo {
private LocalDateTime createdAt;
private LocalDateTime auctionEndTime;
private Boolean isLastRound;
private Boolean endStatus;

@Builder
public RoundInfo(String auctionUuid, Integer round, LocalDateTime roundStartTime, LocalDateTime roundEndTime,
BigDecimal incrementUnit, BigDecimal price, Boolean isActive, int numberOfParticipants,
int leftNumberOfParticipants, LocalDateTime createdAt,
LocalDateTime auctionEndTime, Boolean isLastRound) {
LocalDateTime auctionEndTime, Boolean isLastRound, Boolean endStatus) {
this.auctionUuid = auctionUuid;
this.round = round;
this.roundStartTime = roundStartTime;
Expand Down

0 comments on commit 55ad6f3

Please sign in to comment.