feat: [material] 부적합관리 결재 연동 구현
- Migration: approval_id FK 추가
- Model: approval() BelongsTo 관계
- Service: submitForApproval() 결재상신 (결재문서+결재선 생성)
- ApprovalService: 승인→CLOSED, 반려/회수→approval_id 해제
- Controller: POST /{id}/submit-approval 엔드포인트
- Route: submit-approval 라우트 등록
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
use App\Models\Departments\Department;
|
||||
use App\Models\Items\Item;
|
||||
use App\Models\Orders\Order;
|
||||
use App\Models\Tenants\Approval;
|
||||
use App\Models\Users\User;
|
||||
use App\Traits\Auditable;
|
||||
use App\Traits\BelongsToTenant;
|
||||
@@ -24,6 +25,7 @@ class NonconformingReport extends Model
|
||||
'tenant_id',
|
||||
'nc_number',
|
||||
'status',
|
||||
'approval_id',
|
||||
'nc_type',
|
||||
'occurred_at',
|
||||
'confirmed_at',
|
||||
@@ -104,6 +106,11 @@ public function items(): HasMany
|
||||
return $this->hasMany(NonconformingReportItem::class)->orderBy('sort_order');
|
||||
}
|
||||
|
||||
public function approval(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Approval::class);
|
||||
}
|
||||
|
||||
public function order(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Order::class);
|
||||
|
||||
Reference in New Issue
Block a user