- Stock 모델에 item_id 필드 및 item() 관계 추가 - StockService에 item eager loading 적용 - stocks 테이블 item_id 마이그레이션 추가 - StockReceivingSeeder 더미 데이터 시더 생성 - Process 모델 Traits 경로 수정 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
51 lines
1.1 KiB
PHP
51 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Traits\BelongsToTenant;
|
|
use App\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');
|
|
}
|
|
}
|