Skip to content

[FIX] 자재 구매 주문 코드 형식 수정#4

Merged
taemin3 merged 1 commit into
mainfrom
SPM-471
Nov 9, 2025
Merged

[FIX] 자재 구매 주문 코드 형식 수정#4
taemin3 merged 1 commit into
mainfrom
SPM-471

Conversation

@taemin3
Copy link
Copy Markdown
Contributor

@taemin3 taemin3 commented Nov 9, 2025

📝 Summary

  • [FIX] 자재 구매 주문 코드 형식 수정

🙏 Question & PR point

📬 Reference

Summary by CodeRabbit

변경사항

  • 개선사항
    • 주문 번호의 생성 형식이 업데이트되었습니다. 새로운 접두사와 간소화된 날짜 표기 형식이 적용되어 주문 코드가 이전과 다르게 표시됩니다. 이를 통해 주문 관리가 더욱 효율적으로 처리됩니다.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Nov 9, 2025

워크스루

PurchaseService.java의 주문 코드 생성 로직이 변경되었습니다. 날짜 형식이 YYYY에서 YYMMDD로 수정되었으며, 코드 접두사가 "ORD-"에서 "PR-"로 변경되었습니다. 나머지 배송 예상일 계산, 엔티티 생성, 이벤트 발생 로직은 유지됩니다.

변경사항

통합 / 파일 변경 요약
주문 코드 생성 로직 수정
src/main/java/com/sampoom/purchase/api/purchase/service/PurchaseService.java
generateOrderCode() 메서드에서 날짜 형식을 YYYY에서 YYMMDD("yyMMdd")로 변경하고, 코드 접두사를 "ORD-"에서 "PR-"로 수정. 기존 코드 조회 시 예상 코드 접두사도 함께 업데이트됨

예상 코드 리뷰 난이도

🎯 2 (단순) | ⏱️ ~10분

  • 단일 메서드의 문자열 포맷 및 접두사 변경으로, 논리적 복잡도가 낮음
  • 변경 사항이 일관되고 명확하며 국소화됨
  • 기존 날짜 형식이 다른 부분에 영향을 미치지 않는지 확인 필요

리뷰 제안자

  • Sangyoon98
  • Lee-Jong-Jin
  • yangjiseonn
  • vivivim

🐰 주문 코드 새로 단장했네,
PR이 데려온 변신의 날,
YYMMDD로 더 짧아졌고,
주머니 속 코드는 더 가뿐하네!
Hoppy coding, hop hop! 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목은 주문 코드 형식 수정이라는 변경사항의 핵심을 명확하게 요약하고 있으며, 코드 변경 내용(YYMMDD 형식, PR- 접두사)과 직접적으로 관련이 있습니다.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch SPM-471

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6861d57 and 7fb78cc.

📒 Files selected for processing (1)
  • src/main/java/com/sampoom/purchase/api/purchase/service/PurchaseService.java (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (java-kotlin)
🔇 Additional comments (1)
src/main/java/com/sampoom/purchase/api/purchase/service/PurchaseService.java (1)

268-288: 추가 검증을 위해 다음 스크립트들을 실행하겠습니다:

주문 코드 형식 변경 사항 검증 완료 - 코드 레벨에서 문제 없음

코드베이스 전체 검색 결과, 기존 "ORD-" 프리픽스에 대한 참조가 없는 것으로 확인되었습니다.

변경사항 검증:

  • Spring Data JPA의 StartingWith 프레디케이트는 LIKE 와일드카드를 자동으로 이스케이프하여 리터럴로 매칭합니다.
  • 274번 줄의 쿼리 메서드 findTopByCodeStartingWithOrderByCodeDesc(prefix)는 올바르게 동작합니다.
  • 새로운 "PR-" 프리픽스는 코드베이스 내에서 다른 곳과 충돌하지 않습니다.

주의사항:
이 변경사항은 기존 데이터베이스에 저장된 "ORD-" 프리픽스를 가진 주문들과는 독립적으로 작동합니다. 데이터 마이그레이션이 필요한 경우 Flyway나 Liquibase를 통한 데이터베이스 마이그레이션 스크립트로 별도 처리되어야 하며, 이는 본 코드 리뷰 범위 밖입니다.

코드 자체는 기술적으로 정확하고 호환성 문제가 없으므로, 데이터베이스 마이그레이션 계획이 수립되어 있다면 배포 가능합니다.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@Lee-Jong-Jin Lee-Jong-Jin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR

@taemin3 taemin3 merged commit ff72fe5 into main Nov 9, 2025
7 checks passed
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.

2 participants