feat: 견적확정 밸리데이션, 작업지시 통계 공정별 카운트, 입고/재고 개선

- 견적확정 시 업체명/현장명/담당자/연락처 필수 검증 추가 (QuoteService)
- 작업지시 stats API에 by_process 공정별 카운트 반환 추가
- 작업지시 목록/상세 쿼리에 수주 개소(rootNodes) 연관 로딩
- 작업지시 품목에 sourceOrderItem.node 관계 추가
- 입고관리 완료건 수정 허용 및 재고 차이 조정
- work_order_step_progress 테이블 마이그레이션
- receivings 테이블 options 컬럼 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-07 03:27:07 +09:00
parent 6b3e5c3e87
commit 487e651845
22 changed files with 1422 additions and 72 deletions

View File

@@ -199,6 +199,7 @@ public static function getUserInfoForLogin(int $userId): array
'name' => $user->name,
'email' => $user->email,
'phone' => $user->phone,
'department' => null,
];
// 2. 활성 테넌트 조회 (1순위: is_default=1, 2순위: is_active=1 첫 번째)
@@ -221,6 +222,18 @@ public static function getUserInfoForLogin(int $userId): array
$defaultUserTenant = $userTenants->first();
$tenant = $defaultUserTenant->tenant;
// 2-1. 소속 부서 조회 (tenant_user_profiles → departments)
$profile = DB::table('tenant_user_profiles')
->where('user_id', $userId)
->where('tenant_id', $tenant->id)
->first();
if ($profile && $profile->department_id) {
$dept = DB::table('departments')->where('id', $profile->department_id)->first();
if ($dept) {
$userInfo['department'] = $dept->name;
}
}
// 3. 테넌트 정보 구성
$tenantInfo = [
'id' => $tenant->id,