fix: [build] 타입 오류 수정 (cancelledCount, lot_no)

- order-management-sales: revertProduction 결과 구조분해로 타입 추론 수정
- WorkerScreen/actions: lot_no 접근 타입 캐스트 추가
This commit is contained in:
2026-03-14 08:28:11 +09:00
parent b87b94860b
commit 156a50fd73
2 changed files with 6 additions and 6 deletions

View File

@@ -362,17 +362,17 @@ export default function OrderDetailPage() {
reason: revertReason || undefined,
});
if (result.success && result.data) {
setOrder(result.data.order);
if (result.data.deletedCounts) {
const { order: updatedOrder, deletedCounts, cancelledCount } = result.data;
setOrder(updatedOrder);
if (deletedCounts) {
// force 모드 (개발): 물리 삭제 건수
const { deletedCounts } = result.data;
toast.success(
`생산지시가 되돌려졌습니다. (작업지시 ${deletedCounts.workOrders}건, 품목 ${deletedCounts.workOrderItems}건, 결과 ${deletedCounts.workResults}건 삭제)`
);
} else {
// cancel 모드 (운영): 취소 처리 건수
const msg = result.data.cancelledCount
? `생산지시가 취소되었습니다. (${result.data.cancelledCount}건 취소)`
const msg = cancelledCount
? `생산지시가 취소되었습니다. (${cancelledCount}건 취소)`
: '생산지시가 되돌려졌습니다.';
toast.success(msg);
}

View File

@@ -244,7 +244,7 @@ export async function completeWorkOrder(
});
if (!result.success) return { success: false, error: result.error };
// 백엔드에서 생성한 실제 LOT 번호 사용
const lotNo = result.data?.lot_no || null;
const lotNo = (result.data as { lot_no?: string })?.lot_no;
return { success: true, lotNo };
}