[WTH-475] 캘린더 api 구현 - #99
Hidden character warning
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 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. Comment |
| val name: String, | ||
| @field:Schema(description = "학과", example = "컴퓨터공학과") | ||
| val department: String?, | ||
| @field:Schema(description = "직급", example = "USER") |
There was a problem hiding this comment.
저희가 지금 직급이라고 용어를 쓰고 있었나용..? 기억이...가물가물..
There was a problem hiding this comment.
직급이란 용어 안 썼던것 같은데 역할...? 뭐라고 해야할까요..
There was a problem hiding this comment.
다른 dto에서는 권한이나 멤버 권한으로 통일되어 있는데 피그마에 직급으로 표기되어 있어서 그대로 사용했었습니다,,, 권한으로 수정하겠습니당!
| else -> ScheduleAttendanceStatus.ABSENT | ||
| } | ||
| } | ||
| return when (attendance.status) { |
There was a problem hiding this comment.
if 문 대신 쓰면 좋을 kotlin 문법입니당 한 번 찾아보시면 좋을 것 같아용
|
|
||
| @GetMapping("/yearly") | ||
| @Operation(summary = "연도별 일정 조회") | ||
| @Operation(summary = "연도별 일정 조회", hidden = true) |
There was a problem hiding this comment.
안쓰고 있다면 Deprecated 처리해줘도 좋을 것 같아요 FE 분들이 구분하기 편하게
There was a problem hiding this comment.
hidden = true는 제거하고 deprecated = true로 처리했습니다!!
| now.isBefore(session.start) -> ScheduleAttendanceStatus.UPCOMING | ||
| session.status == SessionStatus.OPEN && !now.isAfter(session.end) -> ScheduleAttendanceStatus.OPEN |
There was a problem hiding this comment.
저희 세션 시작 전후 10분까지 출석이 가능해서 +- 10을 추가해야할 것 같습니도!
There was a problem hiding this comment.
Session.isCheckInAllowed()에 이미 +-10분 로직이 있어서 해당 메서드를 활용하는 방향으로 수정했습니당!!
📌 Summary
캘린더 화면에서 사용할 월별 일정 조회 및 일정 상세 조회 API를 추가합니다
📝 Changes
What
GET /api/v4/clubs/{clubId}/schedules/monthly— 월별 일정 조회에cardinal쿼리 파라미터 추가GET /api/v4/clubs/{clubId}/schedules/{id}?type=EVENT|SESSION— 일정 상세 조회 API 신규 추가GET /api/v4/clubs/{clubId}/schedules/yearly— Swagger에서 hidden 처리 (미사용)Why
캘린더 화면에서 기수 드롭다운으로 선택한 기수의 일정을 조회합니다
상세 조회는 일반 일정(Event)과 세션(Session)의 ID가 각각 독립 시퀀스로 생성되어 중복될 수 있기 때문에,
type파라미터로 구분합니다How
월별 일정 조회
EventRepository,SessionRepository에clubId + cardinal + 날짜 범위조건의 쿼리 추가GetScheduleQueryService.findMonthly()에cardinal: Int파라미터 추가 및 기수 필터 쿼리 적용상세 일정 조회
type=EVENT: Event 테이블에서 조회, 출석 관련 필드 전부null반환type=SESSION: Session 조회 +AttendanceReader로 참석자 목록 및 현재 유저 출석 상태 계산ScheduleAttendanceStatus) 도출 로직:COMPLETED:Attendance.status == ATTEND→attendedAt(=modifiedAt) 포함ABSENT:Attendance.status == ABSENTOPEN:PENDING+Session.status == OPEN+ 현재 시각이 세션 시간 내UPCOMING: 그 외PENDINGAttendanceRepository.findAllBySession()(EntityGraph로 N+1 방지)FileAccessUrlPort로 storageKey → URL 변환📸 Screenshots / Logs
💡 Reviewer 참고사항
출석 완료 시간(
attendedAt) 관련Attendance엔티티에 별도attendedAt컬럼이 없어서BaseEntity.modifiedAt을 출석 완료 시간으로 사용했습니다!attend()호출 시 JPA가modifiedAt을 갱신하기에 출석 시각과 동일하다고 생각해서 사용했습니다...!!cardinal파라미터 필요 여부 논의cardinal파라미터를 추가했습니다. 기수별 활동 기간이 겹치지 않는다면 날짜 범위만으로도 필터가 가능하지만, 프론트에서 해당 기수의 기간을 알 수 없다고 판단해 기수를 명시적으로 전달하는 방식을 채택했습니닷...!! 의견 있으시면 코멘트 남겨주세요!✅ Checklist