Repository navigation
[Refactor] 식단 조회 책임 및 그룹화 구조 개선 - #79
Conversation
- WarmupModule 제거 - CafeteriaMessageFactory에서 diets를 menuGroups로 변경하여 카테고리별로 식단 정보를 그룹화 - CafeteriasService에서 getCafeteriaDiet 메서드 리팩토링, 식단 정보를 카테고리별로 반환하도록 수정 - 관련 DTO 및 테스트 코드 업데이트
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
Walkthrough식당 식단 조회 책임을 재정의하고, 식단 그룹화 로직을 서비스 계층으로 통합하며, Warmup 모듈과 TypeORM 트랜잭션 래퍼를 제거합니다. 컨트롤러는 날짜/시간 결정을 담당하고, 서비스는 확정된 입력값으로 조회만 수행합니다. Changes식단 조회 책임 분리 및 그룹화 통합
Warmup 모듈 제거 및 불필요한 의존성 정리
TypeORM 트랜잭션 래퍼 제거
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 4 minutes and 58 seconds.Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@services/api/app/src/api/public/cafeterias/cafeterias-native.controller.ts`:
- Around line 43-45: The default time selection uses getDietTime(date) which
uses the parsed query.date and can produce incorrect "current-time-based"
defaults; change the logic so when query.time is not provided you call
getDietTime(new Date()) (the actual current time) regardless of whether
query.date exists, e.g., keep date = query.date ? new Date(query.date) : new
Date() but compute time = query.time ?? getDietTime(new Date()) before calling
cafeteriasService.getCafeteriaDiet(cafeteriaId, date, time).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f2e4d233-ca9f-43ae-b428-634b59d771db
⛔ Files ignored due to path filters (1)
services/api/app/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (11)
services/api/app/package.jsonservices/api/app/src/api/internal/warmup/warmup.module.tsservices/api/app/src/api/internal/warmup/warmup.service.tsservices/api/app/src/api/public/cafeterias/cafeteria-message.factory.tsservices/api/app/src/api/public/cafeterias/cafeterias-native.controller.tsservices/api/app/src/api/public/cafeterias/cafeterias.controller.tsservices/api/app/src/api/public/cafeterias/cafeterias.service.spec.tsservices/api/app/src/api/public/cafeterias/cafeterias.service.tsservices/api/app/src/api/public/cafeterias/dtos/requests/list-cafeteria-diet-request.dto.tsservices/api/app/src/api/public/cafeterias/dtos/results/cafeteria-diet-result.dto.tsservices/api/app/src/app.module.ts
💤 Files with no reviewable changes (4)
- services/api/app/src/app.module.ts
- services/api/app/src/api/internal/warmup/warmup.module.ts
- services/api/app/package.json
- services/api/app/src/api/internal/warmup/warmup.service.ts
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@services/api/app/src/app.module.ts`:
- Line 71: The bootstrap currently calls await app.listen(port) without
capturing the underlying HTTP server or setting timeouts; update main.ts to
capture the server instance returned by app.listen (e.g., const server = await
app.listen(port) or use app.getHttpServer()) and then explicitly set
server.keepAliveTimeout and server.headersTimeout to values compatible with your
nginx timeout (and ensure headersTimeout > keepAliveTimeout), so the Node.js
server timeouts align with reverse-proxy expectations.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a91028f6-fdef-4dba-b85b-87a0d811aba0
⛔ Files ignored due to path filters (1)
services/api/app/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (6)
services/api/app/package.jsonservices/api/app/src/api/public/users/users.service.spec.tsservices/api/app/src/api/public/users/users.service.tsservices/api/app/src/app.module.tsservices/api/app/src/main.tsservices/api/app/src/type-orm/database.module.ts
💤 Files with no reviewable changes (5)
- services/api/app/src/main.ts
- services/api/app/src/api/public/users/users.service.ts
- services/api/app/src/api/public/users/users.service.spec.ts
- services/api/app/src/type-orm/database.module.ts
- services/api/app/package.json
- date 및 time 필드를 필수로 변경하여 유효성 검증 강화 - CafeteriasNativeController에서 getCafeteriaDiet 호출 시 time 파라미터 처리 방식 수정
📌 개요
✨ 작업 내용
menuGroups로 통합해 응답 생성과 메시지 생성의 중복 로직을 제거했습니다.🔥 변경 이유
🧪 테스트
Date,DietTime을 직접 받아 조회한다.dishCategory우선, 없으면dishType, 둘 다 없으면 빈 문자열 기준으로 동작한다.🔗 관련 이슈
Summary by CodeRabbit
Release Notes
Refactor
Chores