refactor(WEB):공정 단계 completion_type 한글→영문 코드 전환

- StepCompletionType을 영문 코드로 변경 (click_complete 등)
- STEP_COMPLETION_TYPE_LABELS 라벨 맵 추가
- StepDetail, StepForm, actions 변환 로직 적용
This commit is contained in:
2026-02-13 03:41:51 +09:00
parent ebd6abc147
commit 4644ae298d
4 changed files with 16 additions and 8 deletions

View File

@@ -32,6 +32,7 @@ import {
AlertDialogTitle,
} from '@/components/ui/alert-dialog';
import type { ProcessStep } from '@/types/process';
import { STEP_COMPLETION_TYPE_LABELS } from '@/types/process';
interface StepDetailProps {
step: ProcessStep;
@@ -149,7 +150,7 @@ export function StepDetail({ step, processId }: StepDetailProps) {
<div className="grid grid-cols-1 sm:grid-cols-2 gap-6">
<div className="space-y-1">
<div className="text-sm text-muted-foreground"></div>
<div className="font-medium">{step.completionType}</div>
<div className="font-medium">{STEP_COMPLETION_TYPE_LABELS[step.completionType] || step.completionType}</div>
</div>
</div>
</CardContent>

View File

@@ -101,7 +101,7 @@ export function StepForm({ mode, processId, initialData }: StepFormProps) {
// 완료 정보
const [completionType, setCompletionType] = useState<StepCompletionType>(
initialData?.completionType || '클릭 시 완료'
initialData?.completionType || 'click_complete'
);
// 검사 설정

View File

@@ -605,7 +605,7 @@ function transformStepApiToFrontend(apiStep: ApiProcessStep): ProcessStep {
order: apiStep.sort_order,
connectionType: (apiStep.connection_type as ProcessStep['connectionType']) || '없음',
connectionTarget: apiStep.connection_target ?? undefined,
completionType: (apiStep.completion_type as ProcessStep['completionType']) || '클릭 시 완료',
completionType: (apiStep.completion_type as ProcessStep['completionType']) || 'click_complete',
};
}

View File

@@ -172,8 +172,8 @@ export const PROCESS_CATEGORY_OPTIONS: Record<string, { value: string; label: st
// 연결 유형
export type StepConnectionType = '팝업' | '없음';
// 완료 유형
export type StepCompletionType = '선택 완료 시 완료' | '클릭 시 완료' | '검사완료 시 완료';
// 완료 유형 (코드)
export type StepCompletionType = 'selection_complete' | 'click_complete' | 'inspection_complete';
// 공정 단계 엔티티
export interface ProcessStep {
@@ -202,11 +202,18 @@ export const STEP_CONNECTION_TYPE_OPTIONS: { value: StepConnectionType; label: s
// 완료 유형 옵션
export const STEP_COMPLETION_TYPE_OPTIONS: { value: StepCompletionType; label: string }[] = [
{ value: '선택 완료 시 완료', label: '선택 완료 시 완료' },
{ value: '클릭 시 완료', label: '클릭 시 완료' },
{ value: '검사완료 시 완료', label: '검사완료 시 완료' },
{ value: 'selection_complete', label: '선택 완료 시 완료' },
{ value: 'click_complete', label: '클릭 시 완료' },
{ value: 'inspection_complete', label: '검사완료 시 완료' },
];
// 완료 유형 라벨 맵
export const STEP_COMPLETION_TYPE_LABELS: Record<StepCompletionType, string> = {
selection_complete: '선택 완료 시 완료',
click_complete: '클릭 시 완료',
inspection_complete: '검사완료 시 완료',
};
// 연결 도달 옵션
export const STEP_CONNECTION_TARGET_OPTIONS: { value: string; label: string }[] = [
{ value: '입고완료 자재 목록', label: '입고완료 자재 목록' },