o2o-negosium-original/negodata/front/src/lib/enumLabels.ts
Mina Choi eb6612af1c [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>
2026-06-22 17:06:26 +09:00

17 lines
530 B
TypeScript

import { DeliveryType, UserRole } from '@/api/generated/model';
export const DELIVERY_TYPE_LABEL: Record<DeliveryType, string> = {
[DeliveryType.PARTNER]: '협력사배송',
[DeliveryType.COURIER]: '지정택배배송',
[DeliveryType.PICKUP]: '픽업배송',
};
export const DELIVERY_TYPE_OPTIONS = Object.values(DeliveryType).map((value) => ({
value,
label: DELIVERY_TYPE_LABEL[value],
}));
export const USER_ROLE_LABEL: Record<UserRole, string> = {
[UserRole.USER]: '일반',
[UserRole.MANAGER]: '관리자',
};