Skip to content

refactor: 식단 품절 제보 멱등키 구현 제거 - #2484

Merged
taejinn merged 1 commit into
developfrom
refactor/2483-dining-report-request-key-removal
Oct 8, 2026
Merged

taejinn merged 1 commit into
developfrom
refactor/2483-dining-report-request-key-removal

Conversation

@taejinn

@taejinn taejinn commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

🔍 개요


🚀 주요 변경 내용

  • 제보 등록 API에서 Idempotency-Key 헤더 요구와 관련 Swagger 설명을 제거합니다.

  • 엔티티의 요청 키 필드와 키 조회, 이전 응답 재사용 로직 및 관련 오류 코드를 제거합니다.

  • 같은 학생이 같은 식단을 다시 제보하면 기존 중복 제보 오류를 반환하도록 합니다.

    • 예: 같은 사진 URL로 다시 요청해도 409 DINING_REPORT_ALREADY_SUBMITTED를 반환하며, 다른 식단에는 정상적으로 제보할 수 있습니다.

💬 참고 사항

  • V15에서 기존 request_key 컬럼의 필수 제약을 해제합니다. 기존 값과 적용된 마이그레이션은 보존하며, 새 코드에서는 키를 생성하거나 읽지 않습니다.

  • 변경 범위는 식단 품절 제보로 한정합니다. 기존 결제 기능의 멱등키와 삐봇의 작업 시도 토큰은 변경하지 않습니다.

변경되는 API
메서드 경로 변경
POST /dinings/{diningId}/soldout-reports Idempotency-Key 없이 제보 등록

✅ Checklist (완료 조건)

  • 코드 스타일 가이드 준수
  • 테스트 코드 포함됨
  • Reviewers / Assignees / Labels 지정 완료
  • 보안 및 민감 정보 검증 (API 키, 환경 변수, 개인정보 등)
검증 결과
  • Java 17과 UTC 환경에서 관련 테스트 33개를 통과했습니다.
  • 키 없는 접수, 중복 제보 차단, 기존 처리 흐름과 V15 적용 후 데이터 보존을 확인했습니다.

Summary by CodeRabbit

  • Behavior Changes
    • Repeated sold-out dining reports from the same student for the same dining item now return a conflict, even when the photo URL differs.
    • Reports for different dining items can still be submitted independently.
    • Reports cannot be resubmitted after processing.

@taejinn taejinn added 리팩터링 리팩터링을 위한 이슈입니다 DB DB 마이그레이션을 위한 라벨입니다. 공통 백엔드 공통으로 작업할 이슈입니다. labels Oct 8, 2026
@taejinn taejinn self-assigned this Oct 8, 2026
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cfd6b582-c1e6-46e3-9789-47b8076a3206
📥 Commits

Reviewing files that changed from the base of the PR and between 03b1ea4 and 9f13006.

📒 Files selected for processing (14)
  • src/main/java/in/koreatech/koin/domain/dining/controller/DiningReportApi.java
  • src/main/java/in/koreatech/koin/domain/dining/controller/DiningReportBotApi.java
  • src/main/java/in/koreatech/koin/domain/dining/controller/DiningReportController.java
  • src/main/java/in/koreatech/koin/domain/dining/dto/DiningReportCreateResponse.java
  • src/main/java/in/koreatech/koin/domain/dining/model/DiningReport.java
  • src/main/java/in/koreatech/koin/domain/dining/repository/DiningReportRepository.java
  • src/main/java/in/koreatech/koin/domain/dining/service/DiningReportService.java
  • src/main/java/in/koreatech/koin/global/code/ApiResponseCode.java
  • src/main/resources/db/migration/V15__relax_dining_report_request_key.sql
  • src/test/java/in/koreatech/koin/acceptance/domain/DiningReportDeliveryServiceTest.java
  • src/test/java/in/koreatech/koin/acceptance/domain/DiningSoldOutReportApiTest.java
  • src/test/java/in/koreatech/koin/acceptance/domain/DiningSoldOutReportConcurrencyTest.java
  • src/test/java/in/koreatech/koin/acceptance/migration/DiningSoldOutReportMigrationTest.java
  • src/test/java/in/koreatech/koin/unit/domain/dining/service/DiningReportImageValidationTest.java
💤 Files with no reviewable changes (2)
  • src/main/java/in/koreatech/koin/global/code/ApiResponseCode.java
  • src/main/java/in/koreatech/koin/domain/dining/repository/DiningReportRepository.java

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Dining sold-out report submissions no longer accept or process idempotency keys. Duplicate submissions by the same student for the same dining item remain restricted. The database migration allows null request keys, and the API documentation and tests reflect the keyless flow.

Changes

Dining report submission

Layer / File(s) Summary
Keyless report API contract
src/main/java/in/koreatech/koin/domain/dining/controller/DiningReportApi.java, src/main/java/in/koreatech/koin/domain/dining/controller/DiningReportController.java, src/main/java/in/koreatech/koin/domain/dining/controller/DiningReportBotApi.java, src/main/java/in/koreatech/koin/domain/dining/dto/DiningReportCreateResponse.java
The report endpoint no longer accepts an Idempotency-Key header or passes a key to the service. API descriptions and response schema descriptions remove key-based retry behavior.
Duplicate enforcement and persistence
src/main/java/in/koreatech/koin/domain/dining/model/DiningReport.java, src/main/java/in/koreatech/koin/domain/dining/repository/DiningReportRepository.java, src/main/java/in/koreatech/koin/domain/dining/service/DiningReportService.java, src/main/java/in/koreatech/koin/global/code/ApiResponseCode.java, src/main/resources/db/migration/V15__relax_dining_report_request_key.sql
The model and service no longer store, look up, or replay request keys. The student-and-dining duplicate constraint remains. The idempotency-key conflict response code is removed, and V15 makes the database request-key column nullable.
Submission and migration tests
src/test/java/in/koreatech/koin/acceptance/domain/DiningReportDeliveryServiceTest.java, src/test/java/in/koreatech/koin/acceptance/domain/DiningSoldOutReportApiTest.java, src/test/java/in/koreatech/koin/acceptance/domain/DiningSoldOutReportConcurrencyTest.java, src/test/java/in/koreatech/koin/acceptance/migration/DiningSoldOutReportMigrationTest.java, src/test/java/in/koreatech/koin/unit/domain/dining/service/DiningReportImageValidationTest.java
Tests create reports without keys. API tests expect duplicate submissions for the same student and dining item to conflict, including when the image URL differs. Migration tests check retained report data and null-key duplicate constraints.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 9f130

The keyless report flow retains duplicate-report protection, and the migration preserves existing data. No identified issue prevents merging after normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 26 functions across 11 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Issue #2483 requires removal of the required idempotency key from dining sold-out report registration and retention of duplicate limits by student and dining. DiningReportApi, `DiningReportControlle…
Out of Scope Changes check ✅ Passed The changes remain within the dining sold-out report scope of issue #2483. Production changes affect the report API, model, repository, service, response documentation, response code, and the V15 migr…
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: removing the idempotency-key implementation from dining sold-out reports.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 26 functions across 11 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown

Unit Test Results

   291 files     291 suites   3m 43s ⏱️
1 430 tests 1 427 ✔️ 3 💤 0 ❌
1 438 runs  1 435 ✔️ 3 💤 0 ❌

Results for commit 9f13006.

@taejinn
taejinn merged commit 9b5b8da into develop Oct 8, 2026
12 checks passed
@taejinn
taejinn deleted the refactor/2483-dining-report-request-key-removal branch October 8, 2026 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DB DB 마이그레이션을 위한 라벨입니다. 공통 백엔드 공통으로 작업할 이슈입니다. 리팩터링 리팩터링을 위한 이슈입니다

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[공통] 식단 품절 제보에 잘못 추가된 멱등키 제거

2 participants