feat: item_fields 테이블에 is_active 컬럼 추가
- 마이그레이션: is_active 컬럼 추가 (기본값 true) - ItemField 모델: fillable, casts에 is_active 추가 - ItemFieldService: store, storeIndependent, clone, update 메서드에 is_active 처리 - FormRequest: is_active 유효성 검사 규칙 추가 - API Flow 테스트 시나리오 추가 (docs/api-flows/) - docs/INDEX.md에 api-flows 섹션 추가 ModelTrait::scopeActive() 메서드 사용을 위한 필수 컬럼
This commit is contained in:
@@ -54,6 +54,7 @@ public function storeIndependent(array $data): ItemField
|
||||
'category' => $data['category'] ?? null,
|
||||
'description' => $data['description'] ?? null,
|
||||
'is_common' => $data['is_common'] ?? false,
|
||||
'is_active' => $data['is_active'] ?? true,
|
||||
'is_locked' => $data['is_locked'] ?? false,
|
||||
'locked_by' => ($data['is_locked'] ?? false) ? $userId : null,
|
||||
'locked_at' => ($data['is_locked'] ?? false) ? now() : null,
|
||||
@@ -103,6 +104,7 @@ public function clone(int $id): ItemField
|
||||
'category' => $original->category,
|
||||
'description' => $original->description,
|
||||
'is_common' => $original->is_common,
|
||||
'is_active' => $original->is_active, // 원본의 활성화 상태 복제
|
||||
'is_locked' => false, // 복제본은 잠금 해제 상태
|
||||
'created_by' => $userId,
|
||||
]);
|
||||
@@ -174,6 +176,7 @@ public function store(int $sectionId, array $data): ItemField
|
||||
'validation_rules' => $data['validation_rules'] ?? null,
|
||||
'options' => $data['options'] ?? null,
|
||||
'properties' => $data['properties'] ?? null,
|
||||
'is_active' => $data['is_active'] ?? true,
|
||||
'is_locked' => $data['is_locked'] ?? false,
|
||||
'locked_by' => ($data['is_locked'] ?? false) ? $userId : null,
|
||||
'locked_at' => ($data['is_locked'] ?? false) ? now() : null,
|
||||
@@ -230,6 +233,7 @@ public function update(int $id, array $data): ItemField
|
||||
'category' => $data['category'] ?? $field->category,
|
||||
'description' => $data['description'] ?? $field->description,
|
||||
'is_common' => $data['is_common'] ?? $field->is_common,
|
||||
'is_active' => $data['is_active'] ?? $field->is_active,
|
||||
'updated_by' => $userId,
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user