diff --git a/LOGICAL_RELATIONSHIPS.md b/LOGICAL_RELATIONSHIPS.md index 27e2908..115db54 100644 --- a/LOGICAL_RELATIONSHIPS.md +++ b/LOGICAL_RELATIONSHIPS.md @@ -1,6 +1,6 @@ # 논리적 데이터베이스 관계 문서 -> **자동 생성**: 2026-02-12 20:26:02 +> **자동 생성**: 2026-02-19 16:26:58 > **소스**: Eloquent 모델 관계 분석 ## 📊 모델별 관계 현황 @@ -635,8 +635,10 @@ ### work_orders - **items()**: hasMany → `work_order_items` - **issues()**: hasMany → `work_order_issues` - **stepProgress()**: hasMany → `work_order_step_progress` +- **materialInputs()**: hasMany → `work_order_material_inputs` - **shipments()**: hasMany → `shipments` - **bendingDetail()**: hasOne → `work_order_bending_details` +- **documents()**: morphMany → `documents` ### work_order_assignees **모델**: `App\Models\Production\WorkOrderAssignee` @@ -662,6 +664,16 @@ ### work_order_items - **workOrder()**: belongsTo → `work_orders` - **item()**: belongsTo → `items` - **sourceOrderItem()**: belongsTo → `order_items` +- **materialInputs()**: hasMany → `work_order_material_inputs` + +### work_order_material_inputs +**모델**: `App\Models\Production\WorkOrderMaterialInput` + +- **workOrder()**: belongsTo → `work_orders` +- **workOrderItem()**: belongsTo → `work_order_items` +- **stockLot()**: belongsTo → `stock_lots` +- **item()**: belongsTo → `items` +- **inputBy()**: belongsTo → `users` ### work_order_step_progress **모델**: `App\Models\Production\WorkOrderStepProgress` diff --git a/database/migrations/2026_02_19_create_barobill_bank_sync_status_table.php b/database/migrations/2026_02_19_create_barobill_bank_sync_status_table.php new file mode 100644 index 0000000..6c42d59 --- /dev/null +++ b/database/migrations/2026_02_19_create_barobill_bank_sync_status_table.php @@ -0,0 +1,36 @@ +id(); + $table->foreignId('tenant_id')->constrained()->onDelete('cascade'); + $table->string('bank_account_num', 50)->comment('계좌번호'); + $table->string('synced_year_month', 6)->comment('동기화 완료된 월 (YYYYMM)'); + $table->timestamp('synced_at')->comment('마지막 동기화 시각'); + $table->timestamps(); + + $table->unique( + ['tenant_id', 'bank_account_num', 'synced_year_month'], + 'bb_sync_status_unique' + ); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('barobill_bank_sync_status'); + } +};