Skip to content

feat(general-goods): stock-reserve Kafka 리스너 및 UPDATE WHERE 원자적 재고 차감 [KAN-255]#37

Closed
lian2945 wants to merge 5 commits into
mainfrom
feat/217
Closed

feat(general-goods): stock-reserve Kafka 리스너 및 UPDATE WHERE 원자적 재고 차감 [KAN-255]#37
lian2945 wants to merge 5 commits into
mainfrom
feat/217

Conversation

@lian2945

Copy link
Copy Markdown
Collaborator

관련 이슈

KAN-255

변경 사항 요약

  • OrchestratorCommandKafkaListener: stock-reserve.general-good 토픽 수신 리스너 추가
  • StockReserveCommandEvent: Orchestrator가 발행하는 stock-reserve 커맨드 이벤트 DTO
  • HandleStockReserveUseCase / HandleStockReserveService: 재고 차감 유스케이스 구현
  • GeneralGoodsRepositoryPort / GeneralGoodsJpaAdapter: decreaseStock 포트 및 어댑터 구현
  • GeneralGoodsJpaRepository: UPDATE WHERE stock >= qty 원자적 재고 차감 쿼리 추가
  • GeneralGoodsDomainEventType: STOCK_RESERVE_SUCCEEDED, STOCK_RESERVE_FAILED 이벤트 타입 추가
  • StockReserveSucceededEvent / StockReserveFailedEvent: 결과 이벤트 도메인 레코드

테스트 체크리스트

  • stock >= qty인 경우 차감 성공 → stock-reserve-general-goods-succeeded 이벤트 발행 확인
  • stock < qty인 경우 차감 실패 → stock-reserve-general-goods-failed 이벤트 발행 확인
  • 동시 요청 시 DB UPDATE WHERE 조건으로 초과 차감 방지 확인

lian2945 and others added 5 commits June 9, 2026 17:45
…ype 전파 [KAN-215]

- ProductType enum 신규 (RELEASE, GENERAL_GOODS)
- OrderLine 도메인에 productType 필드 추가 (createBuilder, reconstructBuilder)
- OrderLineEntity에 product_type 컬럼 추가 (@Enumerated STRING)
- OrderMapper toLineEntity/toLineDomain에 productType 매핑 추가
- OrderPrepareEvent.OrderItemPayload에 product_type 필드 추가
- CreateOrderCommand.OrderLineCommand에 productType 추가
- OrderLineRequest에 productType 추가 (validation 포함)
- CreateOrderService: command에서 productType 전달
- CreateReleaseOrderService: ProductType.RELEASE 하드코딩

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- OrderLine 도메인, OrderLineEntity에 thumbnailUrl 필드 추가
- 주문 생성 요청(CreateOrderRequest, CreateReleaseOrderRequest, OrderLineRequest)에 thumbnailUrl 수신
- CreateOrderCommand, CreateReleaseOrderCommand에 thumbnailUrl 전달
- CreateOrderService, CreateReleaseOrderService에서 OrderLine 생성 시 thumbnailUrl 세팅
- OrderMapper toLineEntity/toLineDomain에 thumbnailUrl 매핑
- OrderResultMapper, OrderLineResult, OrderLineResponse에 thumbnailUrl 포함

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- ReadNotificationCommand: notificationId → notificationIds(List<Long>)로 변경
- ReadNotificationUseCase: read() → readAll()로 변경
- ReadNotificationService: updateAllByIdsAndUserId 단일 쿼리로 일괄 처리
- NotificationJpaRepository: @Modifying bulk UPDATE 쿼리 추가
- NotificationJpaAdapter: updateAllByIdsAndUserId 구현
- NotificationCommandController: PATCH /{id}/read → PATCH /read (body: notificationIds)
- ReadNotificationsRequest: 신규 request DTO 추가

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…규칙 추가

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… [KAN-255]

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lian2945 lian2945 closed this Jun 15, 2026
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.

1 participant