Conversation
chore: 공통 설정 사항 적용
refactor: Product, BaseEntity - getter 추가
chore: domain 계층 폴더 세분화
…ication/mapper/ProductMapper.java Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…ication/mapper/ProductMapper.java Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…in/model/BaseEntity.java Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…v_product # Conflicts: # product-service/src/main/java/com/shipflow/productservice/domain/model/BaseEntity.java
…astructure/persistence/ProductRepositoryImpl.java Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
chore: redis 설정 추가
…ication/mapper/ProductMapper.java Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
# Conflicts: # product-service/src/test/java/com/shipflow/productservice/application/service/ProductServiceTest.java
# Conflicts: # product-service/src/main/java/com/shipflow/productservice/application/service/ProductService.java # product-service/src/main/java/com/shipflow/productservice/presentation/controller/ProductInternalController.java # product-service/src/test/java/com/shipflow/productservice/application/service/ProductServiceTest.java
refactor: 재고 조회 중 주문량이 재고보다 많을 시 예외 발생
📝 WalkthroughWalkthrough사용자 삭제 시 관련 업체 및 제품을 함께 삭제하는 기능이 추가되었습니다. ProductFeignClient의 메서드 이름이 정규화되었으며( Sequence DiagramsequenceDiagram
participant UserService as User Service
participant CompanyController as Company Controller
participant CompanyService as Company Service
participant CompanyRepo as Company Repository
participant ProductClient as Product Feign Client
participant ProductService as Product Service
UserService->>CompanyController: DELETE /internal/companies/user/{userId}
CompanyController->>CompanyService: deleteProductByUser(userId)
CompanyService->>CompanyRepo: findByManagerId(userId)
CompanyRepo-->>CompanyService: Company
CompanyService->>CompanyService: company.delete(userId)
CompanyService->>CompanyRepo: save(company)
CompanyRepo-->>CompanyService: Saved Company
CompanyService->>ProductClient: deleteProductsByCompanyId(companyId)
ProductClient->>ProductService: DELETE /internal/companies/{companyId}/products/deactivate
ProductService-->>ProductClient: Success
ProductClient-->>CompanyService: Success
CompanyService-->>CompanyController: Void
CompanyController-->>UserService: 200 OK
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@company-service/src/main/java/com/shipflow/companyservice/application/service/CompanyService.java`:
- Around line 149-154: The remote product deletion is currently executed inside
the `@Transactional` method deleteProductByUser after company.delete and before
transaction commit, risking inconsistent state if the local commit fails; change
deleteProductByUser to only perform the company soft-delete and save (keep
CompanyService.deleteProductByUser calling company.delete(...) and
companyRepository.save(...)), then publish a lightweight event carrying
companyId (e.g., CompanyDeletedEvent) via ApplicationEventPublisher; implement a
separate listener method (or outbox processor) that invokes
productFeignClient.deleteProductsByCompanyId(companyId) annotated with
`@TransactionalEventListener`(phase = AFTER_COMMIT) (or use an outbox consumer) so
the remote call happens only after the local transaction successfully commits.
In
`@user-service/src/main/java/com/shipflow/userservice/infrastructure/client/CompanyFeignClient.java`:
- Around line 11-12: The Feign client method deleteManager in CompanyFeignClient
uses ClientApiResponse<Void> but the server endpoint
CompanyInternalController.deleteByUser returns void (no response body), causing
deserialization errors; update the Feign method signature to return void (or
ResponseEntity<Void>) to match the controller, and ensure the
`@DeleteMapping`("/internal/companies/user/{userId}") method parameter remains
annotated with `@PathVariable` UUID userId so the mapping stays correct.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f87236ae-7979-405e-864c-35f3c9522be5
📒 Files selected for processing (5)
company-service/src/main/java/com/shipflow/companyservice/application/client/ProductFeignClient.javacompany-service/src/main/java/com/shipflow/companyservice/application/service/CompanyService.javacompany-service/src/main/java/com/shipflow/companyservice/presentation/controller/CompanyInternalController.javaproduct-service/src/main/java/com/shipflow/productservice/application/service/ProductService.javauser-service/src/main/java/com/shipflow/userservice/infrastructure/client/CompanyFeignClient.java
📌 PR 제목
[FEATURE] 유저 삭제 시 업체 삭제 등 (#44)
✨ 작업 내용
유저 삭제 시 업체 삭제 추가 및 기타 추가사항 추가
🔍 상세 내용
구체적인 작업 내용을 작성해주세요.
🔗 관련 이슈
Closes #44
✅ 체크리스트
Summary by CodeRabbit
릴리스 노트
새로운 기능
버그 수정