- ProcessItem 모델 및 마이그레이션 추가 - Process 요청/서비스 로직 수정 - Swagger API 문서 추가 Co-Authored-By: Claude <noreply@anthropic.com>
45 lines
806 B
PHP
45 lines
806 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Models\Items\Item;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
/**
|
|
* 공정-품목 연결 모델 (개별 품목 지정용)
|
|
*/
|
|
class ProcessItem extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'process_id',
|
|
'item_id',
|
|
'priority',
|
|
'is_active',
|
|
];
|
|
|
|
protected $casts = [
|
|
'is_active' => 'boolean',
|
|
'priority' => 'integer',
|
|
];
|
|
|
|
/**
|
|
* 공정
|
|
*/
|
|
public function process(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Process::class);
|
|
}
|
|
|
|
/**
|
|
* 품목
|
|
*/
|
|
public function item(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Item::class);
|
|
}
|
|
}
|