[refactor] negodata: 도메인 코드값 enum 정비 — 백엔드 정본 + 프론트 생성타입 사용
- 백엔드: 도메인 enum CodeEnum 상속(x-enum-varnames) → orval이 이름 있는 enum 생성. 응답 필드 enum 타입 지정(요청은 int 유지). ENUM_LABELS/DOMAIN_ENUMS·/v1/enums 제거 - 프론트: 생성 enum + 라벨맵으로 교체(매직넘버·발명 어휘 제거), 견적·세션 상태 코드화, role/delivery 라벨 프론트 소유 - 동반 정리: unwrap 캐스트·목업(buildSessions·데모)·死코드 제거, mapItem toMinPrice dedupe Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
6fa024137f
commit
eb6612af1c
47 files changed
+501
-581
No files matched your search
@@ -7,6 +7,8 @@ import {
|
||||
import type {ResMe} from '../../api/generated/model/resMe';
|
||||
import type {ErrorInfo} from '../../api/generated/model/errorInfo';
|
||||
import {useAuthStore, type AuthUser, type UserRole} from '../../stores/auth';
|
||||
import {UserRole as UserRoleCode} from '../../api/generated/model';
|
||||
import {USER_ROLE_LABEL} from '../../lib/enumLabels';
|
||||
|
||||
const ACCESS_KEY = 'negodata.accessToken';
|
||||
const REFRESH_KEY = 'negodata.refreshToken';
|
||||
@@ -26,7 +28,7 @@ function toAuthUser(me: ResMe): AuthUser {
|
||||
loginId: me.id ?? '',
|
||||
email: me.email ?? '',
|
||||
contact: me.contact_number ?? '',
|
||||
role: (me.role_label as UserRole) || '일반',
|
||||
role: (USER_ROLE_LABEL[me.role ?? UserRoleCode.USER] ?? '일반') as UserRole,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user