fix : 주문 테이블 모델링 -> 추후 변경예정 (견적, 수주, 발주에 대한 각각의 컬럼을 위한 테이블 필요)

This commit is contained in:
2025-07-29 23:22:31 +09:00
parent 511c09fd19
commit 2a0f3471a8
5 changed files with 132 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
<?php
namespace App\Models\Orders;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Order extends Model
{
use SoftDeletes;
// 주문(견적/수주/발주 메인)
protected $table = 'orders';
protected $fillable = [
'tenant_id', 'order_no', 'order_type_code', 'status_code', 'category_code', 'product_id',
'received_at', 'writer_id', 'client_id', 'client_contact', 'site_name', 'quantity', 'delivery_date',
'delivery_method_code', 'memo'
];
// 상세(라인)
public function items()
{
return $this->hasMany(OrderItem::class);
}
// 이력
public function histories()
{
return $this->hasMany(OrderHistory::class);
}
// 버전관리
public function versions()
{
return $this->hasMany(OrderVersion::class);
}
}