feat : Main Request 모델 추가, Enum 클래스 추가
- Main Request가 모든 공정을 관리하는 형태
This commit is contained in:
41
app/Models/MainRequestFlow.php
Normal file
41
app/Models/MainRequestFlow.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class MainRequestFlow extends Model
|
||||
{
|
||||
/**
|
||||
* 업무 전체/상세 흐름 이력(폴리모픽)
|
||||
*/
|
||||
protected $table = 'main_request_flows';
|
||||
|
||||
protected $fillable = [
|
||||
'main_request_id',
|
||||
'flowable_type', // 폴리모픽 타입(모델명)
|
||||
'flowable_id', // 폴리모픽 PK
|
||||
'status_code',
|
||||
'action',
|
||||
'content',
|
||||
'actor_id',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
/**
|
||||
* 메인 업무 엔터티
|
||||
*/
|
||||
public function mainRequest()
|
||||
{
|
||||
return $this->belongsTo(MainRequest::class, 'main_request_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 폴리모픽 관계(견적, 주문, 발주 등)
|
||||
*/
|
||||
public function flowable()
|
||||
{
|
||||
return $this->morphTo();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user