fix: 코드 시드의 색·표시명을 지금 화면과 일치시킴
시드를 쓸 때 화면 소스를 안 보고 의미만으로 색을 골랐던 탓에 두 가지가 어긋나 있었다.
Phase 2에서 화면이 코드테이블을 보게 되면 조용히 바뀔 값들이다.
업무구간 색 assign violet->indigo, check sky->emerald, closing emerald->violet
담당자 구분 MJ 표시명 주관기관->문정원 (주관기관은 엑셀 표기라 importAlias로)
뱃지색 5개 전부 화면 기준으로 교정
이미 적용된 V13을 고치면 체크섬이 어긋나 기동이 실패하므로 V15로 앞으로 나아가며 고친다.
어긋남이 다시 생기지 않도록 화면 기준값을 테스트로 잠갔다.
STAGE_GROUP의 cardBody 속성은 뺐다. 칸반 카드 본문은 구간이 아니라 단계 번호로 갈리는
자리가 있어(1단계는 신청일, 2·3단계는 목록 건수) 화면 로직으로 두는 편이 정확하다.
Co-Authored-By: Claude Opus 5 (1M context)
@3e8bab805aa3833f8b226def5ec6a749df00ce27
+++ src/main/resources/db/migration/V15__common_code_fix_display.sql
... | ... | @@ -0,0 +1,37 @@ |
| 1 | +-- V13 시드의 화면 관련 값 두 가지가 실제 화면과 달랐다. Phase 2에서 화면이 코드테이블을 | |
| 2 | +-- 보게 되면 색과 표시명이 조용히 바뀌므로, 지금 값으로 맞춘다. | |
| 3 | +-- | |
| 4 | +-- V13을 직접 고치지 않는 이유: 이미 적용된 마이그레이션을 수정하면 체크섬이 어긋나 | |
| 5 | +-- 다음 기동이 실패한다. 앞으로 나아가는 수정본을 따로 둔다. | |
| 6 | +-- | |
| 7 | +-- 발견 경위: 시드를 넣고 나서 화면 소스의 색 정의와 대조해 보니 어긋나 있었다. | |
| 8 | +-- 시드를 쓸 때 화면을 안 보고 의미만으로 색을 골랐던 것이 원인이다. | |
| 9 | + | |
| 10 | +-- (1) 업무구간 색. 기준은 Dashboard.tsx의 GROUP_COLOR(칸반 컬럼 색 띠)다. | |
| 11 | +-- assign은 indigo, check는 emerald, closing은 violet이 맞다. | |
| 12 | +-- cardBody 속성은 뺀다 - 칸반 카드 본문은 구간이 아니라 단계 번호로 갈리는 자리가 있어 | |
| 13 | +-- (1단계는 신청일만, 2·3단계는 목록 건수) 화면 로직으로 두는 편이 정확하다. | |
| 14 | +update code set attrs = '{"tone":"slate"}'::jsonb where group_id = 'STAGE_GROUP' and code = 'intake'; | |
| 15 | +update code set attrs = '{"tone":"indigo"}'::jsonb where group_id = 'STAGE_GROUP' and code = 'assign'; | |
| 16 | +update code set attrs = '{"tone":"emerald"}'::jsonb where group_id = 'STAGE_GROUP' and code = 'check'; | |
| 17 | +update code set attrs = '{"tone":"amber"}'::jsonb where group_id = 'STAGE_GROUP' and code = 'process'; | |
| 18 | +update code set attrs = '{"tone":"violet"}'::jsonb where group_id = 'STAGE_GROUP' and code = 'closing'; | |
| 19 | + | |
| 20 | +update code_group set description = '칸반 컬럼 색을 결정한다' | |
| 21 | + where group_id = 'STAGE_GROUP'; | |
| 22 | + | |
| 23 | +-- (2) 담당자 구분. MJ는 화면에 '문정원'으로 나오는데 시드에 '주관기관'을 넣었다. | |
| 24 | +-- '주관기관'은 담당자 명부 엑셀에만 쓰이는 표기라 importAlias 자리로 간다. | |
| 25 | +-- 뱃지 색 기준은 ContactsPage.tsx의 CATEGORY_BADGE_STYLES다. | |
| 26 | +update code set label = '문정원' where group_id = 'CONTACT_CATEGORY' and code = 'MJ'; | |
| 27 | + | |
| 28 | +update code set attrs = attrs || '{"tone":"blue"}'::jsonb | |
| 29 | + where group_id = 'CONTACT_CATEGORY' and code = 'APPLICANT'; | |
| 30 | +update code set attrs = attrs || '{"tone":"emerald"}'::jsonb | |
| 31 | + where group_id = 'CONTACT_CATEGORY' and code = 'MJ'; | |
| 32 | +update code set attrs = attrs || '{"tone":"violet"}'::jsonb | |
| 33 | + where group_id = 'CONTACT_CATEGORY' and code = 'LAWYER'; | |
| 34 | +update code set attrs = attrs || '{"tone":"sky"}'::jsonb | |
| 35 | + where group_id = 'CONTACT_CATEGORY' and code = 'OPERATOR'; | |
| 36 | +update code set attrs = attrs || '{"tone":"orange"}'::jsonb | |
| 37 | + where group_id = 'CONTACT_CATEGORY' and code = 'ITN'; |
--- src/test/java/kr/itn/itnhub/code/CodeSeedTest.java
+++ src/test/java/kr/itn/itnhub/code/CodeSeedTest.java
... | ... | @@ -159,6 +159,68 @@ |
| 159 | 159 |
assertThat(empty).isZero(); |
| 160 | 160 |
} |
| 161 | 161 |
|
| 162 |
+ /** |
|
| 163 |
+ * tone은 화면에 실제로 쓰이는 색과 같아야 한다. 다르면 Phase 2에서 화면 색이 조용히 바뀐다. |
|
| 164 |
+ * 기준: Dashboard.tsx의 GROUP_COLOR(칸반 컬럼 색 띠). |
|
| 165 |
+ */ |
|
| 166 |
+ @Test |
|
| 167 |
+ void 업무구간_색이_지금_화면과_같다() {
|
|
| 168 |
+ assertThat(tone("STAGE_GROUP", "intake")).isEqualTo("slate");
|
|
| 169 |
+ assertThat(tone("STAGE_GROUP", "assign")).isEqualTo("indigo");
|
|
| 170 |
+ assertThat(tone("STAGE_GROUP", "check")).isEqualTo("emerald");
|
|
| 171 |
+ assertThat(tone("STAGE_GROUP", "process")).isEqualTo("amber");
|
|
| 172 |
+ assertThat(tone("STAGE_GROUP", "closing")).isEqualTo("violet");
|
|
| 173 |
+ } |
|
| 174 |
+ |
|
| 175 |
+ /** 기준: ContactsPage.tsx의 CATEGORY_BADGE_STYLES. */ |
|
| 176 |
+ @Test |
|
| 177 |
+ void 담당자구분_색이_지금_화면과_같다() {
|
|
| 178 |
+ assertThat(tone("CONTACT_CATEGORY", "APPLICANT")).isEqualTo("blue");
|
|
| 179 |
+ assertThat(tone("CONTACT_CATEGORY", "MJ")).isEqualTo("emerald");
|
|
| 180 |
+ assertThat(tone("CONTACT_CATEGORY", "LAWYER")).isEqualTo("violet");
|
|
| 181 |
+ assertThat(tone("CONTACT_CATEGORY", "OPERATOR")).isEqualTo("sky");
|
|
| 182 |
+ assertThat(tone("CONTACT_CATEGORY", "ITN")).isEqualTo("orange");
|
|
| 183 |
+ } |
|
| 184 |
+ |
|
| 185 |
+ /** 기준: ReviewBoard.tsx의 REVIEW_RESULT_BADGE_STYLES. */ |
|
| 186 |
+ @Test |
|
| 187 |
+ void 처리결과_색이_지금_화면과_같다() {
|
|
| 188 |
+ assertThat(tone("REVIEW_RESULT", "신유형 개방")).isEqualTo("emerald");
|
|
| 189 |
+ assertThat(tone("REVIEW_RESULT", "계약서 등 재확인")).isEqualTo("amber");
|
|
| 190 |
+ assertThat(tone("REVIEW_RESULT", "권리처리 추진")).isEqualTo("blue");
|
|
| 191 |
+ assertThat(tone("REVIEW_RESULT", "권리처리 추진 미희망")).isEqualTo("slate");
|
|
| 192 |
+ assertThat(tone("REVIEW_RESULT", "개방불가")).isEqualTo("red");
|
|
| 193 |
+ } |
|
| 194 |
+ |
|
| 195 |
+ /** |
|
| 196 |
+ * MJ는 화면에 '문정원'으로 나오지만 담당자 명부 엑셀에는 '주관기관'으로 적혀 온다. |
|
| 197 |
+ * 이 둘을 헷갈리면 화면 표시가 바뀌거나 엑셀 업로드가 깨진다. |
|
| 198 |
+ */ |
|
| 199 |
+ @Test |
|
| 200 |
+ void 담당자구분은_화면표시와_엑셀표기를_따로_갖는다() {
|
|
| 201 |
+ assertThat(label("CONTACT_CATEGORY", "MJ")).isEqualTo("문정원");
|
|
| 202 |
+ assertThat(attr("CONTACT_CATEGORY", "MJ", "importAlias")).isEqualTo("주관기관");
|
|
| 203 |
+ // 나머지는 화면표시와 엑셀표기가 같다. |
|
| 204 |
+ assertThat(label("CONTACT_CATEGORY", "LAWYER")).isEqualTo("변호사");
|
|
| 205 |
+ assertThat(attr("CONTACT_CATEGORY", "LAWYER", "importAlias")).isEqualTo("변호사");
|
|
| 206 |
+ } |
|
| 207 |
+ |
|
| 208 |
+ private String tone(String groupId, String code) {
|
|
| 209 |
+ return attr(groupId, code, "tone"); |
|
| 210 |
+ } |
|
| 211 |
+ |
|
| 212 |
+ private String attr(String groupId, String code, String key) {
|
|
| 213 |
+ return jdbc.queryForObject( |
|
| 214 |
+ "select attrs->>? from code where group_id = ? and code = ?", |
|
| 215 |
+ String.class, key, groupId, code); |
|
| 216 |
+ } |
|
| 217 |
+ |
|
| 218 |
+ private String label(String groupId, String code) {
|
|
| 219 |
+ return jdbc.queryForObject( |
|
| 220 |
+ "select label from code where group_id = ? and code = ?", |
|
| 221 |
+ String.class, groupId, code); |
|
| 222 |
+ } |
|
| 223 |
+ |
|
| 162 | 224 |
@Test |
| 163 | 225 |
void 그룹마다_정렬순서가_중복되지_않는다() {
|
| 164 | 226 |
Integer dup = jdbc.queryForObject( |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?