Skip to content

Extend core attendance statuses#323

Merged
CSE-Shaco merged 1 commit intoGDGoCINHA:developfrom
CSE-Shaco:develop
Mar 17, 2026
Merged

Extend core attendance statuses#323
CSE-Shaco merged 1 commit intoGDGoCINHA:developfrom
CSE-Shaco:develop

Conversation

@CSE-Shaco
Copy link
Copy Markdown
Contributor

@CSE-Shaco CSE-Shaco commented Mar 17, 2026

📌 연관된 이슈

ex) #이슈번호, #이슈번호

✨ 작업 내용

이번 PR에서 작업한 내용을 간략히 설명해주세요

💬 리뷰 요구사항(선택)

Summary by CodeRabbit

릴리스 노트

  • New Features

    • 출석 상태를 이진 형식에서 다중 상태로 확장: 지각, 사전 예정, 결석 추가 지원
    • 일일 및 전체 출석 현황 리포트에 상태별 상세 집계 포함
    • 세분화된 접근 제어를 통한 보안 강화
  • Chores

    • 출석 데이터베이스 스키마 마이그레이션 수행

@CSE-Shaco CSE-Shaco merged commit bcca779 into GDGoCINHA:develop Mar 17, 2026
1 of 2 checks passed
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 17, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 81f1c3a8-b534-4668-9b7a-52c80ddabc5d

📥 Commits

Reviewing files that changed from the base of the PR and between 294a278 and 9841f30.

📒 Files selected for processing (9)
  • database_schema.sql
  • src/main/java/inha/gdgoc/domain/core/attendance/controller/CoreAttendanceController.java
  • src/main/java/inha/gdgoc/domain/core/attendance/dto/request/SetAttendanceRequest.java
  • src/main/java/inha/gdgoc/domain/core/attendance/dto/response/DaySummaryResponse.java
  • src/main/java/inha/gdgoc/domain/core/attendance/entity/AttendanceRecord.java
  • src/main/java/inha/gdgoc/domain/core/attendance/enums/AttendanceStatus.java
  • src/main/java/inha/gdgoc/domain/core/attendance/repository/AttendanceRecordRepository.java
  • src/main/java/inha/gdgoc/domain/core/attendance/service/CoreAttendanceService.java
  • src/main/resources/db/migration/V20260317__alter_attendance_records_status.sql

Walkthrough

데이터베이스 스키마가 부울 기반 present 필드에서 AttendanceStatus 열거형을 사용하는 다중 상태 시스템으로 변경되었습니다. 엔티티, DTO, 저장소 쿼리, 서비스 로직 및 컨트롤러 권한 규칙이 새 상태 모델을 반영하도록 업데이트되었습니다.

Changes

Cohort / File(s) Summary
데이터베이스 스키마 및 마이그레이션
database_schema.sql, src/main/resources/db/migration/V20260317__alter_attendance_records_status.sql
present BOOLEAN 컬럼을 status VARCHAR(32)로 변경. 마이그레이션은 기존 데이터를 PRESENT/ABSENT로 변환하고 present 컬럼 제거.
열거형 및 엔티티
src/main/java/inha/gdgoc/domain/core/attendance/enums/AttendanceStatus.java, src/main/java/inha/gdgoc/domain/core/attendance/entity/AttendanceRecord.java
새로운 AttendanceStatus 열거형 추가(PRESENT, LATE, PRE_ARRANGED, ABSENT)와 JSON 직렬화 지원. AttendanceRecord 엔티티에서 boolean present 필드를 AttendanceStatus status로 교체.
요청/응답 DTO
src/main/java/inha/gdgoc/domain/core/attendance/dto/request/SetAttendanceRequest.java, src/main/java/inha/gdgoc/domain/core/attendance/dto/response/DaySummaryResponse.java
SetAttendanceRequest는 Boolean presentAttendanceStatus status로 변경. DaySummaryResponse에 late, preArranged, absent 필드 추가.
저장소
src/main/java/inha/gdgoc/domain/core/attendance/repository/AttendanceRecordRepository.java
쿼리 및 업서트 로직을 present 대신 status 사용하도록 업데이트. 메서드 서명에서 boolean을 String으로 변경.
서비스 계층
src/main/java/inha/gdgoc/domain/core/attendance/service/CoreAttendanceService.java
getPresenceMap()getStatusMap() 메서드 이름 변경, isLeadScoped()isTeamScoped() 변경. 퍼블릭 메서드들이 boolean 대신 AttendanceStatus 파라미터 사용. 다중 상태 집계 로직 추가. CSV/행렬 출력 업데이트.
컨트롤러 및 권한
src/main/java/inha/gdgoc/domain/core/attendance/controller/CoreAttendanceController.java
새로운 CORE_OR_HIGHER_RULE 상수 추가, LEAD_OR_HIGHER_RULE을 ORGANIZER에서 LEAD로 변경, ORGANIZER_OR_HIGHER_RULE 제거. 여러 엔드포인트에 미세한 권한 제어 적용.

Sequence Diagram

sequenceDiagram
    participant Client
    participant Controller
    participant Service
    participant Repository
    participant Database

    Client->>Controller: PATCH /attendance (status=LATE)
    Controller->>Service: setAttendance(date, userIds, LATE)
    Service->>Service: isTeamScoped(userRole, team)
    Service->>Service: resolveEffectiveTeam(...)
    Service->>Repository: upsertBatchByMeetingId(meetingId, userIds, "LATE")
    Repository->>Database: UPDATE attendance_records SET status='LATE'
    Database-->>Repository: success
    Repository-->>Service: rows affected
    Service->>Repository: getStatusMap(date)
    Repository->>Database: SELECT userId, status FROM attendance_records
    Database-->>Repository: [(userId, LATE), ...]
    Repository-->>Service: Map<Long, AttendanceStatus>
    Service->>Service: countStatus(users, statusMap, PRESENT/LATE/etc)
    Service-->>Controller: DaySummaryResponse
    Controller-->>Client: 200 OK {present, late, preArranged, absent}
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 Status springs forth in shades of four,
No more true-false to our core!
LATE, ARRANGED, or ABSENT bright,
Present too—what a delight!
Attendance tracking takes its flight! 🐾

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

CodeRabbit can generate a title for your PR based on the changes.

Add @coderabbitai placeholder anywhere in the title of your PR and CodeRabbit will replace it with a title based on the changes in the PR. You can change the placeholder by changing the reviews.auto_title_placeholder setting.

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.

1 participant