mmday-firebase/TODO.md
윤정민 526a8ef731 Derive today via todayKst in kboRepository
- mergeLiveIntoSchedule·fetchScheduleMonth의 formatYmd(new Date())를 todayKst().replace로 교체 — 서버 TZ 의존 제거, 정규 KST 헬퍼로 통일
- 명시적 날짜용 formatYmd와 경기 시간대 시(hour) 게이트는 그대로 유지
- TODO.md 해당 항목 종결
2026-06-27 00:20:44 +09:00

29 lines
1.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# TODO
## KBO 일정/라이브 머지 관련
### 남은 작업
- [ ] **클라이언트 쪽 점수 표시 이슈 조사**
- 서버 머지는 정상 (로그 확인 완료: 5/5 매칭, 점수·상태 정상 반영)
- 브라우저 Network 탭에서 실제 응답 바디에 `awayScore`/`homeScore` 값이 들어오는지 확인
- 값이 들어오는데 0으로 보이면 → 프런트 렌더링 로직 점검
- 값이 null/0으로 오면 → 응답 직렬화/DTO 매핑 레이어 점검 (`scheduleService.ts` 등)
- [ ] **`mergeLiveIntoSchedule` 진단 로그 제거** (`src/repositories/kboRepository.ts`)
- 점수 이슈 해결 후 `[kbo-merge]` console.log 전부 제거
- [ ] **deploy 스크립트에 build 포함**
- `package.json:10` `"deploy": "firebase deploy --only functions"``"tsc && firebase deploy --only functions"`
- 현재는 `npm run build` 빠뜨리면 구버전 `lib/` 그대로 배포됨
### 향후 확장 여지
- [ ] **GameList 캐시를 Firestore 공유 캐시로 격상 검토**
- 현재: `gameListService.ts`의 10초 메모리 캐시 (인스턴스별)
- 트래픽 증가 시 인스턴스 수 × (6회/분)로 KBO 호출 증가 → rate limit 리스크
- 격상안: `kboCacheRepository.getOrFetch` 사용, 키 `gameList_day__YYYYMMDD__series`, TTL은 스케줄과 동일한 동적(라이브 30s, 종료 7d) 방식
- 지금은 불필요. 트래픽/에러율 지표 보고 결정
- [ ] 라이브 상세 필드 별도 엔드포인트로 노출
- 이닝/카운트/주자/현재 타자·투수는 "스케줄 파악" 목적에서 제외했으나, 라이브 상세 화면 필요 시 `getGameList` 직접 노출하는 별도 핸들러 추가 고려
- [x] `formatYmd(new Date())``todayKst()` 기반으로 통일
- "오늘" 도출은 TZ 독립 헬퍼(`todayKst`)로 통일 완료. 경기 시간대 시(hour) 게이트는 의도적으로 서버로컬(KST) 유지.