Skip to content

만료 당일 식품 FoodStatus가 BLACK이 아닌 RED로 저장되는 버그 수정 - #251

Merged
jjh75607 merged 1 commit into
devfrom
fix/#243
May 31, 2026
Merged

만료 당일 식품 FoodStatus가 BLACK이 아닌 RED로 저장되는 버그 수정#251
jjh75607 merged 1 commit into
devfrom
fix/#243

Conversation

@jjh75607

@jjh75607 jjh75607 commented May 31, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

릴리스 노트

  • Bug Fixes

    • 식품 만료 상태 경계값 계산 로직을 조정했습니다.
  • Tests

    • 만료일 경계값에 따른 식품 상태 갱신을 검증하는 통합 테스트를 추가했습니다.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jjh75607 jjh75607 self-assigned this May 31, 2026
@coderabbitai

coderabbitai Bot commented May 31, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

FoodStatusProcessor의 RED 상태 경계 계산을 내일 자정 기준으로 이동하고, 이 변경을 검증하는 새로운 통합 테스트를 추가하여 당일/D+1 만료 경계 동작을 확인합니다.

Changes

식품 상태 경계값 조정

Layer / File(s) Summary
RED 경계값 임계값 수정
src/main/java/soon/fridgely/domain/food/service/FoodStatusProcessor.java
bulkUpdate() 메서드에서 RED 상태 시작 경계(redStart)를 today.atStartOfDay()에서 today.plusDays(1).atStartOfDay()로 변경하여 RED 상태 구간이 하루 뒤로 이동합니다.
RED/BLACK 경계 통합 테스트
src/test/java/soon/fridgely/domain/food/service/FoodStatusSchedulerIntegrationTest.java
당일 만료 항목이 BLACK으로, D+1 만료 항목이 RED로 올바르게 업데이트되는지 검증하는 새로운 통합 테스트 메서드 BLACK_RED_경계값인_당일_만료는_BLACK이고_D플러스1은_RED이다()를 추가합니다.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related issues

Possibly related PRs

  • Fridgely/Back-End#161: 메인 PR의 FoodStatusProcessor.bulkUpdate()에서 redStart 경계 계산 기준을 todaytoday.plusDays(1)로 조정한 변경은, 이 PR이 도입한 FoodStatusProcessor의 임계값/날짜 범위 기반 일괄 상태 업데이트 로직과 같은 코드(특히 구간 컷오프 계산)를 직접 수정하는 것입니다.

Suggested labels

Chore

Poem

🐰 내일의 경계를 맞추는 날,
빨간 줄이 한 칸 밀려가네.
테스트는 오늘도 든든하게,
만료의 순간을 정확히 잡아내~

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목이 변경사항의 핵심을 명확하게 설명하고 있습니다. 만료 당일 식품의 FoodStatus가 RED가 아닌 BLACK으로 저장되어야 한다는 버그를 수정하는 변경사항과 일치합니다.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/#243

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/test/java/soon/fridgely/domain/food/service/FoodStatusSchedulerIntegrationTest.java`:
- Line 90: Rename the test method BLACK_RED_경계값인_당일_만료는_BLACK이고_D플러스1은_RED이다 to
a fully Korean sentence-style name to comply with the test naming guideline
(tests in src/test/java/**/*.java must use Korean names). Locate the method in
FoodStatusSchedulerIntegrationTest (method name
BLACK_RED_경계값인_당일_만료는_BLACK이고_D플러스1은_RED이다) and change its identifier to a
Korean-only descriptive name such as 당일_만료_식품을_갱신하면_블랙으로_처리되고_다음날_만료는_레드로_처리된다,
and then run the tests to ensure no callsites or annotations (e.g., `@Test`) are
broken by the rename.
🪄 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: 2ee4cb1f-1d0d-4247-a7b8-ca668fe701a8

📥 Commits

Reviewing files that changed from the base of the PR and between 46f30a4 and 2ad8c4d.

📒 Files selected for processing (2)
  • src/main/java/soon/fridgely/domain/food/service/FoodStatusProcessor.java
  • src/test/java/soon/fridgely/domain/food/service/FoodStatusSchedulerIntegrationTest.java

}

@Test
void BLACK_RED_경계값인_당일_만료는_BLACK이고_D플러스1은_RED이다() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

테스트 메서드명을 전부 한글 문장형으로 맞춰주세요.

현재 메서드명에 BLACK, RED 영문 토큰이 포함되어 가이드와 어긋납니다. 예: 당일_만료_식품을_갱신하면_블랙으로_처리되고_다음날_만료는_레드로_처리된다.

As per coding guidelines src/test/java/**/*.java: "테스트 메서드명 - 반드시 한글로 작성한다."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/test/java/soon/fridgely/domain/food/service/FoodStatusSchedulerIntegrationTest.java`
at line 90, Rename the test method BLACK_RED_경계값인_당일_만료는_BLACK이고_D플러스1은_RED이다 to
a fully Korean sentence-style name to comply with the test naming guideline
(tests in src/test/java/**/*.java must use Korean names). Locate the method in
FoodStatusSchedulerIntegrationTest (method name
BLACK_RED_경계값인_당일_만료는_BLACK이고_D플러스1은_RED이다) and change its identifier to a
Korean-only descriptive name such as 당일_만료_식품을_갱신하면_블랙으로_처리되고_다음날_만료는_레드로_처리된다,
and then run the tests to ensure no callsites or annotations (e.g., `@Test`) are
broken by the rename.

@jjh75607
jjh75607 merged commit 730213d into dev May 31, 2026
2 checks passed
@jjh75607
jjh75607 deleted the fix/#243 branch May 31, 2026 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix: 만료 당일 식품 FoodStatus가 BLACK이 아닌 RED로 저장되는 버그 수정

1 participant