feat: 유효하지 않은 상태 전이 차단을 위한 결제 상태 머신 추가 - #419
Merged
Merged
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
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 설명
Payment.updateStatus()가 인자로 받은 상태를 그대로 대입해, 엔티티 차원에서 아무 상태에서 아무 상태로의 전이가 가능했습니다.
즉, SUCCESS(포인트 지급 완료) 결제를 FAILED로 덮어쓰거나 CANCELED를 SUCCESS로 되돌리는 등 원장을 오염시키는 전이가 막혀 있지 않았습니다.
이에 허용된 전이 규칙을 PaymentStatus에 만들고, 엔티티의 전이 메서드가 이를 강제하도록 상태 머신을 도입했습니다.
🏗 작업 내용
📸 테스트 결과 (선택)
🔗 관련 이슈 (선택)
🚨 참고 사항 (선택)