임동욱 임동욱 08-21
merge: 포인트 이벤트 공통코드 확정
@1ed303fad04cafc8b04266ed5a70c41926eaa3e5
app/(protected)/(basic)/points/standards/_components/point-standard-form-modal.tsx
--- app/(protected)/(basic)/points/standards/_components/point-standard-form-modal.tsx
+++ app/(protected)/(basic)/points/standards/_components/point-standard-form-modal.tsx
@@ -17,7 +17,7 @@
   INITIAL_POINT_STANDARD_FORM_STATE,
 } from '@/lib/domain/point-standard-form';
 import type { PointStandard } from '@/lib/domain/point-standard';
-import type { CommonCode } from '@/lib/domain/common-code';
+import { formatCommonCode, type CommonCode } from '@/lib/domain/common-code';
 import {
   createPointStandardAction,
   updatePointStandardAction,
@@ -113,12 +113,13 @@
               hint={errors.eventCode}
             />
           ) : (
-            // 기획 ① 이벤트행은 수정불가(Read Only).
+            // 기획 ① 이벤트행은 수정불가(Read Only). 보이는 것은 코드명이고 저장되는 값은
+            // 위 hidden의 코드값이다.
             <FoxInput
               size="md"
               label="이벤트"
               requirement="required"
-              value={eventCode}
+              value={formatCommonCode(eventCodes, eventCode)}
               readOnly
               state="view"
             />
app/(protected)/(basic)/points/standards/_components/point-standard-list.tsx
--- app/(protected)/(basic)/points/standards/_components/point-standard-list.tsx
+++ app/(protected)/(basic)/points/standards/_components/point-standard-list.tsx
@@ -19,7 +19,7 @@
   formatPoint,
   type PointStandard,
 } from '@/lib/domain/point-standard';
-import type { CommonCode } from '@/lib/domain/common-code';
+import { formatCommonCode, type CommonCode } from '@/lib/domain/common-code';
 import {
   POINT_STANDARDS_PATH,
   POINT_STANDARD_PAGE_SIZE_OPTIONS,
@@ -62,7 +62,14 @@
       width: 80,
       render: (_row, index) => (currentPage - 1) * query.pageSize + index + 1,
     },
-    { key: 'eventCode', header: '이벤트/구분', width: 140, emphasis: true },
+    {
+      key: 'eventCode',
+      header: '이벤트/구분',
+      width: 140,
+      emphasis: true,
+      // 표에 없는 코드는 지어내지 않고 코드 그대로 보여준다(formatCommonCode 규칙).
+      render: (row) => formatCommonCode(eventCodes, row.eventCode),
+    },
     {
       key: 'point',
       header: '포인트',
lib/domain/common-code.ts
--- lib/domain/common-code.ts
+++ lib/domain/common-code.ts
@@ -25,9 +25,8 @@
   inquiryAnswerStatus: 'BBS_ANS_CD',
   /** FAQ 유형. */
   faqType: 'BBS_FAQ_CD',
-  // TODO: 포인트 지급기준의 「이벤트」 — 기획이 "등록된 코드중에서 선택"이라 코드관리와 엮인다.
-  // 실제 그룹ID를 받지 못해 잠정값이다. 모르는 그룹은 빈 목록으로 와서 선택지가 비어 보인다.
-  pointEvent: 'EVENT_CD',
+  /** 포인트 지급기준의 「이벤트」 — 기획 "등록된 코드중에서 선택"(사용자 확정). */
+  pointEvent: 'COM_EVENT_CD',
   /** 학교(학교급). */
   school: 'COM_SCHUL_CD',
   /** 학년. 학교마다 다르므로 `atrbNm`에 학교 코드를 넣어 조회한다. */
Add a comment
List