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

[NAYB-157] feat: 점원은 주문을 확인하고 배달을 생성할 수 있다. #120

Merged
merged 11 commits into from
Sep 21, 2023

Conversation

hseong3243
Copy link
Collaborator

@hseong3243 hseong3243 commented Sep 21, 2023

⛏ 작업 사항

  • 주문을 확인하고 배달을 생성하는 Employee 권한을 추가하였습니다.
  • 결제 완료된 주문 목록 조회 api를 추가하였습니다.
  • 결제 완료된 주문으로부터 배달을 생성합니다.
  • 배달 생성 요청이 동시에 이루어질 수 있기에 배달 생성을 위한 주문 조회 시 비관적 락을 적용하였습니다.
  • 배달이 생성되면 Order의 상태를 PAYED에서 DELIVERING으로 변경합니다.

📝 작업 요약

  • 컨트롤러, 서비스, 리포지토리 메서드 추가 및 테스트 작성

💡 관련 이슈

@github-actions
Copy link

Test Results

375 tests  +11   375 ✔️ +11   10s ⏱️ -1s
185 suites +  5       0 💤 ±  0 
185 files   +  5       0 ±  0 

Results for commit 7313071. ± Comparison against base commit b702a80.


public class AlreadyRegisteredDeliveryException extends DeliveryException {

public AlreadyRegisteredDeliveryException(String message) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public AlreadyRegisteredDeliveryException(String message) {
public AlreadyRegisteredDeliveryException(final String message) {


public record FindPayedOrdersRequest(
@PositiveOrZero(message = "페이지 번호는 음수일 수 없습니다.")
Integer page) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Integer이면 null 값도 들어올 수 있으니 @NotNull을 검증하시는거 어떠신가요??

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

생성자에서 page에 대한 기본값을 정의해주고 있어서 따로 넣지는 않았습니다!


public class UnauthorizedOrderException extends OrderException {

public UnauthorizedOrderException(String message) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public UnauthorizedOrderException(String message) {
public UnauthorizedOrderException(final String message) {

public static FindPayedOrdersResponse of(
List<Order> orders,
int page,
long totalElements) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
long totalElements) {
final long totalElements) {


public record FindPayedOrdersCommand(Long userId, int page) {

public static FindPayedOrdersCommand of(Long userId, int page) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public static FindPayedOrdersCommand of(Long userId, int page) {
public static FindPayedOrdersCommand of(final Long userId, final int page) {

Copy link
Member

@Seongju-Lee Seongju-Lee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!!!

@hseong3243 hseong3243 merged commit 4dfdf9b into develop Sep 21, 2023
1 check passed
@hseong3243 hseong3243 deleted the feature/NAYB-157 branch September 21, 2023 13:02
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants