- QualityDocument CRUD + 수주 연결 + 개소별 데이터 저장 - PerformanceReport 실적신고 확인/메모 API - Inspection 검사 설정 + product_code 전파 수정 - 수주선택 API에 client_name 필드 추가 - 절곡 검사 프로파일 분리 (S1/S2/S3) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
63 lines
1.3 KiB
PHP
63 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Models\Qualitys;
|
|
|
|
use App\Models\Documents\Document;
|
|
use App\Models\Orders\OrderItem;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class QualityDocumentLocation extends Model
|
|
{
|
|
protected $table = 'quality_document_locations';
|
|
|
|
const STATUS_PENDING = 'pending';
|
|
|
|
const STATUS_COMPLETED = 'completed';
|
|
|
|
protected $fillable = [
|
|
'quality_document_id',
|
|
'quality_document_order_id',
|
|
'order_item_id',
|
|
'post_width',
|
|
'post_height',
|
|
'change_reason',
|
|
'inspection_data',
|
|
'document_id',
|
|
'inspection_status',
|
|
];
|
|
|
|
protected $casts = [
|
|
'inspection_data' => 'array',
|
|
];
|
|
|
|
public function qualityDocument()
|
|
{
|
|
return $this->belongsTo(QualityDocument::class);
|
|
}
|
|
|
|
public function qualityDocumentOrder()
|
|
{
|
|
return $this->belongsTo(QualityDocumentOrder::class);
|
|
}
|
|
|
|
public function orderItem()
|
|
{
|
|
return $this->belongsTo(OrderItem::class);
|
|
}
|
|
|
|
public function document()
|
|
{
|
|
return $this->belongsTo(Document::class);
|
|
}
|
|
|
|
public function isPending(): bool
|
|
{
|
|
return $this->inspection_status === self::STATUS_PENDING;
|
|
}
|
|
|
|
public function isCompleted(): bool
|
|
{
|
|
return $this->inspection_status === self::STATUS_COMPLETED;
|
|
}
|
|
}
|