Skip to content

Conversation

@HyemIin
Copy link
Member

@HyemIin HyemIin commented Jul 1, 2025

작업 요약

  • order에 입금자명 추가
  • reservation exception 디렉토리 위치 변경

Issue Link

#41

문제점 및 어려움

해결 방안

Reference

Summary by CodeRabbit

  • 신규 기능

    • 주문 생성 시 예치자 이름(depositorName) 필드가 추가되어 입력 및 응답에서 확인할 수 있습니다.
    • 예치자 이름 길이 검증이 추가되어 10자 초과 시 오류가 발생합니다.
    • 예치자 이름 길이 초과 시 처리하는 새로운 예외가 추가되었습니다.
  • 버그 수정

    • 예약 관련 예외 처리 시 일관된 예외 클래스를 사용하도록 개선되었습니다.
  • 기타

    • 내부 코드 정리 및 패키지 스캔 범위가 확장되었습니다.
    • 일부 불필요한 예외 클래스가 삭제되었습니다.

- order에 입금자명 추가
- reservation exception 디렉토리 위치 변경
@HyemIin HyemIin self-assigned this Jul 1, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jul 1, 2025

"""

Walkthrough

이 변경사항은 예약 관련 패키지의 스프링 컴포넌트 스캔 범위 확장, 주문 생성 DTO 및 엔티티에 예치자명(depositorName) 필드 추가, 주문 생성 응답에 해당 필드 반영, 예외 클래스 위치 및 import 정리, 새로운 예외 처리 추가, 그리고 예약 예외 클래스의 통합 삭제를 포함합니다.

Changes

파일/경로 그룹 변경 요약
application-admin/.../ApiAdminApplication.java 컴포넌트 스캔 패키지 목록에 "com.nowait.reservation" 추가
application-admin/.../reservation/service/ReservationService.java import 순서 정리 (ReservationStatus 위치 이동)
application-user/.../exception/GlobalExceptionHandler.java import 정리 및 ReservationNotFoundException import 경로 변경, DepositorNameTooLongException 예외 처리 메서드 추가
application-user/.../order/dto/OrderCreateRequestDto.java
application-user/.../order/dto/OrderCreateResponseDto.java
domain-order/.../entity/UserOrder.java
depositorName 필드 추가 및 관련 메서드 수정
application-user/.../order/service/OrderService.java 주문 생성 시 depositorName 필드 검증 및 세팅 추가
application-user/.../reservation/exception/ReservationNotFoundException.java ReservationNotFoundException 클래스 삭제
common/.../exception/ErrorMessage.java DEPOSITOR_NAME_TOO_LONG 에러 메시지 상수 추가
domain-order/.../exception/DepositorNameTooLongException.java 새로운 예외 클래스 DepositorNameTooLongException 추가

Sequence Diagram(s)

sequenceDiagram
  participant User as 사용자
  participant Controller as OrderController
  participant Service as OrderService
  participant Entity as UserOrder
  participant DTO as OrderCreateRequestDto/ResponseDto

  User->>Controller: 주문 생성 요청 (depositorName 포함)
  Controller->>Service: 주문 생성 서비스 호출
  Service->>Service: depositorName 유효성 검사
  Service->>Entity: UserOrder 엔티티 생성 (depositorName 세팅)
  Service->>DTO: OrderCreateResponseDto.fromEntity(UserOrder)
  Controller->>User: 주문 생성 응답 (depositorName 포함)
Loading

Possibly related PRs

Suggested reviewers

  • Jjiggu
    """

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7a43ff7 and 2f0b5c2.

📒 Files selected for processing (1)
  • domain-order/src/main/java/com/nowait/order/exception/DepositorNameTooLongException.java (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • domain-order/src/main/java/com/nowait/order/exception/DepositorNameTooLongException.java
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot requested a review from Jjiggu July 1, 2025 08:43
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
application-user/src/main/java/com/nowait/applicationuser/order/dto/OrderCreateResponseDto.java (1)

19-19: 개인정보 노출에 대한 고려사항을 검토해보세요.

depositorName이 응답에 포함되도록 구현되었습니다. 만약 이 API가 public하게 노출되거나 로깅된다면, 개인정보 보호 관점에서 마스킹 처리나 접근 권한 제어를 고려해야 할 수 있습니다.

필요에 따라 depositorName을 마스킹하는 유틸리티 메서드를 고려해보세요:

private String maskDepositorName(String depositorName) {
    if (depositorName == null || depositorName.length() <= 2) {
        return depositorName;
    }
    return depositorName.charAt(0) + "*".repeat(depositorName.length() - 2) + depositorName.charAt(depositorName.length() - 1);
}

Also applies to: 28-28

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 377730f and 40ae847.

📒 Files selected for processing (8)
  • application-admin/src/main/java/com/nowait/applicationadmin/ApiAdminApplication.java (1 hunks)
  • application-admin/src/main/java/com/nowait/applicationadmin/reservation/service/ReservationService.java (1 hunks)
  • application-user/src/main/java/com/nowait/applicationuser/exception/GlobalExceptionHandler.java (2 hunks)
  • application-user/src/main/java/com/nowait/applicationuser/order/dto/OrderCreateRequestDto.java (1 hunks)
  • application-user/src/main/java/com/nowait/applicationuser/order/dto/OrderCreateResponseDto.java (2 hunks)
  • application-user/src/main/java/com/nowait/applicationuser/order/service/OrderService.java (1 hunks)
  • application-user/src/main/java/com/nowait/applicationuser/reservation/exception/ReservationNotFoundException.java (0 hunks)
  • domain-order/src/main/java/com/nowait/order/entity/UserOrder.java (1 hunks)
💤 Files with no reviewable changes (1)
  • application-user/src/main/java/com/nowait/applicationuser/reservation/exception/ReservationNotFoundException.java
🧰 Additional context used
🧬 Code Graph Analysis (1)
application-user/src/main/java/com/nowait/applicationuser/exception/GlobalExceptionHandler.java (1)
domain-reservation/src/main/java/com/nowait/reservation/exception/ReservationNotFoundException.java (1)
  • ReservationNotFoundException (5-9)
🔇 Additional comments (4)
application-admin/src/main/java/com/nowait/applicationadmin/reservation/service/ReservationService.java (1)

13-13: import 순서 정리 승인

ReservationStatus enum의 import 순서를 다른 reservation 관련 import들 위로 이동시킨 것은 코드 정리에 도움이 됩니다.

application-admin/src/main/java/com/nowait/applicationadmin/ApiAdminApplication.java (1)

14-14: 예약 모듈 컴포넌트 스캔 추가 승인

com.nowait.reservation 패키지를 컴포넌트 스캔에 추가한 것은 예약 예외 클래스의 패키지 재배치에 따른 필요한 변경사항입니다. 모듈화 개선에 도움이 됩니다.

application-user/src/main/java/com/nowait/applicationuser/exception/GlobalExceptionHandler.java (2)

5-5: HttpStatus wildcard import 승인

여러 HttpStatus 상수들을 사용하고 있어 wildcard import로 변경한 것이 적절합니다.


29-29: 예약 예외 클래스 import 경로 변경 승인

ReservationNotFoundException이 com.nowait.applicationuser.reservation.exception에서 com.nowait.reservation.exception으로 이동한 것은 모듈 구조 개선을 위한 적절한 변경사항입니다. 공유 모듈로 이동하여 재사용성이 향상됩니다.


private String sessionId;

private String depositorName;
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

데이터베이스 제약사항 추가를 고려해보세요.

depositorName 필드에 적절한 데이터베이스 제약사항을 추가하는 것을 권장합니다. 다른 String 필드(signature)와의 일관성을 위해 길이 제한을 설정하고, 개인정보 보호 관점에서도 적절한 제약을 두는 것이 좋겠습니다.

-	private String depositorName;
+	@Column(length = 100) // 예약자 이름 길이 제한
+	private String depositorName;

또한 필드 순서를 고려하여 sessionId 다음에 배치하는 것도 고려해보세요:

 	private String sessionId;
 
+	@Column(length = 100)
 	private String depositorName;
-
-	private String depositorName;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
private String depositorName;
private String sessionId;
@Column(length = 100) // 예약자 이름 길이 제한
private String depositorName;
🤖 Prompt for AI Agents
In domain-order/src/main/java/com/nowait/order/entity/UserOrder.java at line 50,
add appropriate database constraints to the depositorName field by specifying a
length limit consistent with other String fields like signature to ensure data
integrity and privacy. Also, reorder the depositorName field to be declared
immediately after the sessionId field to maintain logical grouping of related
fields.

@AllArgsConstructor
@Builder
public class OrderCreateRequestDto {
private final String depositorName; // 예약자 이름
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Bean Validation 어노테이션 추가를 고려해보세요.

depositorName 필드에 유효성 검증을 위한 Bean Validation 어노테이션을 추가하는 것을 권장합니다. 이를 통해 컨트롤러 레벨에서 자동으로 검증할 수 있습니다.

+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.Size;

 @Getter
 @AllArgsConstructor
 @Builder
 public class OrderCreateRequestDto {
-	private final String depositorName; // 예약자 이름
+	@NotBlank(message = "예약자 이름은 필수입니다")
+	@Size(max = 100, message = "예약자 이름은 100자 이하여야 합니다")
+	private final String depositorName; // 예약자 이름
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
private final String depositorName; // 예약자 이름
// --- at the top of OrderCreateRequestDto.java ---
package com.nowait.applicationuser.order.dto;
import lombok.Getter;
import lombok.AllArgsConstructor;
import lombok.Builder;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.Size;
@Getter
@AllArgsConstructor
@Builder
public class OrderCreateRequestDto {
+ @NotBlank(message = "예약자 이름은 필수입니다")
+ @Size(max = 100, message = "예약자 이름은 100자 이하여야 합니다")
private final String depositorName; // 예약자 이름
// ... other fields and methods ...
}
🤖 Prompt for AI Agents
In
application-user/src/main/java/com/nowait/applicationuser/order/dto/OrderCreateRequestDto.java
at line 13, the depositorName field lacks Bean Validation annotations. Add
appropriate validation annotations such as @NotBlank or @NotNull to this field
to enable automatic validation at the controller level, ensuring the
depositorName is properly validated when requests are received.

- order에 입금자명 추가
- reservation exception 디렉토리 위치 변경
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 40ae847 and 7a43ff7.

📒 Files selected for processing (6)
  • application-user/src/main/java/com/nowait/applicationuser/exception/GlobalExceptionHandler.java (3 hunks)
  • application-user/src/main/java/com/nowait/applicationuser/order/dto/OrderCreateRequestDto.java (2 hunks)
  • application-user/src/main/java/com/nowait/applicationuser/order/service/OrderService.java (2 hunks)
  • common/src/main/java/com/nowait/common/exception/ErrorMessage.java (1 hunks)
  • domain-order/src/main/java/com/nowait/order/entity/UserOrder.java (1 hunks)
  • domain-order/src/main/java/com/nowait/order/exception/DepositorNameTooLongException.java (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • common/src/main/java/com/nowait/common/exception/ErrorMessage.java
🚧 Files skipped from review as they are similar to previous changes (4)
  • domain-order/src/main/java/com/nowait/order/entity/UserOrder.java
  • application-user/src/main/java/com/nowait/applicationuser/order/dto/OrderCreateRequestDto.java
  • application-user/src/main/java/com/nowait/applicationuser/order/service/OrderService.java
  • application-user/src/main/java/com/nowait/applicationuser/exception/GlobalExceptionHandler.java

- order에 입금자명 추가
- reservation exception 디렉토리 위치 변경
@HyemIin HyemIin merged commit 38d58d4 into develop Jul 1, 2025
1 check passed
@HyemIin HyemIin deleted the feat/#41-order칼럼추가 branch July 1, 2025 09:08
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.

2 participants