feat: 품목관리 기능 개선 및 문서화 업데이트

- 품목 상세/수정 페이지 파일 다운로드 기능 개선
- DynamicItemForm 파일 업로드 UI/UX 개선 (시방서, 인정서)
- BendingDiagramSection 조립/절곡 부품 전개도 통합
- API proxy route 품목 타입별 라우팅 개선
- ItemListClient 파일 다운로드 유틸리티 적용
- 품목코드 중복 체크 및 다이얼로그 추가

문서화:
- DynamicItemForm 훅 분리 계획서 추가 (2161줄 → 900줄 목표)
- 백엔드 API 마이그레이션 문서 추가
- 대용량 파일 처리 전략 가이드 추가
- 테넌트 데이터 격리 감사 문서 추가

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
byeongcheolryu
2025-12-16 11:01:25 +09:00
parent 8457dba0fc
commit b1587071f2
25 changed files with 3905 additions and 183 deletions

View File

@@ -434,25 +434,27 @@ export async function uploadItemFile(
}
/**
* 품목 파일 삭제 (ID 기반, 프록시 사용)
* 품목 파일 삭제 (파일 ID 기반, 프록시 사용)
*
* @param itemId - 품목 ID (숫자)
* @param fileType - 파일 유형 (specification, certification, bending_diagram)
* @param fileId - 파일 ID (files 테이블의 id)
* @param itemType - 품목 유형 (FG, PT, SM 등) - 기본값 'FG'
*
* @example
* await deleteItemFile(123, 'specification');
* await deleteItemFile(123, 456, 'FG');
*/
export async function deleteItemFile(
itemId: number,
fileType: ItemFileType
): Promise<{ file_type: string; deleted: boolean; product: Record<string, unknown> }> {
// 프록시 경유: /api/proxy/items/{id}/files/{type} → /api/v1/items/{id}/files/{type}
const response = await fetch(`/api/proxy/items/${itemId}/files/${fileType}`, {
fileId: number,
itemType: string = 'FG'
): Promise<{ file_id: number; deleted: boolean }> {
// 프록시 경유: /api/proxy/items/{id}/files/{fileId} → /api/v1/items/{id}/files/{fileId}
const response = await fetch(`/api/proxy/items/${itemId}/files/${fileId}?item_type=${itemType}`, {
method: 'DELETE',
credentials: 'include',
});
const data = await handleApiResponse<ApiResponse<{ file_type: string; deleted: boolean; product: Record<string, unknown> }>>(response);
const data = await handleApiResponse<ApiResponse<{ file_id: number; deleted: boolean }>>(response);
return data.data;
}