- QmsLotAuditService: 품질관리서 목록/상세, 8종 서류 조합, 서류 상세(2단계 로딩), 확인 토글 - QmsLotAuditController: 5개 엔드포인트 (index, show, routeDocuments, documentDetail, confirm) - FormRequest 3개: Index, Confirm, DocumentDetail 파라미터 검증 - QualityDocumentLocation: options JSON 컬럼 추가 (마이그레이션 + 모델 casts) - IQC 추적: WorkOrderMaterialInput → StockLot → lot_no → Inspection(IQC) 경로 - 비관적 업데이트: DB::transaction + lockForUpdate() 원자성 보장 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
67 lines
1.4 KiB
PHP
67 lines
1.4 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_IN_PROGRESS = 'in_progress';
|
|
|
|
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',
|
|
'options',
|
|
];
|
|
|
|
protected $casts = [
|
|
'inspection_data' => 'array',
|
|
'options' => '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;
|
|
}
|
|
}
|