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

@@ -17,30 +17,42 @@ class TodayIssueService extends Service
*
* @param int $limit 조회할 최대 항목 수 (기본 30)
* @param string|null $badge 뱃지 필터 (null이면 전체)
* @param string|null $date 조회 날짜 (YYYY-MM-DD, null이면 오늘)
*/
public function summary(int $limit = 30, ?string $badge = null): array
public function summary(int $limit = 30, ?string $badge = null, ?string $date = null): array
{
$tenantId = $this->tenantId();
$userId = $this->apiUserId();
// date 파라미터가 있으면 해당 날짜, 없으면 오늘
$targetDate = $date ? Carbon::parse($date) : today();
$query = TodayIssue::query()
->where('tenant_id', $tenantId)
->forUser($userId) // 본인 대상 또는 전체 브로드캐스트
->active() // 만료되지 않은 이슈만
->today() // 오늘 날짜 이슈만
->whereDate('created_at', $targetDate)
->orderByDesc('created_at');
// 이전 이슈 조회 시에는 만료 필터 무시 (과거 데이터도 조회 가능)
if (! $date) {
$query->active(); // 오늘 이슈만 만료 필터 적용
}
// 뱃지 필터
if ($badge !== null && $badge !== 'all') {
$query->byBadge($badge);
}
// 전체 개수 (필터 적용 전, 오늘 날짜만)
// 전체 개수 (필터 적용 전)
$totalQuery = TodayIssue::query()
->where('tenant_id', $tenantId)
->forUser($userId)
->active()
->today();
->whereDate('created_at', $targetDate);
if (! $date) {
$totalQuery->active();
}
$totalCount = $totalQuery->count();
// 결과 조회