feat: [HR/기타] 캘린더/배차/설비/재고 + DB 마이그레이션

- 캘린더 CRUD API, 배차차량 관리 API (CRUD + options)
- 배차정보 다중 행 시스템 (shipment_vehicle_dispatches)
- 설비 다중점검주기 + 부 담당자 스키마 추가
- TodayIssue 날짜 기반 조회, Stock/Client 날짜 필터
- i18n 메시지 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-07 02:59:30 +09:00
parent 95371fd841
commit 4208ca3010
27 changed files with 799 additions and 15 deletions

View File

@@ -88,6 +88,20 @@ public function index(array $params): LengthAwarePaginator
});
}
// 날짜 범위 필터 (해당 기간에 입출고 이력이 있는 품목만)
if (! empty($params['start_date']) || ! empty($params['end_date'])) {
$query->whereHas('stock', function ($stockQuery) use ($params) {
$stockQuery->whereHas('transactions', function ($txQuery) use ($params) {
if (! empty($params['start_date'])) {
$txQuery->whereDate('created_at', '>=', $params['start_date']);
}
if (! empty($params['end_date'])) {
$txQuery->whereDate('created_at', '<=', $params['end_date']);
}
});
});
}
// 정렬
$sortBy = $params['sort_by'] ?? 'code';
$sortDir = $params['sort_dir'] ?? 'asc';