Conversation
part + branch -> inventory 두 컬럼을 인벤토리 하나만 쓰는 것으로 변경 어차피 인벤토리에 둘 있고 rop 계산에 쓰이는 정보들도 인벤토리에 두는 것이 깔금할 것 같음.
인벤토리에 1일 소요량, 소요일 추가 부품에 안전 재고 추가 그걸로 rop 계산
일주일마다
바뀐 엔티티에 맞춰서 초기화 로직 변경 rop 하나 생성 서비스 추가
프론트에 맞춰서 만듦 전체 초기값 세팅 하나 만들기 하나 수정 하나 삭제
자동 계산 켜진 애들만 업데이트 하는 것으로 수정
좀 더 명확하게
고려해서 업데이트 할 리스트 뽑기
과 주문 상태 업데이트 이벤트 발송
sales-event -> sales-events
이벤트 변경에 맞춰서 변경 이벤트 구독 디티오 만들어서 수정
컨수머 핸들러 만들고 서비스 로직으로 분리
저장 시 트랜잭셔널
수정 품목 단체로 락 걸기 -> 개별 락으로 변경 경합, 데드락 등을 피하기 위해
자동 주문 켜놓은 재고들 중에 재주문 아래로 재고 떨어진 부품들을 모아 주문 전송
|
Caution Review failedThe pull request is closed. Walkthrough이 PR은 QueryDSL을 통합하고, 이벤트 저장소를 branch 패키지에서 event 패키지로 이동하며, ROP(Reorder Point) 관리 기능, 재고 검색 기능, AWDistance 엔티티, OutHistory 추적, 그리고 주문 처리 워크플로우를 추가합니다. Changes
Sequence Diagram(s)sequenceDiagram
participant Client as 클라이언트
participant SalesEventConsumer as SalesEventConsumer
participant OrderService as OrderService
participant InventoryService as InventoryService
participant AWDistanceRepo as AWDistanceRepository
participant EventOutbox as EventOutboxRepository
participant EventPublisher as EventPublisher
participant Kafka as Kafka
Client->>SalesEventConsumer: 판매 이벤트 (Kafka)
SalesEventConsumer->>SalesEventConsumer: OrderReqDto 역직렬화
SalesEventConsumer->>OrderService: orderProcess(orderReqDto)
OrderService->>OrderService: allocateWarehouse()
Note over OrderService: 창고별 점수 계산<br/>(재고 + 거리)
OrderService->>EventOutbox: OrderWarehouseEvent 저장
OrderService->>EventOutbox: OrderStatusEvent 저장<br/>(CONFIRMED/PENDING)
EventPublisher->>EventOutbox: 폴링
EventPublisher->>Kafka: 이벤트 발행
EventPublisher->>EventOutbox: 처리 완료 표시
sequenceDiagram
participant Client as 클라이언트
participant InventoryController as InventoryController
participant InventoryService as InventoryService
participant InventoryQueryRepo as InventoryQueryRepositoryImpl
participant QueryDSL as QueryDSL
Client->>InventoryController: GET /inventory?keyword=...&status=...
InventoryController->>InventoryService: searchInventory(SearchReqDto, Pageable)
InventoryService->>InventoryQueryRepo: search(condition, pageable)
InventoryQueryRepo->>QueryDSL: 동적 쿼리 빌드
Note over QueryDSL: warehouseId, keyword,<br/>categoryId, groupId,<br/>quantityStatus 필터
QueryDSL-->>InventoryQueryRepo: Page<Inventory>
InventoryQueryRepo-->>InventoryService: 결과
InventoryService->>InventoryService: toResponse() 변환
InventoryService-->>InventoryController: Page<PartResDto>
InventoryController-->>Client: ApiResponse<Page<...>>
sequenceDiagram
participant OutHistoryService as OutHistoryService
participant RopRepository as RopRepository
participant OutHistoryRepository as OutHistoryRepository
participant InventoryRepository as InventoryRepository
Note over OutHistoryService: 매주 월요일 03:00 실행
OutHistoryService->>OutHistoryService: oneWeekAgo 계산
loop 각 분기별
OutHistoryService->>RopRepository: 활성 ROP 조회
RopRepository-->>OutHistoryService: ROP 목록
loop 각 ROP별
OutHistoryService->>OutHistoryRepository: findTotalUsedLastWeek()
OutHistoryRepository-->>OutHistoryService: totalUsed
OutHistoryService->>OutHistoryService: averageDaily = totalUsed / 7
OutHistoryService->>OutHistoryService: ropValue 계산
OutHistoryService->>InventoryRepository: 업데이트 저장
end
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45분 검토 시 추가 주의 필요 영역:
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (50)
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. Comment |
This was referenced Nov 3, 2025
Merged
Merged
Merged
Merged
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Summary
🙏 Question & PR point
📬 Reference
Summary by CodeRabbit
릴리스 노트
New Features
Refactor
Chores