Feat: 주점 결제 정보 CRUD 및 예외처리 추가 #105
Conversation
|
Caution Review failedThe pull request is closed. Walkthrough이 변경사항은 "StorePayment" 기능의 전체적인 도입 및 관련 CRUD(생성, 조회, 수정) API, 서비스, DTO, 예외, JPA 엔티티, 저장소를 백엔드와 유저 API에 추가합니다. 또한, 기존 백엔드 이슈 템플릿을 삭제하고 일부 코드 스타일 및 import 구문을 정리하였습니다. Changes
Sequence Diagram(s)sequenceDiagram
participant AdminAPI as Admin API
participant StorePaymentController
participant StorePaymentService
participant StorePaymentRepository
participant DB
AdminAPI->>StorePaymentController: POST /admin/store-payments/create (request, memberDetails)
StorePaymentController->>StorePaymentService: createStorePayment(request, memberDetails)
StorePaymentService->>StorePaymentRepository: save(StorePayment)
StorePaymentRepository->>DB: Insert StorePayment
StorePaymentRepository-->>StorePaymentService: StorePayment Entity
StorePaymentService-->>StorePaymentController: StorePaymentCreateResponse
StorePaymentController-->>AdminAPI: 201 Created + ApiUtils.success(response)
AdminAPI->>StorePaymentController: GET /admin/store-payments (memberDetails)
StorePaymentController->>StorePaymentService: getStorePaymentByStoreId(memberDetails)
StorePaymentService->>StorePaymentRepository: findByStoreId(storeId)
StorePaymentRepository-->>StorePaymentService: StorePayment Entity
StorePaymentService-->>StorePaymentController: StorePaymentReadDto
StorePaymentController-->>AdminAPI: 200 OK + ApiUtils.success(response)
AdminAPI->>StorePaymentController: PATCH /admin/store-payments/update (request, memberDetails)
StorePaymentController->>StorePaymentService: updateStorePayment(request, memberDetails)
StorePaymentService->>StorePaymentRepository: findByStoreId(storeId)
StorePaymentRepository-->>StorePaymentService: StorePayment Entity
StorePaymentService->>StorePaymentRepository: save(StorePayment)
StorePaymentRepository-->>StorePaymentService: StorePayment Entity
StorePaymentService-->>StorePaymentController: StorePaymentReadDto
StorePaymentController-->>AdminAPI: 200 OK + ApiUtils.success(response)
sequenceDiagram
participant UserAPI as User API
participant StorePaymentController
participant StorePaymentService
participant StorePaymentRepository
participant DB
UserAPI->>StorePaymentController: GET /v1/store-payments/{storeId}
StorePaymentController->>StorePaymentService: getStorePaymentByStoreId(storeId)
StorePaymentService->>StorePaymentRepository: findByStoreId(storeId)
StorePaymentRepository-->>StorePaymentService: StorePayment Entity
StorePaymentService-->>StorePaymentController: StorePaymentReadDto
StorePaymentController-->>UserAPI: 200 OK + ApiUtils.success(response)
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 13
🔭 Outside diff range comments (1)
nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/storePayment/dto/StorePaymentReadDto.java (1)
1-33: 코드 중복을 제거하세요.이 클래스는 사용자 API의 StorePaymentReadDto와 동일합니다. 공통 모듈로 이동하여 중복을 제거하는 것을 고려해보세요.
공통 DTO를 위한 별도 모듈 생성을 고려하거나, 기존 공통 모듈에 배치하여 admin과 user API 모두에서 참조하도록 리팩토링할 수 있습니다.
🧹 Nitpick comments (11)
nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/store/service/StoreServiceImpl.java (1)
5-5: 사용되지 않는 import 제거 필요현재 파일에서
@AuthenticationPrincipal어노테이션을 사용하지 않는 것으로 보입니다. 불필요한 import는 제거해주세요.-import org.springframework.security.core.annotation.AuthenticationPrincipal;nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/store/controller/StoreController.java (1)
92-92: 포맷팅 일관성 유지 필요92번째 줄에서도 쉼표 뒤에 공백을 추가하여 포맷팅을 일관성 있게 유지해주세요.
- storeService.deleteStore(storeId,memberDetails) + storeService.deleteStore(storeId, memberDetails)nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/storePayment/dto/StorePaymentCreateRequest.java (1)
5-5: @NotNull import가 사용되지 않습니다.jakarta.validation.constraints.NotNull을 import했지만 필드에 적용되지 않았습니다.
nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/storePayment/service/StorePaymentService.java (1)
9-14: Delete 메서드가 누락되었습니다.CRUD 작업 중 삭제(Delete) 기능이 인터페이스에 정의되어 있지 않습니다. 의도적으로 제외된 것인지 확인이 필요합니다.
삭제 기능이 필요하다면 구현을 도와드릴 수 있습니다. 새로운 이슈를 생성하시겠습니까?
nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/entity/StorePayment.java (2)
43-50: 불필요한 커스텀 생성자입니다.Lombok의
@SuperBuilder와@AllArgsConstructor가 이미 있으므로, 이 커스텀 생성자는 중복됩니다. 제거하는 것이 좋습니다.이 생성자를 제거하면 코드가 더 깔끔해집니다.
34-35: 띄어쓰기가 누락되었습니다.
length속성 앞에 공백이 없습니다.-@Column(name = "toss_url",length = 500) +@Column(name = "toss_url", length = 500)nowait-app-user-api/src/main/java/com/nowait/applicationuser/storePayment/controller/StorePaymentController.java (2)
5-5: 사용하지 않는 import가 있습니다.
@AuthenticationPrincipal과MemberDetails는 이 컨트롤러에서 사용되지 않습니다.-import org.springframework.security.core.annotation.AuthenticationPrincipal; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import com.nowait.applicationuser.storePayment.service.StorePaymentService; import com.nowait.common.api.ApiUtils; -import com.nowait.domaincorerdb.user.entity.MemberDetails;Also applies to: 13-13
34-34: @Valid는 @PathVariable에 적용되지 않습니다.
@Valid는 request body나 form data 검증용이며, path variable에는 효과가 없습니다.-public ResponseEntity<?> getStorePaymentByStoreId(@Valid @PathVariable Long storeId) { +public ResponseEntity<?> getStorePaymentByStoreId(@PathVariable Long storeId) {nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/storePayment/service/StorePaymentServiceImpl.java (1)
83-83: 이미 관리되는 엔티티를 다시 저장할 필요가 없습니다.JPA의 dirty checking 메커니즘에 의해 트랜잭션이 커밋될 때 자동으로 변경사항이 저장됩니다. 명시적인 save() 호출은 불필요합니다.
storePayment.updatePaymentMethodUrl( request.getTossUrl(), request.getKakaoPayUrl(), request.getNaverPayUrl() ); -storePaymentRepository.save(storePayment);nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/storePayment/controller/StorePaymentController.java (2)
39-39: 타입 안전성을 위해 ResponseEntity 제네릭 타입 지정 권장모든 엔드포인트에서
ResponseEntity<?>를 사용하고 있어 타입 안전성이 떨어집니다. 구체적인 응답 타입을 지정하는 것이 좋습니다.-public ResponseEntity<?> createStorePayment(@Valid @RequestBody StorePaymentCreateRequest request, @AuthenticationPrincipal MemberDetails memberDetails) { +public ResponseEntity<ApiUtils.ApiResult<StorePaymentCreateResponse>> createStorePayment(@Valid @RequestBody StorePaymentCreateRequest request, @AuthenticationPrincipal MemberDetails memberDetails) { -public ResponseEntity<?> getStorePaymentByStoreId(@AuthenticationPrincipal MemberDetails memberDetails) { +public ResponseEntity<ApiUtils.ApiResult<StorePaymentReadDto>> getStorePaymentByStoreId(@AuthenticationPrincipal MemberDetails memberDetails) { -public ResponseEntity<?> updateStorePayment(@Valid @RequestBody StorePaymentUpdateRequest request, @AuthenticationPrincipal MemberDetails memberDetails) { +public ResponseEntity<ApiUtils.ApiResult<StorePaymentUpdateResponse>> updateStorePayment(@Valid @RequestBody StorePaymentUpdateRequest request, @AuthenticationPrincipal MemberDetails memberDetails) {Also applies to: 54-54, 67-67
29-29: 일관성 있는 URL 매핑 패턴 고려현재 엔드포인트들이 서로 다른 URL 패턴을 사용하고 있습니다:
- POST
/admin/store-payments/create- GET
/admin/store-payments- PATCH
/admin/store-payments/updateREST API 관례에 따라 더 일관성 있는 패턴을 고려해보세요.
-@PostMapping("/create") +@PostMapping -@PatchMapping("/update") +@PatchMapping또는 리소스 중심 접근법:
-@PostMapping("/create") +@PostMapping -@GetMapping() +@GetMapping("/{storeId}") -@PatchMapping("/update") +@PatchMapping("/{storeId}")Also applies to: 36-36, 51-51, 64-64
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (22)
.github/ISSUE_TEMPLATE/백엔드-이슈.md(0 hunks)nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/store/controller/StoreController.java(2 hunks)nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/store/service/StoreServiceImpl.java(1 hunks)nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/storePayment/controller/StorePaymentController.java(1 hunks)nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/storePayment/dto/StorePaymentCreateRequest.java(1 hunks)nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/storePayment/dto/StorePaymentCreateResponse.java(1 hunks)nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/storePayment/dto/StorePaymentReadDto.java(1 hunks)nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/storePayment/dto/StorePaymentUpdateRequest.java(1 hunks)nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/storePayment/service/StorePaymentService.java(1 hunks)nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/storePayment/service/StorePaymentServiceImpl.java(1 hunks)nowait-app-user-api/src/main/java/com/nowait/applicationuser/storePayment/controller/StorePaymentController.java(1 hunks)nowait-app-user-api/src/main/java/com/nowait/applicationuser/storePayment/dto/StorePaymentReadDto.java(1 hunks)nowait-app-user-api/src/main/java/com/nowait/applicationuser/storePayment/service/StorePaymentService.java(1 hunks)nowait-app-user-api/src/main/java/com/nowait/applicationuser/storePayment/service/StorePaymentServiceImpl.java(1 hunks)nowait-common/src/main/java/com/nowait/common/exception/ErrorMessage.java(1 hunks)nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/entity/StorePayment.java(1 hunks)nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentCreationUnauthorized.java(1 hunks)nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentNotFoundException.java(1 hunks)nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentParamEmptyException.java(1 hunks)nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentUpdateUnauthorizedException.java(1 hunks)nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentViewUnauthorizedException.java(1 hunks)nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/repository/StorePaymentRepository.java(1 hunks)
💤 Files with no reviewable changes (1)
- .github/ISSUE_TEMPLATE/백엔드-이슈.md
🧰 Additional context used
🧬 Code Graph Analysis (3)
nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/storePayment/dto/StorePaymentCreateResponse.java (1)
nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/storePayment/dto/StorePaymentCreateRequest.java (1)
Getter(10-27)
nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/storePayment/service/StorePaymentServiceImpl.java (6)
nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/store/service/StoreServiceImpl.java (1)
Service(32-126)nowait-app-user-api/src/main/java/com/nowait/applicationuser/storePayment/service/StorePaymentServiceImpl.java (1)
Service(13-29)nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentCreationUnauthorized.java (1)
StorePaymentCreationUnauthorized(5-10)nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentParamEmptyException.java (1)
StorePaymentParamEmptyException(5-9)nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentUpdateUnauthorizedException.java (1)
StorePaymentUpdateUnauthorizedException(5-9)nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentViewUnauthorizedException.java (1)
StorePaymentViewUnauthorizedException(5-9)
nowait-app-user-api/src/main/java/com/nowait/applicationuser/storePayment/service/StorePaymentServiceImpl.java (2)
nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/storePayment/service/StorePaymentServiceImpl.java (1)
Service(26-87)nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentParamEmptyException.java (1)
StorePaymentParamEmptyException(5-9)
🔇 Additional comments (12)
nowait-app-user-api/src/main/java/com/nowait/applicationuser/storePayment/service/StorePaymentService.java (1)
5-7: 서비스 인터페이스 구조 양호메서드 시그니처가 명확하고 네이밍이 일관성 있게 작성되었습니다.
nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/store/controller/StoreController.java (1)
57-57: 포맷팅 개선 양호매개변수 목록의 일관성 있는 포맷팅 개선이 잘 되었습니다.
Also applies to: 87-87
nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentParamEmptyException.java (1)
5-9: 예외 클래스 구조 양호매개변수 검증용 예외 클래스가 표준적인 구조로 잘 작성되었습니다. 클래스명도 Exception으로 끝나는 명명 규칙을 잘 따르고 있습니다.
nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentViewUnauthorizedException.java (1)
5-9: 예외 클래스 구현이 올바릅니다.예외 클래스명과 에러 메시지가 일치하며, 표준적인 RuntimeException 상속 구조를 따르고 있습니다.
nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentUpdateUnauthorizedException.java (1)
5-9: 예외 클래스 구현이 올바릅니다.예외 클래스명과 에러 메시지가 일치하며, 표준적인 RuntimeException 상속 구조를 따르고 있습니다.
nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/repository/StorePaymentRepository.java (1)
10-13: 표준적인 Spring Data JPA 리포지토리 구현입니다.JpaRepository 상속과 메서드 네이밍 규칙을 올바르게 따르고 있으며, Optional 반환으로 null 안전성을 보장하고 있습니다.
nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/storePayment/dto/StorePaymentCreateRequest.java (1)
19-26: toEntity 메서드 구현이 깔끔합니다.Builder 패턴을 사용하여 Entity 변환을 깔끔하게 구현했습니다.
nowait-app-user-api/src/main/java/com/nowait/applicationuser/storePayment/dto/StorePaymentReadDto.java (1)
1-33: 구현이 올바르게 되었습니다.표준 DTO 패턴을 따르고 있으며, fromEntity 정적 팩토리 메서드가 올바르게 구현되어 있습니다.
nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/storePayment/dto/StorePaymentUpdateRequest.java (1)
1-17: 구현이 적절합니다.업데이트 요청을 위한 표준 DTO 패턴을 잘 따르고 있습니다.
nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/storePayment/dto/StorePaymentCreateResponse.java (1)
1-34: 올바른 구현입니다.생성 응답을 위한 표준 DTO 패턴을 잘 따르고 있으며, fromEntity 메서드가 적절히 구현되어 있습니다.
nowait-app-user-api/src/main/java/com/nowait/applicationuser/storePayment/service/StorePaymentServiceImpl.java (1)
19-28: 인증 없이 조회가 가능한 구조입니다.현재 구현에서는 storeId만 알면 누구나 결제 정보를 조회할 수 있습니다. 결제 URL과 같은 민감한 정보가 포함되어 있으므로, 적절한 인증/인가 검증이 필요할 수 있습니다.
관리자 API와 달리 사용자 API에서 인증 없이 결제 정보 조회를 허용하는 것이 의도된 설계인지 확인이 필요합니다.
nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/storePayment/controller/StorePaymentController.java (1)
27-35: 코드 구조가 Spring Boot 모범 사례를 잘 따르고 있습니다클래스 선언과 의존성 주입 구조가 적절하게 구현되어 있습니다:
- 적절한 Swagger 문서화 어노테이션
- 생성자 주입을 통한 의존성 주입
- 로깅을 위한 Slf4j 사용
- 올바른 Spring 어노테이션 사용
| @@ -0,0 +1,7 @@ | |||
| package com.nowait.applicationuser.storePayment.service; | |||
There was a problem hiding this comment.
🛠️ Refactor suggestion
패키지명 명명 규칙 개선 필요
Java 패키지명 규칙에 따라 storePayment보다는 storepayment(모두 소문자)를 사용하는 것이 좋습니다.
-package com.nowait.applicationuser.storePayment.service;
+package com.nowait.applicationuser.storepayment.service;📝 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.
| package com.nowait.applicationuser.storePayment.service; | |
| package com.nowait.applicationuser.storepayment.service; |
🤖 Prompt for AI Agents
In
nowait-app-user-api/src/main/java/com/nowait/applicationuser/storePayment/service/StorePaymentService.java
at line 1, the package name 'storePayment' uses mixed case which violates Java
package naming conventions. Rename the package directory and update the package
declaration to use all lowercase letters as 'storepayment' to comply with
standard Java package naming rules.
There was a problem hiding this comment.
Actionable comments posted: 9
♻️ Duplicate comments (1)
nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentNotFoundException.java (1)
5-9: 잘못된 에러 메시지 사용으로 인한 크리티컬 이슈입니다.이전 리뷰에서 이미 지적된 문제가 여전히 수정되지 않았습니다.
StorePaymentNotFoundException인데STORE_PAYMENT_PARAMETER_EMPTY메시지를 사용하고 있어 클라이언트에게 잘못된 에러 정보를 전달하게 됩니다.즉시 다음과 같이 수정해야 합니다:
public class StorePaymentNotFoundException extends RuntimeException { public StorePaymentNotFoundException() { - super(ErrorMessage.STORE_PAYMENT_PARAMETER_EMPTY.getMessage()); + super(ErrorMessage.STORE_PAYMENT_NOT_FOUND.getMessage()); } }
🧹 Nitpick comments (2)
nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentCreationUnauthorizedException.java (1)
6-6: 불필요한 빈 줄을 제거하세요.클래스 내부의 불필요한 빈 줄을 제거하여 코드를 더 깔끔하게 만들 수 있습니다.
public class StorePaymentCreationUnauthorizedException extends RuntimeException { - public StorePaymentCreationUnauthorizedException() {nowait-app-user-api/src/main/java/com/nowait/applicationuser/storepayment/controller/StorePaymentController.java (1)
29-29: @GetMapping에서 불필요한 괄호를 제거하세요.이중 괄호는 불필요하며 가독성을 해칠 수 있습니다.
- @GetMapping(("/{storeId}")) + @GetMapping("/{storeId}")
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (18)
nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/storePayment/controller/StorePaymentController.java(1 hunks)nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/storePayment/dto/StorePaymentCreateRequest.java(1 hunks)nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/storePayment/dto/StorePaymentCreateResponse.java(1 hunks)nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/storePayment/dto/StorePaymentReadDto.java(1 hunks)nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/storePayment/service/StorePaymentServiceImpl.java(1 hunks)nowait-app-user-api/src/main/java/com/nowait/applicationuser/storepayment/controller/StorePaymentController.java(1 hunks)nowait-app-user-api/src/main/java/com/nowait/applicationuser/storepayment/dto/StorePaymentReadDto.java(1 hunks)nowait-app-user-api/src/main/java/com/nowait/applicationuser/storepayment/service/StorePaymentService.java(1 hunks)nowait-app-user-api/src/main/java/com/nowait/applicationuser/storepayment/service/StorePaymentServiceImpl.java(1 hunks)nowait-common/src/main/java/com/nowait/common/exception/ErrorMessage.java(1 hunks)nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/entity/StorePayment.java(1 hunks)nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentAlreadyExistsException.java(1 hunks)nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentCreationUnauthorizedException.java(1 hunks)nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentNotFoundException.java(1 hunks)nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentParamEmptyException.java(1 hunks)nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentUpdateUnauthorizedException.java(1 hunks)nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentViewUnauthorizedException.java(1 hunks)nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/repository/StorePaymentRepository.java(1 hunks)
✅ Files skipped from review due to trivial changes (2)
- nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/storePayment/dto/StorePaymentCreateRequest.java
- nowait-app-user-api/src/main/java/com/nowait/applicationuser/storepayment/dto/StorePaymentReadDto.java
🚧 Files skipped from review as they are similar to previous changes (9)
- nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentParamEmptyException.java
- nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/repository/StorePaymentRepository.java
- nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentUpdateUnauthorizedException.java
- nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentViewUnauthorizedException.java
- nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/storePayment/dto/StorePaymentReadDto.java
- nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/storePayment/dto/StorePaymentCreateResponse.java
- nowait-common/src/main/java/com/nowait/common/exception/ErrorMessage.java
- nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/entity/StorePayment.java
- nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/storePayment/controller/StorePaymentController.java
🧰 Additional context used
🧬 Code Graph Analysis (2)
nowait-app-user-api/src/main/java/com/nowait/applicationuser/storepayment/service/StorePaymentServiceImpl.java (1)
nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentParamEmptyException.java (1)
StorePaymentParamEmptyException(5-9)
nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/storePayment/service/StorePaymentServiceImpl.java (6)
nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/store/service/StoreServiceImpl.java (1)
Service(32-126)nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentAlreadyExistsException.java (1)
StorePaymentAlreadyExistsException(5-9)nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentCreationUnauthorizedException.java (1)
StorePaymentCreationUnauthorizedException(5-10)nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentParamEmptyException.java (1)
StorePaymentParamEmptyException(5-9)nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentUpdateUnauthorizedException.java (1)
StorePaymentUpdateUnauthorizedException(5-9)nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentViewUnauthorizedException.java (1)
StorePaymentViewUnauthorizedException(5-9)
🔇 Additional comments (7)
nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentAlreadyExistsException.java (1)
5-9: 예외 클래스 구현이 올바릅니다.RuntimeException을 상속하고 적절한 에러 메시지를 사용하는 표준적인 예외 클래스 구현입니다.
nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentCreationUnauthorizedException.java (1)
7-9: 예외 클래스 구현이 올바릅니다.적절한 에러 메시지를 사용하는 표준적인 예외 클래스 구현입니다.
nowait-app-user-api/src/main/java/com/nowait/applicationuser/storepayment/service/StorePaymentService.java (1)
5-7: 서비스 인터페이스 설계가 우수합니다.명확한 메서드 시그니처와 적절한 반환 타입을 사용한 깔끔한 인터페이스 설계입니다. 단일 책임 원칙을 잘 따르고 있습니다.
nowait-app-user-api/src/main/java/com/nowait/applicationuser/storepayment/controller/StorePaymentController.java (2)
20-27: 컨트롤러 설정이 잘 구성되어 있습니다.OpenAPI 문서화 어노테이션과 Spring Boot 표준 패턴을 잘 따르고 있습니다. 의존성 주입과 로깅 설정도 적절합니다.
33-40: 응답 처리 로직이 표준 패턴을 잘 따릅니다.ApiUtils.success를 사용한 표준화된 응답 래핑과 적절한 HTTP 상태 코드 사용이 좋습니다.
nowait-app-user-api/src/main/java/com/nowait/applicationuser/storepayment/service/StorePaymentServiceImpl.java (1)
19-28: 구현이 깔끔하고 모범 사례를 잘 따르고 있습니다.서비스 메서드가 적절한 검증, 트랜잭션 처리, 예외 처리를 수행하고 있습니다. 특히 읽기 전용 트랜잭션 어노테이션 사용과 일관된 예외 타입 사용이 좋습니다.
nowait-app-admin-api/src/main/java/com/nowait/applicationadmin/storePayment/service/StorePaymentServiceImpl.java (1)
42-44: 중복 생성 방지 로직이 잘 구현되었습니다.이전 리뷰 피드백이 반영되어 이미 존재하는 결제 정보에 대한 중복 생성을 적절히 방지하고 있습니다.
| @@ -0,0 +1,9 @@ | |||
| package com.nowait.domaincorerdb.storepayment.exception; | |||
There was a problem hiding this comment.
패키지 이름 불일치 문제가 있습니다.
파일 경로는 storePayment (PascalCase)를 사용하지만 패키지 선언은 storepayment (camelCase)를 사용하고 있습니다. 일관성을 위해 통일해야 합니다.
다음 중 하나로 수정하는 것을 권장합니다:
-package com.nowait.domaincorerdb.storepayment.exception;
+package com.nowait.domaincorerdb.storePayment.exception;또는 디렉토리 구조를 storepayment로 변경하세요.
📝 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.
| package com.nowait.domaincorerdb.storepayment.exception; | |
| -package com.nowait.domaincorerdb.storepayment.exception; | |
| +package com.nowait.domaincorerdb.storePayment.exception; |
🤖 Prompt for AI Agents
In
nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentAlreadyExistsException.java
at line 1, the package declaration uses 'storepayment' in lowercase, which does
not match the directory name 'storePayment' with uppercase P. To fix this,
update the package declaration to use 'storePayment' with the same casing as the
directory, or alternatively rename the directory to 'storepayment' to match the
package declaration. Ensure the package name and directory structure are
consistent.
| @@ -0,0 +1,9 @@ | |||
| package com.nowait.domaincorerdb.storepayment.exception; | |||
There was a problem hiding this comment.
패키지 이름 불일치 문제가 있습니다.
파일 경로는 storePayment (PascalCase)를 사용하지만 패키지 선언은 storepayment (camelCase)를 사용하고 있습니다. 일관성을 위해 통일해야 합니다.
🤖 Prompt for AI Agents
In
nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentNotFoundException.java
at line 1, the package declaration uses 'storepayment' in lowercase, which does
not match the directory name 'storePayment' with uppercase 'P'. Update the
package declaration to 'com.nowait.domaincorerdb.storePayment.exception' to
match the folder structure and maintain consistency.
| @@ -0,0 +1,10 @@ | |||
| package com.nowait.domaincorerdb.storepayment.exception; | |||
There was a problem hiding this comment.
패키지 이름 불일치 문제가 있습니다.
파일 경로는 storePayment (PascalCase)를 사용하지만 패키지 선언은 storepayment (camelCase)를 사용하고 있습니다. 일관성을 위해 통일해야 합니다.
🤖 Prompt for AI Agents
In
nowait-domain/domain-core-rdb/src/main/java/com/nowait/domaincorerdb/storePayment/exception/StorePaymentCreationUnauthorizedException.java
at line 1, the package declaration uses 'storepayment' in camelCase, which does
not match the directory name 'storePayment' in PascalCase. Update the package
declaration to 'storePayment' to ensure consistency with the file path and avoid
package naming conflicts.
작업 요약
주점 결제 정보 CRUD 및 예외처리 추가
Issue Link
#104
문제점 및 어려움
해결 방안
Reference
Summary by CodeRabbit
신규 기능
버그 수정
예외 및 오류 메시지
기타