feat(WEB): Phase 2-3 V2 마이그레이션 완료 및 ServerErrorPage 적용
Phase 2 완료 (4개): - 노무관리, 단가관리(건설), 입금, 출금 Phase 3 라우팅 구조 변경 완료 (22개): - 거래처(영업), 팝업관리, 공정관리, 게시판관리, 대손추심, Q&A - 현장관리, 실행내역, 견적관리, 견적(테스트) - 입찰관리, 이슈관리, 현장설명회, 견적서(건설) - 협력업체, 시공관리, 기성관리, 품목관리(건설) - 회계 도메인: 거래처, 매출, 세금계산서, 매입 신규 컴포넌트: - ErrorCard: 에러 페이지 UI 통일 - ServerErrorPage: V2 페이지 에러 처리 필수 - V2 Client 컴포넌트 및 Config 파일들 총 47개 상세 페이지 중 28개 완료, 19개 제외/불필요 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -181,6 +181,29 @@ export const INITIAL_CLIENT_FORM: ClientFormData = {
|
||||
// 데이터 변환 유틸리티
|
||||
// ============================================
|
||||
|
||||
// 거래처 유형 매핑 (API → Frontend)
|
||||
const CLIENT_TYPE_MAP: Record<string, ClientType> = {
|
||||
'PURCHASE': '매입',
|
||||
'SALES': '매출',
|
||||
'BOTH': '매입매출',
|
||||
'매입': '매입',
|
||||
'매출': '매출',
|
||||
'매입매출': '매입매출',
|
||||
};
|
||||
|
||||
// 거래처 유형 역매핑 (Frontend → API)
|
||||
const CLIENT_TYPE_REVERSE_MAP: Record<ClientType, string> = {
|
||||
'매입': 'PURCHASE',
|
||||
'매출': 'SALES',
|
||||
'매입매출': 'BOTH',
|
||||
};
|
||||
|
||||
// 거래처 유형 변환 (API → Frontend)
|
||||
function mapClientType(apiValue: string | undefined): ClientType {
|
||||
if (!apiValue) return '매입';
|
||||
return CLIENT_TYPE_MAP[apiValue] || '매입';
|
||||
}
|
||||
|
||||
// API 응답 → 프론트엔드 타입 변환
|
||||
export function transformClientFromApi(api: ClientApiResponse): Client {
|
||||
return {
|
||||
@@ -198,7 +221,7 @@ export function transformClientFromApi(api: ClientApiResponse): Client {
|
||||
status: api.is_active ? "활성" : "비활성",
|
||||
groupId: api.client_group_id ? String(api.client_group_id) : null,
|
||||
// 2차 추가 필드
|
||||
clientType: api.client_type || "매입",
|
||||
clientType: mapClientType(api.client_type),
|
||||
mobile: api.mobile || "",
|
||||
fax: api.fax || "",
|
||||
managerName: api.manager_name || "",
|
||||
@@ -236,7 +259,7 @@ export function transformClientToApiCreate(form: ClientFormData): Record<string,
|
||||
client_group_id: form.groupId ? Number(form.groupId) : null,
|
||||
is_active: form.isActive,
|
||||
// 2차 추가 필드
|
||||
client_type: form.clientType,
|
||||
client_type: CLIENT_TYPE_REVERSE_MAP[form.clientType] || form.clientType,
|
||||
mobile: form.mobile || null,
|
||||
fax: form.fax || null,
|
||||
manager_name: form.managerName || null,
|
||||
@@ -273,7 +296,7 @@ export function transformClientToApiUpdate(form: ClientFormData): Record<string,
|
||||
client_group_id: form.groupId ? Number(form.groupId) : null,
|
||||
is_active: form.isActive,
|
||||
// 2차 추가 필드
|
||||
client_type: form.clientType,
|
||||
client_type: CLIENT_TYPE_REVERSE_MAP[form.clientType] || form.clientType,
|
||||
mobile: form.mobile || null,
|
||||
fax: form.fax || null,
|
||||
manager_name: form.managerName || null,
|
||||
|
||||
Reference in New Issue
Block a user