feat: item_fields에 field_key, is_locked 컬럼 추가
- field_key: {ID}_{key} 형식으로 고유키 생성
- is_locked, locked_by, locked_at 잠금 컬럼 추가
- ItemFieldService: store/update/clone 로직 수정
- FormRequest: field_key 검증 규칙 추가
- Swagger 스키마 업데이트
This commit is contained in:
@@ -16,6 +16,7 @@ public function rules(): array
|
||||
return [
|
||||
'group_id' => 'nullable|integer',
|
||||
'field_name' => 'required|string|max:255',
|
||||
'field_key' => 'nullable|string|max:80|regex:/^[a-zA-Z][a-zA-Z0-9_]*$/',
|
||||
'field_type' => 'required|in:textbox,number,dropdown,checkbox,date,textarea',
|
||||
'is_required' => 'nullable|boolean',
|
||||
'default_value' => 'nullable|string',
|
||||
@@ -24,6 +25,14 @@ public function rules(): array
|
||||
'validation_rules' => 'nullable|array',
|
||||
'options' => 'nullable|array',
|
||||
'properties' => 'nullable|array',
|
||||
'is_locked' => 'nullable|boolean',
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'field_key.regex' => __('validation.field_key_format'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ public function rules(): array
|
||||
return [
|
||||
'group_id' => 'nullable|integer|min:1', // 계층번호
|
||||
'field_name' => 'required|string|max:255',
|
||||
'field_key' => 'nullable|string|max:80|regex:/^[a-zA-Z][a-zA-Z0-9_]*$/',
|
||||
'field_type' => 'required|in:textbox,number,dropdown,checkbox,date,textarea',
|
||||
'is_required' => 'nullable|boolean',
|
||||
'default_value' => 'nullable|string',
|
||||
@@ -24,6 +25,14 @@ public function rules(): array
|
||||
'validation_rules' => 'nullable|array',
|
||||
'options' => 'nullable|array',
|
||||
'properties' => 'nullable|array',
|
||||
'is_locked' => 'nullable|boolean',
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'field_key.regex' => __('validation.field_key_format'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ public function rules(): array
|
||||
{
|
||||
return [
|
||||
'field_name' => 'sometimes|string|max:255',
|
||||
'field_key' => 'nullable|string|max:80|regex:/^[a-zA-Z][a-zA-Z0-9_]*$/',
|
||||
'field_type' => 'sometimes|in:textbox,number,dropdown,checkbox,date,textarea',
|
||||
'is_required' => 'nullable|boolean',
|
||||
'default_value' => 'nullable|string',
|
||||
@@ -23,6 +24,14 @@ public function rules(): array
|
||||
'validation_rules' => 'nullable|array',
|
||||
'options' => 'nullable|array',
|
||||
'properties' => 'nullable|array',
|
||||
'is_locked' => 'nullable|boolean',
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'field_key.regex' => __('validation.field_key_format'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user