-
Notifications
You must be signed in to change notification settings - Fork 0
feat(#59): 주문 생성 API 구현 #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
joel-you
wants to merge
17
commits into
develop
Choose a base branch
from
feature/59-order-create-api
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
* Mapstruct 만 사용하도록 수정 * UUID to Long 로직 제거 (사용하지 않는 로직)
- Flyway 마이그레이션 스크립트 작성 (V1__Create_order_tables.sql) - orders, order_items 테이블 생성 with UUID 컬럼 - JPA 엔티티 컬럼명 업데이트 (orderUuid→orderId, userId→customerId) - 커스텀 쿼리 메서드 구현 (findByCustomerId, findByStatus 등) - 성능 최적화 인덱스 추가 (customer_id, status, order_date 등)
- 신규/기존 주문 저장 및 업데이트 지원 - OrderItems cascade 처리 포함 - MapStruct 기반 도메인 변환 적용
- ID, UUID, 주문번호 기반 조회 지원 - MapStruct 기반 도메인 변환 적용
- 고객/상태/기간 기반 목록 조회 지원 - Stream API 기반 도메인 변환 적용
- ID/UUID 기반 주문+항목 조회 지원 - JOIN FETCH로 성능 최적화
- Validation이 적용된 DTO 추가 (Request/Response) - UseCase 및 Command 패턴 구현 - 주문 번호 자동 생성 기능이 포함된 OrderService 추가 - REST 엔드포인트 POST /api/v1/orders 추가 - MapStruct DTO 매퍼 추가
…ture/59-order-create-api
- @min을 @DecimalMin으로 변경하여 소수점 단위 가격 지원 - 최소 가격을 0.01로 설정하여 0원 상품 방지 - BigDecimal 타입에 적합한 검증 어노테이션 적용
- OrderControllerTest: POST /api/v1/orders 성공 케이스 검증 - OrderServiceTest: 주문 생성 로직 단위 테스트 - MockMvc 기반 통합 테스트로 실제 HTTP 요청/응답 검증 - 테스트 커버리지 70% 이상 달성
- POST /api/v1/orders 엔드포인트 명세 작성 - 요청/응답 스키마 정의 (CreateOrderRequest, OrderResponse) - 에러 응답 스키마 정의 (ErrorResponse, ValidationError) - 비즈니스 규칙 및 검증 규칙 상세 문서화 - 다양한 예제 시나리오 포함 (성공/실패 케이스)
- customerId null 검증 테스트 - orderItems 빈 배열 검증 테스트 - unitPrice 0원 검증 테스트 - 검증 실패 시 UseCase 미호출 확인
- quantity 0 이하 검증 테스트 추가 - 잘못된 JSON 형식 처리 테스트 추가 - API 엣지 케이스 커버리지 강화
- OrderResponse, OrderItemResponse를 application layer로 이동 - OrderDtoMapper를 OrderMapper로 리팩토링 (request-to-command 변환) - CreateOrderUseCase가 OrderResponse 직접 반환하도록 변경 - OrderController 로직 간소화 (ProductController 스타일) - OrderResponseMapper 추가 (domain-to-response 변환) - 테스트 커버리지 개선 * monolith: ProductMapperTest 추가 (55% 달성) * order-orchestrator: OrderMapperTest 추가 (70% 달성)
|
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.




📋 PR 요약
주문 생성 API의 검증 로직 강화, 테스트 커버리지 확보, API 문서화 작업을 완료했습니다.
🔗 관련 이슈
📝 변경 사항
🛠️ 기술적 변경 사항
수정된 파일:
새로 추가된 파일:
주요 로직 변경:
🧪 테스트
테스트 커버리지: Line 100% (11/11), Branch 66.67% (2/3)
테스트 케이스:
📖 문서 업데이트
✅ 체크리스트