We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
public void submitBid(long auctionId, long price, long quantity) { ZonedDateTime now = ZonedDateTime.now(); // 거래 기준 시간 // 검증 Auction auction = auctionRepository.findById(auctionId) .orElseThrow(() -> new NotFoundException("경매(Auction)를 찾을 수 없습니다. AuctionId: " + auctionId, ErrorCode.A011)); if (!auction.canPurchase(quantity)) { throw new BadRequestException( "해당 수량만큼 구매할 수 없습니다. 재고: " + auction.getStock() + ", " + "요청: " + quantity + ", 인당구매제한: " + auction.getMaximumPurchaseLimitCount(), ErrorCode.A014); } if (!auction.getStatusAt(now).isRunning()) { throw new BadRequestException( "진행 중인 경매에만 입찰할 수 있습니다. 현재상태: " + auction.getStatusAt(now), ErrorCode.A016); } // TODO 구매(입찰) 로직 }
The text was updated successfully, but these errors were encountered:
chhs2131
Successfully merging a pull request may close this issue.
🤔 사전작업
✨ 현재 진행하려는 작업
파라미터로 주어지는 특정 시점을 기준으로 어떤 상태였는지를 반환한다.Auction.getStatusAt 호출 시, 전달되는 requestTime 파라미터가 Null인 경우 -> G001 예외🙋🏻 More
The text was updated successfully, but these errors were encountered: