Skip to content

20260227 #247 출석체크 description 추가#258

Merged
discipline24 merged 5 commits intomainfrom
20260227-#247-출석체크-description-추가
Mar 1, 2026

Hidden character warning

The head ref may contain hidden characters: "20260227-#247-\ucd9c\uc11d\uccb4\ud06c-description-\ucd94\uac00"
Merged

20260227 #247 출석체크 description 추가#258
discipline24 merged 5 commits intomainfrom
20260227-#247-출석체크-description-추가

Conversation

@nayoung04
Copy link
Contributor

@nayoung04 nayoung04 commented Feb 28, 2026

#247

Summary by CodeRabbit

  • 새로운 기능

    • 출석 라운드 삭제 엔드포인트 추가
    • 라운드 생성 시 요청 본문 입력 처리 추가
  • 버그 수정

    • 인증·권한 검사에서 일관된 예외 처리 적용(미인증·권한 오류 명확화)
  • 문서화

    • 다수 API의 인증·권한·파라미터·에러 코드 및 응답 설명 확장 및 명료화
  • 리팩토링

    • 출석 상태 업데이트 요청을 단일 구조로 통합
    • 불필요한 로그 제거 및 일부 로그 위치 조정

@coderabbitai
Copy link

coderabbitai bot commented Feb 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a371679 and f7afae3.

📒 Files selected for processing (4)
  • backend/src/main/java/org/sejongisc/backend/attendance/service/AttendanceService.java
  • backend/src/main/java/org/sejongisc/backend/attendance/service/SessionUserService.java
  • backend/src/main/java/org/sejongisc/backend/attendance/util/AuthUserUtil.java
  • backend/src/main/java/org/sejongisc/backend/common/exception/ErrorCode.java

Walkthrough

출석 관련 컨트롤러와 서비스에서 OpenAPI 문서 확장, 예외 타입 통일(CustomException/ErrorCode), 메서드 서명 변경(AttendanceStatusUpdateRequest 도입), 라운드 삭제 엔드포인트 추가 및 일부 로그 재배치가 적용됨.

Changes

Cohort / File(s) 요약
컨트롤러 API 문서 확장
backend/src/main/java/org/sejongisc/backend/attendance/controller/AttendanceController.java, backend/src/main/java/org/sejongisc/backend/attendance/controller/AttendanceSessionController.java, backend/src/main/java/org/sejongisc/backend/attendance/controller/SessionUserController.java
다수 엔드포인트의 OpenAPI/Operation 설명 보강(인증, 파라미터, 반환, 에러 코드 명시). 대부분 문서/주석 변화이며 기능 로직은 동일.
AttendanceRoundController 변경
backend/src/main/java/org/sejongisc/backend/attendance/controller/AttendanceRoundController.java
createRound(..., AttendanceRoundRequest request) 시그니처로 확장, DELETE /api/attendance/rounds/{roundId} 엔드포인트(삭제) 추가, 관련 문서 및 일부 로그 제거/정리.
AttendanceController 요청/파라미터 조정
backend/src/main/java/org/sejongisc/backend/attendance/controller/AttendanceController.java
체크인 호출에서 userDetails.getUsername() 사용으로 변경, 출석 상태 갱신 엔드포인트가 개별 status/reason 대신 AttendanceStatusUpdateRequest 객체를 받도록 주석·경로 설명 업데이트 및 사용 방식 변경.
서비스 시그니처 변경
backend/src/main/java/org/sejongisc/backend/attendance/service/AttendanceService.java
updateAttendanceStatusByRound(UUID, UUID, UUID, AttendanceStatusUpdateRequest)로 시그니처 변경; 내부에서 DTO로부터 status/reason 추출하여 기존 로직 사용.
인증/권한 예외 정리
backend/src/main/java/org/sejongisc/backend/attendance/service/AttendanceAuthorizationService.java, backend/src/main/java/org/sejongisc/backend/attendance/util/AuthUserUtil.java, backend/src/main/java/org/sejongisc/backend/common/exception/ErrorCode.java
기존 IllegalStateException을 CustomException(ErrorCode.*)로 대체. ErrorCode에 UNAUTHENTICATED, NOT_SESSION_ADMIN, NOT_SESSION_OWNER 추가.
로깅 재배치/정리
backend/src/main/java/org/sejongisc/backend/attendance/service/AttendanceSessionService.java, backend/src/main/java/org/sejongisc/backend/attendance/service/SessionUserService.java
몇몇 서비스 메서드의 진입/완료 로그 제거 또는 사후(log-after)로 이동; 일부 불필요한 save 호출 제거(예: updateSession에서 save 삭제).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • discipline24

Poem

🐰 출석장 바쁜 발자국 쿵쾅,
에러는 정리해 깔끔히 놓아두고,
문서 달고 라운드 지워내니,
메서드는 새 옷 입고 춤을 추네,
토실토실 코드에 축하 당근!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 74.19% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목이 주요 변경사항을 명확히 요약하고 있으며, 출석 체크 API 문서화 추가라는 핵심 내용을 직접적으로 반영하고 있습니다.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 20260227-#247-출석체크-description-추가

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@backend/src/main/java/org/sejongisc/backend/attendance/controller/AttendanceController.java`:
- Line 3: AuthUserUtil.requireUserId currently throws
IllegalStateException("UNAUTHENTICATED") which leads to 500 responses; change it
to throw new CustomException(ErrorCode.UNAUTHENTICATED) so the
GlobalExceptionHandler maps it to 401 consistently (match
AttendanceAuthorizationService behavior). Update the implementation of
AuthUserUtil.requireUserId to construct and throw
CustomException(ErrorCode.UNAUTHENTICATED) instead of IllegalStateException,
leaving callers unchanged (there are ~14 call sites across controllers) and
ensure imports reference CustomException and ErrorCode.UNAUTHENTICATED.

In
`@backend/src/main/java/org/sejongisc/backend/attendance/controller/SessionUserController.java`:
- Around line 43-65: The API docs in SessionUserController.java are missing the
UNAUTHENTICATED (401) error in the error-code lists for authenticated endpoints;
update the Javadoc/Swagger description blocks in SessionUserController to
include a 401 UNAUTHENTICATED entry for each authenticated endpoint (the three
documented blocks referenced around lines for add/join/remove participant and
the other blocks in ranges 82-100 and 117-133), ensuring the error name
"UNAUTHENTICATED" and brief message (e.g., "인증이 필요합니다") are added to the error
code lists so clients can handle authentication failures; locate these blocks in
the SessionUserController class (the JavaDoc/annotation blocks tied to the
controller methods that manage session participants) and add the 401 entry
consistently to each.

In
`@backend/src/main/java/org/sejongisc/backend/attendance/service/AttendanceService.java`:
- Around line 116-117: The current use of String.valueOf(request.getStatus()) in
AttendanceService turns a null status into the literal "null", breaking null
validation (e.g. STATUS_REQUIRED). Change the assignment to preserve nulls
instead of converting them: read the raw request.getStatus() (or explicitly set
to null when request.getStatus() == null) and let the existing
null-check/validation (STATUS_REQUIRED) handle it; update any downstream checks
in AttendanceService that expect a null to validate accordingly.

In
`@backend/src/main/java/org/sejongisc/backend/attendance/service/SessionUserService.java`:
- Around line 61-63: The info-level log "세션 사용자 추가" is being written before the
DB changes complete and can misrepresent success if later DB ops
(createAbsentForPastRounds, attendanceRepository.deleteAll..., etc.) fail and
trigger a rollback; move the log.info call in SessionUserService so it executes
after createAbsentForPastRounds and any subsequent repository delete/save calls
(i.e., after all transactional DB work in the method completes) to ensure it
only logs on actual success—apply the same change for the similar log around the
code referenced at lines 79-84.

In `@backend/src/main/java/org/sejongisc/backend/common/exception/ErrorCode.java`:
- Line 142: The ErrorCode enum entry ROUND_NOT_FOUND currently includes
unnecessary backtick characters in its message; open the ErrorCode enum, locate
the ROUND_NOT_FOUND constant, and remove the surrounding backticks so the
message reads "해당 출석 라운드가 존재하지 않습니다." to match the format of other ErrorCode
messages and ensure responses do not include literal backtick characters.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fe3d5b2 and a371679.

📒 Files selected for processing (9)
  • backend/src/main/java/org/sejongisc/backend/attendance/controller/AttendanceController.java
  • backend/src/main/java/org/sejongisc/backend/attendance/controller/AttendanceRoundController.java
  • backend/src/main/java/org/sejongisc/backend/attendance/controller/AttendanceSessionController.java
  • backend/src/main/java/org/sejongisc/backend/attendance/controller/SessionUserController.java
  • backend/src/main/java/org/sejongisc/backend/attendance/service/AttendanceAuthorizationService.java
  • backend/src/main/java/org/sejongisc/backend/attendance/service/AttendanceService.java
  • backend/src/main/java/org/sejongisc/backend/attendance/service/AttendanceSessionService.java
  • backend/src/main/java/org/sejongisc/backend/attendance/service/SessionUserService.java
  • backend/src/main/java/org/sejongisc/backend/common/exception/ErrorCode.java
💤 Files with no reviewable changes (1)
  • backend/src/main/java/org/sejongisc/backend/attendance/service/AttendanceSessionService.java

Copy link
Contributor

@discipline24 discipline24 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다~

@discipline24 discipline24 merged commit 8d719c5 into main Mar 1, 2026
1 check passed
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.

🚀 [기능개선][출석체크] 출석체크 description 추가 및 업데이트

2 participants