-
Notifications
You must be signed in to change notification settings - Fork 6
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
refactor : order,cart 에러 문서화, 세세한 검증 추가 #231
Conversation
public void validPurchaseLimit(Long quantity) { | ||
if (this.purchaseLimit < quantity) { | ||
throw TicketPurchaseLimitException.EXCEPTION; | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sanbonai06 민준아 근데 아이템 구매 갯수 제한 이것도 검증 되었남?
내쪽에서도 하긴하는데 너쪽에서도 추가검증 해도좋을듯
import band.gosrock.domain.domains.event.exception.EventIsNotOpenStatusException; | ||
import band.gosrock.domain.domains.event.exception.EventTicketingTimeIsPassedException; | ||
import band.gosrock.domain.domains.ticket_item.exception.TicketItemQuantityLackException; | ||
import band.gosrock.domain.domains.ticket_item.exception.TicketPurchaseLimitException; | ||
|
||
@ExceptionDoc | ||
public class CreateCartExceptionDocs implements SwaggerExampleExceptions { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
에러 문서화 확인!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다~~~!
/** 모든 질문지 ( 옵션그룹 )에 응답했는지 검증합니다. ( 변화 했는지 검증 ) */ | ||
public void validOptionNotChange(Order order, TicketItem item) { | ||
List<OrderLineItem> orderLineItems = order.getOrderLineItems(); | ||
List<Long> itemsOptionGroupIds = item.getOptionGroupIds(); | ||
orderLineItems.forEach( | ||
orderLineItem -> { | ||
if (!Objects.equals( | ||
getAnswerOptionGroupIds(orderLineItem), itemsOptionGroupIds)) { | ||
throw OrderItemOptionChangedException.EXCEPTION; | ||
} | ||
}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
옵션이 변화했는지 검증로직은 일단 추가해뒀습니당!
public DuDoongCodeException 티켓팅_시간지남 = EventTicketingTimeIsPassedException.EXCEPTION; | ||
|
||
@ExplainError("티켓 아이템이 한 종류가 아닐 떄") | ||
public DuDoongCodeException 아이템은_한종류여야함 = CartInvalidItemKindPolicyException.EXCEPTION; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
지극히 개인적인 의견인데 CartInvalidItemKindPolicyException라는 워딩에서 티켓 아이템이 한 종류가 아닐 떄 발생하는 오류라는 직관적인 설명이 조오오금 덜 와닿는 것 같아요! NotOneItem~~이런식의 워딩도 좋은 것 같습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아 옛날에 만들어뒀던건데 수정할게유! 네네 그워딩이 좋아유
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
옵션 그룹 변경 검증로직 추가로 동시성 문제 해결한 부분 잘 봤습니당
티켓상품 삭제의 경우는 query수정으로 해결해볼게유
LGTM🌱
Kudos, SonarCloud Quality Gate passed! 0 Bugs |
개요
작업사항
변경로직