Skip to content

[REFACTOR] expiredAt 자동 계산 로직 도메인 내재화 #15

Description

@ji-circle

💡 리팩터링 대상 및 이유

주문 만료 시간(expiredAt)을 외부 API 요청으로 받지 않고, 수령 방법(ReceivingMethod)에 따라 도메인 내부에서 스스로 계산하도록 응집도를 높임

🔍 현재 코드 상태 (문제점)

CreateOrderRequestCreateOrderCommand에서 expiredAt을 파라미터로 직접 받고 있어, 클라이언트가 악의적으로 만료 시간을 조작할 위험이 있으며 도메인 규칙이 외부로 파편화되어 있음

✅ 체크리스트 (구현할 내용)

  • CreateOrderRequest 및 DTO에서 expiredAt 필드와 관련 Validation 제거
  • OrderCommandServiceOrder.create() 호출부에서 expiredAt 파라미터 제거
  • Order 도메인 엔티티 내부 create 팩토리 메서드에 ReceivingMethod 기반 expiredAt 자동 계산 로직(PICKUP은 당일 23시, 그 외는 현재+15분) 추가
  • 테스트 코드 수정 및 API 명세서(RestDocs) 갱신

🚀 기대 효과

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions