feat: 공정관리 API 구현 (L-1)
- processes, process_classification_rules 테이블 마이그레이션 - Process, ProcessClassificationRule 모델 (BelongsToTenant, SoftDeletes) - ProcessService: CRUD + 통계/옵션/상태토글 - ProcessController + FormRequest 검증 - API 라우트 등록 (/v1/processes) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
54
app/Http/Requests/V1/Process/StoreProcessRequest.php
Normal file
54
app/Http/Requests/V1/Process/StoreProcessRequest.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V1\Process;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreProcessRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'process_name' => ['required', 'string', 'max:100'],
|
||||
'description' => ['nullable', 'string'],
|
||||
'process_type' => ['required', 'string', 'in:생산,검사,포장,조립'],
|
||||
'department' => ['nullable', 'string', 'max:100'],
|
||||
'work_log_template' => ['nullable', 'string', 'max:100'],
|
||||
'required_workers' => ['nullable', 'integer', 'min:1'],
|
||||
'equipment_info' => ['nullable', 'string', 'max:255'],
|
||||
'work_steps' => ['nullable'],
|
||||
'note' => ['nullable', 'string'],
|
||||
'is_active' => ['nullable', 'boolean'],
|
||||
|
||||
// 분류 규칙
|
||||
'classification_rules' => ['nullable', 'array'],
|
||||
'classification_rules.*.registration_type' => ['nullable', 'string', 'in:pattern,individual'],
|
||||
'classification_rules.*.rule_type' => ['required_with:classification_rules.*', 'string', 'in:품목코드,품목명,품목구분'],
|
||||
'classification_rules.*.matching_type' => ['required_with:classification_rules.*', 'string', 'in:startsWith,endsWith,contains,equals'],
|
||||
'classification_rules.*.condition_value' => ['required_with:classification_rules.*', 'string', 'max:255'],
|
||||
'classification_rules.*.priority' => ['nullable', 'integer', 'min:0'],
|
||||
'classification_rules.*.description' => ['nullable', 'string', 'max:255'],
|
||||
'classification_rules.*.is_active' => ['nullable', 'boolean'],
|
||||
];
|
||||
}
|
||||
|
||||
public function attributes(): array
|
||||
{
|
||||
return [
|
||||
'process_name' => '공정명',
|
||||
'description' => '공정 설명',
|
||||
'process_type' => '공정구분',
|
||||
'department' => '담당부서',
|
||||
'work_log_template' => '작업일지 양식',
|
||||
'required_workers' => '필요인원',
|
||||
'equipment_info' => '설비정보',
|
||||
'work_steps' => '작업단계',
|
||||
'note' => '비고',
|
||||
];
|
||||
}
|
||||
}
|
||||
54
app/Http/Requests/V1/Process/UpdateProcessRequest.php
Normal file
54
app/Http/Requests/V1/Process/UpdateProcessRequest.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V1\Process;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateProcessRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'process_name' => ['sometimes', 'required', 'string', 'max:100'],
|
||||
'description' => ['nullable', 'string'],
|
||||
'process_type' => ['sometimes', 'required', 'string', 'in:생산,검사,포장,조립'],
|
||||
'department' => ['nullable', 'string', 'max:100'],
|
||||
'work_log_template' => ['nullable', 'string', 'max:100'],
|
||||
'required_workers' => ['nullable', 'integer', 'min:1'],
|
||||
'equipment_info' => ['nullable', 'string', 'max:255'],
|
||||
'work_steps' => ['nullable'],
|
||||
'note' => ['nullable', 'string'],
|
||||
'is_active' => ['nullable', 'boolean'],
|
||||
|
||||
// 분류 규칙
|
||||
'classification_rules' => ['nullable', 'array'],
|
||||
'classification_rules.*.registration_type' => ['nullable', 'string', 'in:pattern,individual'],
|
||||
'classification_rules.*.rule_type' => ['required_with:classification_rules.*', 'string', 'in:품목코드,품목명,품목구분'],
|
||||
'classification_rules.*.matching_type' => ['required_with:classification_rules.*', 'string', 'in:startsWith,endsWith,contains,equals'],
|
||||
'classification_rules.*.condition_value' => ['required_with:classification_rules.*', 'string', 'max:255'],
|
||||
'classification_rules.*.priority' => ['nullable', 'integer', 'min:0'],
|
||||
'classification_rules.*.description' => ['nullable', 'string', 'max:255'],
|
||||
'classification_rules.*.is_active' => ['nullable', 'boolean'],
|
||||
];
|
||||
}
|
||||
|
||||
public function attributes(): array
|
||||
{
|
||||
return [
|
||||
'process_name' => '공정명',
|
||||
'description' => '공정 설명',
|
||||
'process_type' => '공정구분',
|
||||
'department' => '담당부서',
|
||||
'work_log_template' => '작업일지 양식',
|
||||
'required_workers' => '필요인원',
|
||||
'equipment_info' => '설비정보',
|
||||
'work_steps' => '작업단계',
|
||||
'note' => '비고',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user