Skip to content

[BE] SISC1-224 [FIX] 출석 라운드 관련 수정#143

Merged
Kosw6 merged 4 commits intomainfrom
SISC1-224-BE-출석-라운드-관련-수정
Nov 26, 2025

Hidden character warning

The head ref may contain hidden characters: "SISC1-224-BE-\ucd9c\uc11d-\ub77c\uc6b4\ub4dc-\uad00\ub828-\uc218\uc815"
Merged

[BE] SISC1-224 [FIX] 출석 라운드 관련 수정#143
Kosw6 merged 4 commits intomainfrom
SISC1-224-BE-출석-라운드-관련-수정

Conversation

@ochanhyeok
Copy link
Contributor

@ochanhyeok ochanhyeok commented Nov 25, 2025

Summary by CodeRabbit

출석 관리 기능 업데이트

  • Refactor
    • 출석 체크인 엔드포인트 제거
    • API 응답 필드명 변경 (roundId → id, roundDate → date)
    • 세션 시간 설정 형식 변경 (날짜-시간 형식 → 시간 형식만 사용)
    • 출석 인정 시간 창 단위 변경 (초 → 분)
    • 지각 판정 로직 개선

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 25, 2025

Walkthrough

체크인 엔드포인트와 서비스 메서드를 제거하고, 시간 필드를 LocalDateTime에서 LocalTime으로 변경하며, 시간 윈도우를 초 단위(seconds)에서 분 단위(minutes)로 변환합니다. 라운드 기반 체크인 흐름으로의 전환을 완료하고 DTO 필드명을 단순화합니다.

Changes

Cohort / File(s) 요약
체크인 엔드포인트 및 서비스 제거
backend/src/main/java/org/sejongisc/backend/attendance/controller/AttendanceController.java, backend/src/main/java/org/sejongisc/backend/attendance/service/AttendanceService.java
POST /sessions/{sessionId}/check-in 엔드포인트와 checkIn 서비스 메서드 제거. 인사말 체크인 흐름 완전 삭제
DTO 필드 단순화
backend/src/main/java/org/sejongisc/backend/attendance/dto/AttendanceRoundResponse.java
roundId → id, roundDate → date로 필드명 변경. 빌더 API 및 매핑 업데이트
세션 요청 DTO 시간 모델 변경
backend/src/main/java/org/sejongisc/backend/attendance/dto/AttendanceSessionRequest.java
startsAt(LocalDateTime) → defaultStartTime(LocalTime) 변경. windowSeconds → allowedMinutes(초 → 분 단위). 유효성 검사 규칙 업데이트
엔티티 시간 필드 리팩토링
backend/src/main/java/org/sejongisc/backend/attendance/entity/AttendanceSession.java, backend/src/main/java/org/sejongisc/backend/attendance/entity/Attendance.java
AttendanceSession: startsAt → defaultStartTime, windowSeconds → allowedMinutes 변경. getEndTime(), isCheckInAvailableForRound() 신규 메서드 추가. Attendance.isLate() 로직을 라운드 기반으로 업데이트
서비스 로직 업데이트
backend/src/main/java/org/sejongisc/backend/attendance/service/AttendanceSessionService.java
getActiveSessions에서 시간 기반 계산을 상태 기반 필터링으로 변경. createSession/updateSession에서 새로운 필드명 사용. activateSession에서 타임스탬프 조정 제거
테스트 업데이트
backend/src/test/java/org/sejongisc/backend/attendance/controller/AttendanceRoundControllerTest.java
AttendanceRoundResponse 필드명 변경(roundId → id, roundDate → date)에 따른 빌더 호출 및 JSON 어설션 업데이트

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant RoundController
    participant RoundService
    participant DB

    Client->>RoundController: POST /rounds/{roundId}/check-in
    RoundController->>RoundService: checkInByRound(roundId, userId)
    
    rect rgb(200, 220, 255)
    Note over RoundService: 라운드 기반 체크인<br/>(현재 흐름)
    RoundService->>DB: 라운드 조회
    RoundService->>DB: 출석 확인 (중복 체크)
    RoundService->>RoundService: isLate() 판정<br/>(라운드 시작시간 + 5분)
    RoundService->>DB: 출석 레코드 저장
    end
    
    RoundService-->>RoundController: AttendanceResponse
    RoundController-->>Client: 200 OK
Loading
sequenceDiagram
    participant System
    participant AttendanceSession
    participant Attendance

    Note over System: 세션 시간 모델 변경
    
    rect rgb(255, 230, 200)
    Note over AttendanceSession: 기존 (제거됨)<br/>startsAt: LocalDateTime<br/>windowSeconds: Integer (초)
    end
    
    rect rgb(200, 255, 220)
    Note over AttendanceSession: 신규<br/>defaultStartTime: LocalTime<br/>allowedMinutes: Integer (분)
    AttendanceSession->>AttendanceSession: getEndTime()<br/> = defaultStartTime + allowedMinutes
    AttendanceSession->>Attendance: isCheckInAvailableForRound(currentTime)
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

  • 주요 검토 포인트:
    • AttendanceController/AttendanceService에서 checkIn 메서드 제거에 따른 전체 시스템 영향도 확인 필요
    • Attendance.isLate() 로직의 round/session 기반 분기 처리 동작 검증
    • AttendanceSessionRequest의 LocalDateTime → LocalTime 변환에 따른 데이터 변환 무결성 확인
    • AttendanceSessionService.getActiveSessions의 시간 기반 → 상태 기반 필터링 변경의 비즈니스 로직 영향
    • 마이그레이션 스크립트 또는 DB 스키마 변경 필요 여부 확인 (column 이름 변경: starts_at → default_start_time, window_seconds → allowed_minutes)
    • 이전 체크인 엔드포인트 호출 클라이언트의 영향 범위 확인

Possibly related PRs

Suggested reviewers

  • discipline24

🐰 체크인 흐름을 라운드로 모으니,

시간도 깔끔하게 분 단위로 재단하고,

필드명도 반짝반짝하게 정리했네요!

라운드 기반의 세상으로 ✨

출석 관리 더욱 명료해졌어요 🎉

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 70.59% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목이 변경사항의 주요 내용과 부분적으로 관련되어 있습니다. '출석 라운드 관련 수정'은 실제 변경사항의 일부(라운드 관련 필드명 변경, isLate() 로직 수정)를 반영하지만, 체크인 엔드포인트 제거 및 AttendanceSession의 주요 시간 필드 변경 같은 더 광범위한 변경사항을 완전히 포함하지 않습니다.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch SISC1-224-BE-출석-라운드-관련-수정

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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: 2

🧹 Nitpick comments (1)
backend/src/main/java/org/sejongisc/backend/attendance/service/AttendanceSessionService.java (1)

87-108: 정렬 순서를 명시적으로 지정하는 것을 권장합니다.

주석에는 "생성 순으로 정렬"이라고 명시되어 있지만, 코드는 findAll()만 호출하여 레포지토리의 기본 정렬에 의존하고 있습니다. UI에서 특정 순서를 기대한다면 명시적으로 정렬 기준을 지정하는 것이 좋습니다.

다음과 같이 명시적 정렬을 추가할 수 있습니다:

List<AttendanceSession> sessions = attendanceSessionRepository.findAllByOrderByCreatedAtDesc();

또는 레포지토리 메서드가 없다면:

List<AttendanceSession> sessions = attendanceSessionRepository.findAll();
sessions.sort((a, b) -> b.getCreatedAt().compareTo(a.getCreatedAt()));
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8e861a1 and c67f101.

📒 Files selected for processing (8)
  • backend/src/main/java/org/sejongisc/backend/attendance/controller/AttendanceController.java (0 hunks)
  • backend/src/main/java/org/sejongisc/backend/attendance/dto/AttendanceRoundResponse.java (3 hunks)
  • backend/src/main/java/org/sejongisc/backend/attendance/dto/AttendanceSessionRequest.java (3 hunks)
  • backend/src/main/java/org/sejongisc/backend/attendance/entity/Attendance.java (1 hunks)
  • backend/src/main/java/org/sejongisc/backend/attendance/entity/AttendanceSession.java (3 hunks)
  • backend/src/main/java/org/sejongisc/backend/attendance/service/AttendanceService.java (0 hunks)
  • backend/src/main/java/org/sejongisc/backend/attendance/service/AttendanceSessionService.java (9 hunks)
  • backend/src/test/java/org/sejongisc/backend/attendance/controller/AttendanceRoundControllerTest.java (8 hunks)
💤 Files with no reviewable changes (2)
  • backend/src/main/java/org/sejongisc/backend/attendance/service/AttendanceService.java
  • backend/src/main/java/org/sejongisc/backend/attendance/controller/AttendanceController.java
🔇 Additional comments (11)
backend/src/test/java/org/sejongisc/backend/attendance/controller/AttendanceRoundControllerTest.java (1)

79-80: DTO 필드명 변경에 맞춰 테스트가 올바르게 업데이트되었습니다.

빌더 메서드와 JSON 경로 단언문이 모두 새로운 필드명(id, date)으로 일관되게 수정되었습니다.

Also applies to: 94-95, 128-129, 141-141, 154-155, 162-163, 195-196, 210-210, 322-323

backend/src/main/java/org/sejongisc/backend/attendance/dto/AttendanceRoundResponse.java (2)

71-72: 엔티티-DTO 매핑이 올바르게 구현되었습니다.

엔티티의 getRoundId(), getRoundDate() 메서드를 새로운 DTO 필드(id, date)에 정확하게 매핑하고 있습니다.


29-29: 공개 API 필드명 변경에 대한 Breaking Change가 확인되었습니다.

내부 코드 검증 결과, AttendanceRoundResponse의 필드명 변경(roundIdid, roundDatedate)이 의도적으로 구현되었으며, fromEntity() 메서드에서 엔티티 메서드를 올바르게 매핑하고 있습니다.

그러나 이는 여전히 공개 API 소비자에게 영향을 주는 Breaking Change입니다. 이 API를 사용하는 외부 클라이언트(프론트엔드, 외부 서비스 등)가 JSON 응답 필드명 변경을 반영해야 합니다. 다음을 확인해주세요:

  1. API 버전 관리 전략 (기존 v1 유지 vs 새 v2 사용)
  2. 클라이언트 마이그레이션 일정 및 공지
  3. 적절한 API 문서 업데이트
backend/src/main/java/org/sejongisc/backend/attendance/entity/Attendance.java (1)

71-92: 지각 판단 로직이 올바르게 구현되었습니다.

라운드 기반과 세션 기반을 모두 지원하는 2단계 fallback 로직이 명확하게 구현되어 있습니다. null 체크도 적절하며, 5분 버퍼가 일관되게 적용되고 있습니다.

backend/src/main/java/org/sejongisc/backend/attendance/service/AttendanceSessionService.java (4)

37-68: 세션 생성 로직이 새로운 필드명을 올바르게 사용합니다.

defaultStartTimeallowedMinutes 필드로의 전환이 정확하게 반영되어 있으며, 로깅도 적절합니다.


130-160: 세션 수정 로직이 올바르게 업데이트되었습니다.

새로운 필드명으로의 전환이 정확하게 반영되어 있습니다.


278-297: 응답 변환 로직이 올바르게 구현되었습니다.

새로운 필드명과 타입 변환이 정확하게 처리되고 있습니다.


115-123: 원본 리뷰 코멘트의 우려는 설계에 반영되어 있으며 부정확합니다.

코드 분석 결과:

  • 시간 기반 검증이 제거되지 않고 라운드 레벨로 이동되었습니다
  • AttendanceSessionService 라인 112 주석: "현재 체크인 가능한 세션들만 필터링 (라운드 기반)"
  • AttendanceRound.isCheckInAvailable()이 날짜와 시간 검증을 담당합니다
  • AttendanceService의 체크인 로직(라인 79)에서 라운드 시간 검증이 실행됩니다

이 구조에서:

  • 세션 상태 OPEN = "체크인 가능한 상태" (의도된 의미)
  • 라운드가 날짜/시간 제약 조건을 관리
  • 라인 181 주석에서 "라운드 기반이므로 세션 상태만 변경"이라 명시

따라서 세션이 라운드 없이 OPEN 상태로 유지되어도, 실제 체크인은 라운드의 시간 검증을 통과해야 하므로 원본 코멘트의 우려는 설계에 이미 반영되어 있습니다.

Likely an incorrect or invalid review comment.

backend/src/main/java/org/sejongisc/backend/attendance/dto/AttendanceSessionRequest.java (1)

29-36: 시간 필드가 적절하게 변경되었습니다.

LocalTime 타입으로의 변경이 올바르며, @Future 제약 조건 제거는 날짜 컨텍스트가 없는 시간 전용 필드에 적합합니다.

backend/src/main/java/org/sejongisc/backend/attendance/entity/AttendanceSession.java (2)

30-34: 엔티티 필드가 올바르게 업데이트되었습니다.

defaultStartTimeallowedMinutes로의 변경이 정확하며, 컬럼 매핑도 적절합니다.


61-70: 시간 계산 및 체크인 가능 여부 확인 로직이 올바릅니다.

getEndTime()의 null 처리와 isCheckInAvailableForRound()의 시간 비교 로직이 적절하게 구현되어 있습니다.

@Kosw6 Kosw6 merged commit a2772a6 into main Nov 26, 2025
1 check passed
@Kosw6 Kosw6 deleted the SISC1-224-BE-출석-라운드-관련-수정 branch November 26, 2025 03:44
Kosw6 added a commit that referenced this pull request Nov 26, 2025
Kosw6 added a commit that referenced this pull request Nov 26, 2025
@Kosw6 Kosw6 restored the SISC1-224-BE-출석-라운드-관련-수정 branch November 26, 2025 04:44
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.

2 participants