템플릿 메타데이터를 표시용 정보로 단순화한다#99
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.
개요
템플릿의
gameType, 선수의position을 도메인 규칙이 아니라 FE가 관리하는 표시용 메타데이터로 재정의했습니다. 기존에는 템플릿/방/게임 전반에서 이 값들이 규칙 검증과 제약 계산에 섞여 있었고, 특히positionLimit까지 경매 규칙으로 사용되면서 화면 표현을 위한 값이 서버 도메인 제약으로 승격되어 있었습니다.이번 변경은 메타데이터와 실제 게임 규칙을 분리하는 데 목적이 있습니다. 서버는 더 이상
gameType과position의 허용값을 해석하거나 강제하지 않고, FE가 내려주는 문자열을 저장해서 템플릿/로비/게임 응답으로 그대로 전달합니다.AS-IS
gameType이 enum 기반 도메인 값이었고 템플릿 생성 시 허용값이 강제됐습니다.position도 정규화/검증 대상이었고, 경매에서는positionLimit과 결합되어 실제 입찰 거부 규칙으로 사용됐습니다.GET /api/v1/templates는 요약 응답이라 FE가 카드 렌더링을 위해 추가 상세 조회를 해야 했습니다.position_limit이 남아 있어 메타데이터와 규칙의 경계가 불분명했습니다.TO-BE
gameType은 nullableString메타데이터로 저장/전달합니다.position은 nullable/blank 허용 메타데이터로 저장/전달합니다.positionLimit은 템플릿/방/게임 도메인과 API, 스키마에서 제거합니다.GET /api/v1/templates는 FE가 한 번에 카드 렌더링을 끝낼 수 있도록 상세형 메타데이터를 포함해 응답합니다.gameType메타데이터가 room/game 응답으로 이어지도록 전달 경로를 추가했습니다.주요 변경사항
gameType을 규칙이 아닌 aggregate 메타데이터로 이동했습니다.positionLimit을 제거하고,gameType/position을 자유 문자열 메타데이터로 완화했습니다.positionLimit기반 입찰 제한 로직을 제거했습니다.gameType메타데이터를 노출하도록 확장했습니다.game_type컬럼을 room/game에 추가하고,position_limit제거 및 nullable 제약 변경을 반영했습니다.주의할 점
gameType의 원천 데이터가 없어null로 남을 수 있습니다.gameType은 optional metadata로 취급하므로, legacy 데이터에 대해서도null을 허용하는 방향으로 정리했습니다.검증
./gradlew test./gradlew integrationTest./gradlew check리뷰 포인트
positionLimit제거가 현재 제품 의도와 맞는지GET /api/v1/templates를 상세형 목록으로 확장한 결정이 FE 소비 방식과 맞는지gameType = null허용이 optional metadata 정책과 맞는지