feat:개소별 자재 투입 관리 API 추가

- work_order_material_inputs 테이블 신규 생성 (개소별 자재 투입 추적)
- 개소별 자재 조회/투입/이력/삭제/수정 API 5개 추가
- StockService.increaseToLot: LOT 수량 복원 메서드 추가
- WorkOrderService에 개소별 자재 투입 비즈니스 로직 구현
- WorkOrder, WorkOrderItem 모델에 materialInputs 관계 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-13 03:41:35 +09:00
parent d730c2d91a
commit e4c53c7b17
9 changed files with 872 additions and 70 deletions

View File

@@ -8,6 +8,7 @@
use App\Traits\BelongsToTenant;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
/**
* 작업지시 품목 모델
@@ -81,6 +82,14 @@ public function sourceOrderItem(): BelongsTo
return $this->belongsTo(OrderItem::class, 'source_order_item_id');
}
/**
* 자재 투입 이력
*/
public function materialInputs(): HasMany
{
return $this->hasMany(WorkOrderMaterialInput::class);
}
// ──────────────────────────────────────────────────────────────
// 스코프
// ──────────────────────────────────────────────────────────────