fix: [production] 자재투입 bom_group_key 개별 저장 — 동일 자재 다중 BOM 그룹 지원

- bom_group_key 컬럼 추가 마이그레이션 (work_order_material_inputs)
- WorkOrderMaterialInput 모델 fillable에 bom_group_key 추가
- MaterialInputForItemRequest에 bom_group_key 검증 + replace 옵션 추가
- WorkOrderService.getMaterialsForItem: stock_lot_id+bom_group_key 복합키 기투입 조회 (하위호환)
- WorkOrderService.registerMaterialInputForItem: bom_group_key 저장 + replace 모드 (기존 삭제→재등록)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-04 10:36:38 +09:00
parent 8518621432
commit 5ee97c2d74
4 changed files with 79 additions and 2 deletions

View File

@@ -0,0 +1,26 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('work_order_material_inputs', function (Blueprint $table) {
$table->string('bom_group_key')->nullable()->after('item_id')
->comment('BOM 그룹키 (같은 item_id의 다른 용도 구분, ex: itemId_category_partType)');
$table->index(['work_order_item_id', 'bom_group_key'], 'idx_womi_item_bomgroup');
});
}
public function down(): void
{
Schema::table('work_order_material_inputs', function (Blueprint $table) {
$table->dropIndex('idx_womi_item_bomgroup');
$table->dropColumn('bom_group_key');
});
}
};