-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat] Store 에 district 컬럼 추가 #154
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
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| package eatda.domain.store; | ||
|
|
||
| import java.util.Arrays; | ||
| import lombok.Getter; | ||
|
|
||
| @Getter | ||
| public enum District { | ||
|
|
||
| GANGNAM("강남구"), | ||
| GANGDONG("강동구"), | ||
| GANGBUK("강북구"), | ||
| GANGSEO("강서구"), | ||
| GWANAK("관악구"), | ||
| GWANGJIN("광진구"), | ||
| GURO("구로구"), | ||
| GEUMCHEON("금천구"), | ||
| NOWON("노원구"), | ||
| DOBONG("도봉구"), | ||
| DONGDAEMUN("동대문구"), | ||
| DONGJAK("동작구"), | ||
| MAPO("마포구"), | ||
| SEODAEMUN("서대문구"), | ||
| SEOCHO("서초구"), | ||
| SEONGDONG("성동구"), | ||
| SEONGBUK("성북구"), | ||
| SONGPA("송파구"), | ||
| YANGCHEON("양천구"), | ||
| YEONGDEUNGPO("영등포구"), | ||
| YONGSAN("용산구"), | ||
| EUNPYEONG("은평구"), | ||
| JONGNO("종로구"), | ||
| JUNG("중구"), | ||
| JUNGNANG("중랑구"), | ||
| ETC("기타"), | ||
| ; | ||
|
|
||
| private final String name; | ||
|
|
||
| District(String name) { | ||
| this.name = name; | ||
| } | ||
|
|
||
| public static District fromName(String name) { | ||
| return Arrays.stream(District.values()) | ||
| .filter(district -> district.name.equals(name)) | ||
| .findFirst() | ||
| .orElse(ETC); | ||
| } | ||
| } |
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| package eatda.domain.store; | ||
|
|
||
| import static org.assertj.core.api.Assertions.assertThat; | ||
|
|
||
| import org.junit.jupiter.api.Nested; | ||
| import org.junit.jupiter.params.ParameterizedTest; | ||
| import org.junit.jupiter.params.provider.CsvSource; | ||
| import org.junit.jupiter.params.provider.ValueSource; | ||
|
|
||
| class DistrictTest { | ||
|
|
||
| @Nested | ||
| class FromName { | ||
|
|
||
| @CsvSource({"강남구, GANGNAM", "강동구, GANGDONG", "강북구, GANGBUK", "강서구, GANGSEO", "관악구, GWANAK", | ||
| "광진구, GWANGJIN", "구로구, GURO", "금천구, GEUMCHEON", "노원구, NOWON", "도봉구, DOBONG", | ||
| "동대문구, DONGDAEMUN", "동작구, DONGJAK", "마포구, MAPO", "서대문구, SEODAEMUN", "서초구, SEOCHO", | ||
| "성동구, SEONGDONG", "성북구, SEONGBUK", "송파구, SONGPA", "양천구, YANGCHEON", "영등포구, YEONGDEUNGPO", | ||
| "용산구, YONGSAN", "은평구, EUNPYEONG", "종로구, JONGNO", "중구, JUNG", "중랑구, JUNGNANG"}) | ||
| @ParameterizedTest | ||
| void 구_이름을_통해_해당_구를_반환한다(String name, District expected) { | ||
| District actual = District.fromName(name); | ||
|
|
||
| assertThat(actual).isEqualTo(expected); | ||
| } | ||
|
|
||
| @ValueSource(strings = {"서구", "사사구", "기구", ""}) | ||
| @ParameterizedTest | ||
| void 구_이름이_존재하지_않으면_ETC를_반환한다(String name) { | ||
| District actual = District.fromName(name); | ||
|
|
||
| assertThat(actual).isEqualTo(District.ETC); | ||
| } | ||
| } | ||
| } |
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이미 배포된 초기 마이그레이션(V1)을 수정하지 마세요 — 신규 마이그레이션으로 분리 필요
운영/공용 DB에 V1이 적용된 상태에서 V1__init.sql을 수정하면 마이그레이션 불일치가 발생합니다.
store.district추가는 신규 마이그레이션(예:V2__add_store_district.sql)으로 처리하세요.권장 절차:
예시(DDL):
또한, 현재 PR에서 dev/local seed는 district 컬럼을 전제로 작성되어 있으므로, 새 마이그레이션 추가 후 적용 순서가 보장되도록 스크립트/파이프라인을 점검해주세요.
🤖 Prompt for AI Agents