feat: Items Files API 개선 - group_id 기반, 동적 field_key 지원

- GET /items/{id}/files 엔드포인트 추가 (파일 목록 조회)
- document_type을 group_id('1')로 변경 (테이블명 대신 코드 기반)
- field_key 제한 해제 (자유롭게 지정 가능)
- 품목 상세 조회 시 files 필드 포함 (field_key별 그룹핑)
- ItemFileUploadRequest FormRequest 추가
- DELETE 라우트 파라미터를 {fileId}로 변경
This commit is contained in:
2025-12-12 17:38:22 +09:00
parent b6bea99cd9
commit 2e4d4d3be3
6 changed files with 397 additions and 235 deletions

View File

@@ -33,7 +33,19 @@
* @OA\Property(property="remarks", type="string", nullable=true, example="비고", description="비고 (Material 전용)"),
* @OA\Property(property="created_at", type="string", example="2025-11-14 10:00:00"),
* @OA\Property(property="updated_at", type="string", example="2025-11-14 10:10:00"),
* @OA\Property(property="deleted_at", type="string", nullable=true, example=null, description="삭제일시 (soft delete)")
* @OA\Property(property="deleted_at", type="string", nullable=true, example=null, description="삭제일시 (soft delete)"),
* @OA\Property(
* property="files",
* type="object",
* nullable=true,
* description="첨부 파일 (field_key별 그룹핑)",
* example={"bending_diagram": {{"id": 1, "file_name": "벤딩도.pdf", "file_path": "/uploads/items/1/bending_diagram.pdf"}}, "specification": {{"id": 2, "file_name": "규격서.pdf", "file_path": "/uploads/items/1/specification.pdf"}}},
* additionalProperties=@OA\Property(
* type="array",
*
* @OA\Items(ref="#/components/schemas/ItemFile")
* )
* )
* )
*
* @OA\Schema(