-
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 : 티켓 타입 기획 수정 반영 #339
Conversation
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.
오 지불 타입 아이디어좋네요!
저도 바꿀게 많이 줄었네요 덕분에 감사합니두둥!
if (!this.type.equals(TicketType.APPROVAL)) { | ||
throw InvalidTicketTypeException.EXCEPTION; | ||
} | ||
if (this.accountNumber == null || this.accountNumber.isBlank()) { |
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.
StringUtils isEmpty 있을거에요!
|
||
private String value; | ||
|
||
@JsonValue private String kr; |
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.
이러면 스웨거엔 한글로 뜰텐데
입력받을 땐 DUDOONG_TICKET
이렇게 입력받아야 하지않나염?
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.
ㅇㅇㅇ 근데
이러면 클라이언트가 한글로 입력하면 변환되나?
내려주는건 한글인데
스웨거 스키마 가면 죄다 한글이라서 뭐로 입력해야하는지 모르자넹
한글로 입력받을 수 있나? JsonCreater 같은걸로
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.
아 그렇게 하면 받아짐? 굿굿 잘했넹 ㅇㅋㅇㅋ
if (this.payType.equals(TicketPayType.DUDOONG_TICKET)) { | ||
if (!this.type.equals(TicketType.APPROVAL)) { | ||
throw InvalidTicketTypeException.EXCEPTION; | ||
} | ||
if (this.accountNumber == null || this.accountNumber.isBlank()) { | ||
throw EmptyAccountNumberException.EXCEPTION; | ||
} | ||
} | ||
// 유료티켓은 무조건 선착순 + 제휴 확인 + 1000원 이상 | ||
else if (this.payType.equals(TicketPayType.PRICE_TICKET)) { | ||
if (!this.type.equals(TicketType.FIRST_COME_FIRST_SERVED)) { | ||
throw InvalidTicketTypeException.EXCEPTION; | ||
} | ||
if (!isPartner) { | ||
throw InvalidPartnerException.EXCEPTION; | ||
} | ||
if (this.price.isLessThan(Money.wons(1000))) { | ||
throw InvalidTicketPriceException.EXCEPTION; | ||
} | ||
} | ||
// 무료티켓은 무조건 0원 | ||
else { | ||
if (!this.price.equals(Money.ZERO)) { | ||
throw InvalidTicketPriceException.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.
TicketPayType 이넘안에서
메소드 하나 만들고 각 이넘 값마다 ( 두둥티켓 , 무료 티켓 , 유료티켓
오버라이딩을 밸리데이션을 안에서 해버리면
더 깔끔할것같긴해요
레퍼런스
- https://github.com/Gosrock/DuDoong-Backend/blob/dev/DuDoong-Api/src/main/java/band/gosrock/api/common/aop/hostRole/HostQualification.java
- https://github.com/Gosrock/DuDoong-Backend/blob/dev/DuDoong-Domain/src/main/java/band/gosrock/domain/domains/order/repository/condition/AdminTableSearchType.java
근데 이건뭐 자율입니당
참고요! 안바꿔도 됨
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.
이부분은 좀 더 고민을 해보겠숩니당!
if (!isPartner) { | ||
ticketItem.validateTicketPrice(); | ||
} | ||
|
||
ticketItem.validateTicketPayType(isPartner); |
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.
굿 잘 집어넣으셨네용
Kudos, SonarCloud Quality Gate passed! 0 Bugs |
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.
LGTM 👍
개요
작업사항
두둥티켓 타입 추가
기존 ticketType -> approveType
새로운 지불타입 -> payType 으로 네이밍
TicketType(현 승인타입) 은 결제, 발행티켓 등 쓰이는 곳이 많아서 최대한 네이밍 안건드리고,
클라이언트 쪽에서 헷갈리지 않을 정도로만 처리했습니다.
결과
재고 공개 옵션 입력값 추가
변경로직