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:
50
app/Models/Process.php
Normal file
50
app/Models/Process.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Traits\BelongsToTenant;
|
||||
use App\Models\Traits\ModelTrait;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Process extends Model
|
||||
{
|
||||
use BelongsToTenant;
|
||||
use HasFactory;
|
||||
use ModelTrait;
|
||||
use SoftDeletes;
|
||||
|
||||
protected $fillable = [
|
||||
'tenant_id',
|
||||
'process_code',
|
||||
'process_name',
|
||||
'description',
|
||||
'process_type',
|
||||
'department',
|
||||
'work_log_template',
|
||||
'required_workers',
|
||||
'equipment_info',
|
||||
'work_steps',
|
||||
'note',
|
||||
'is_active',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
'deleted_by',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'work_steps' => 'array',
|
||||
'is_active' => 'boolean',
|
||||
'required_workers' => 'integer',
|
||||
];
|
||||
|
||||
/**
|
||||
* 공정 자동 분류 규칙
|
||||
*/
|
||||
public function classificationRules(): HasMany
|
||||
{
|
||||
return $this->hasMany(ProcessClassificationRule::class)->orderBy('priority');
|
||||
}
|
||||
}
|
||||
36
app/Models/ProcessClassificationRule.php
Normal file
36
app/Models/ProcessClassificationRule.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class ProcessClassificationRule extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'process_id',
|
||||
'registration_type',
|
||||
'rule_type',
|
||||
'matching_type',
|
||||
'condition_value',
|
||||
'priority',
|
||||
'description',
|
||||
'is_active',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'is_active' => 'boolean',
|
||||
'priority' => 'integer',
|
||||
];
|
||||
|
||||
/**
|
||||
* 공정
|
||||
*/
|
||||
public function process(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Process::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user