feat(item-master): 잠금 기능 추가 및 FK 레거시 코드 정리

## 잠금 기능 (Lock Feature)
- entity_relationships 테이블에 is_locked, locked_by, locked_at 컬럼 추가
- EntityRelationship 모델에 잠금 관련 헬퍼 메서드 추가
- LockCheckTrait 생성 (destroy 시 잠금 체크 공통 로직)
- 각 Service의 destroy() 메서드에 잠금 체크 적용
- API 응답에 is_locked 필드 포함
- 한국어 에러 메시지 추가

## FK 레거시 코드 정리
- ItemMasterSeeder: entity_relationships 기반으로 전환
- ItemPage 모델: FK 기반 sections() 관계 제거
- ItemSectionService: clone() 메서드 FK 제거
- SectionTemplateService: page_id 컬럼 참조 제거
- EntityRelationship::link() 파라미터 순서 통일

## 기타
- Swagger 스키마에 is_locked 속성 추가
- 프론트엔드 가이드 문서 추가
This commit is contained in:
2025-11-27 15:51:00 +09:00
parent 29fe1415e5
commit efa2a84d2c
35 changed files with 537 additions and 142 deletions

View File

@@ -42,6 +42,7 @@
* @OA\Property(property="order_no", type="integer", example=0),
* @OA\Property(property="is_template", type="boolean", example=false, description="템플릿 여부"),
* @OA\Property(property="is_default", type="boolean", example=false, description="기본 템플릿 여부"),
* @OA\Property(property="is_locked", type="boolean", example=false, description="연결 잠금 여부 (init API 응답 시 포함)"),
* @OA\Property(property="description", type="string", nullable=true, example="섹션 설명"),
* @OA\Property(property="created_at", type="string", example="2025-11-20 10:00:00"),
* @OA\Property(property="updated_at", type="string", example="2025-11-20 10:00:00"),
@@ -53,7 +54,7 @@
* ),
*
* @OA\Property(
* property="bomItems",
* property="bom_items",
* type="array",
*
* @OA\Items(ref="#/components/schemas/ItemBomItem")
@@ -72,6 +73,7 @@
* @OA\Property(property="field_type", type="string", enum={"textbox","number","dropdown","checkbox","date","textarea"}, example="textbox"),
* @OA\Property(property="order_no", type="integer", example=0),
* @OA\Property(property="is_required", type="boolean", example=true),
* @OA\Property(property="is_locked", type="boolean", example=false, description="연결 잠금 여부 (init API 응답 시 포함)"),
* @OA\Property(property="default_value", type="string", nullable=true, example=null),
* @OA\Property(property="placeholder", type="string", nullable=true, example="제품명을 입력하세요"),
* @OA\Property(property="display_condition", type="object", nullable=true, example=null),
@@ -101,6 +103,7 @@
* @OA\Property(property="total_price", type="number", format="float", nullable=true, example=15000),
* @OA\Property(property="spec", type="string", nullable=true, example="규격 정보"),
* @OA\Property(property="note", type="string", nullable=true, example="비고"),
* @OA\Property(property="is_locked", type="boolean", example=false, description="연결 잠금 여부 (init API 응답 시 포함)"),
* @OA\Property(property="created_at", type="string", example="2025-11-20 10:00:00"),
* @OA\Property(property="updated_at", type="string", example="2025-11-20 10:00:00")
* )

View File

@@ -78,15 +78,16 @@ class ItemsFileApi
* property="bending_details",
* type="array",
* description="절곡 상세 정보 (bending_diagram 타입일 때만)",
*
* @OA\Items(
* type="object",
* required={"angle", "length", "type"},
*
* @OA\Property(property="angle", type="number", format="float", example=90, description="절곡 각도"),
* @OA\Property(property="length", type="number", format="float", example=100.5, description="절곡 길이"),
* @OA\Property(property="type", type="string", example="V형", description="절곡 타입")
* )
* ),
*
* @OA\Property(
* property="certification_number",
* type="string",