feat: [수주관리] order_nodes 테이블 및 모델 생성 (N-depth 트리 구조)
- order_nodes 마이그레이션: 자기참조 parent_id, 고정코어(통계용) + options JSON(하이브리드) - order_items에 order_node_id nullable FK 추가 - OrderNode 모델: BelongsToTenant, Auditable, SoftDeletes, 트리 관계(parent/children) - Order 모델: nodes(), rootNodes() HasMany 관계 추가 - OrderItem 모델: order_node_id fillable + node() BelongsTo 관계 추가 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -26,6 +26,7 @@ class OrderItem extends Model
|
||||
protected $fillable = [
|
||||
'tenant_id',
|
||||
'order_id',
|
||||
'order_node_id',
|
||||
'quote_id',
|
||||
'quote_item_id',
|
||||
'serial_no',
|
||||
@@ -82,6 +83,14 @@ public function order(): BelongsTo
|
||||
return $this->belongsTo(Order::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 수주 노드 (개소/구역/층 등)
|
||||
*/
|
||||
public function node(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(OrderNode::class, 'order_node_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 품목 마스터
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user