Repository navigation
[feat] 당일 봉사 미이행 처리와 날짜별 기록 API - #251
Merged
Merged
Conversation
4 of 6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✨ 작업 내용
당일 봉사자로 지정됐는데 봉사를 하지 않은 학생(미이행)을 기록하고, 날짜별로 조회하는 API를 추가했습니다.
POST /api/v1/volunteer/{studentId}/duty/missed{delta, reason}→ 명단 항목GET /api/v1/volunteer/duties?date=yyyy-MM-ddstatus·adjusted·addedCount·reasonGET /api/v1/volunteer/duties/summary?month=yyyy-MM{"2026-10-14": 2}PATCH /api/v1/volunteer/duties/{date}/{studentId}/missedvolunteer_duty.status에MISSED,volunteer_adjustment에duty_id(지정당DUTY_MISSED하나, partial unique)와kind=DUTY_MISSEDMISSED로 바꾸며, 상태 변경·조정 기록·횟수 변경을 한 트랜잭션에서 합니다.delta0이면 미이행만 기록(adjusted: false), 음수는 남은 횟수까지만 차감합니다.ASSIGNED인 지정은 저장값을 바꾸지 않고 조회 때MISSED,adjusted: false로 보입니다.DUTY_MISSED). 완료한 지정은 미이행으로 바꿀 수 없고(409DUTY_ALREADY_COMPLETED), 이미 횟수를 처리한 미이행은 다시 처리할 수 없습니다(409DUTY_ALREADY_ADJUSTED).contracts/volunteer.openapi.yaml)🔍 리뷰 시 참고사항
FOR UPDATE로 잠근 뒤 학생 행을 잠급니다. 완료 처리(지정 UPDATE → 학생 UPDATE)와 잠금 순서가 같아 서로 기다리다 멈추지 않습니다. 같은Idempotency-Key재시도는 지정 잠금으로 줄을 서서 한 번만 반영되고, 다른 지정·종류·delta에 쓴 키는 409IDEMPOTENCY_KEY_REUSED입니다.CANCELLED는 없습니다. 지정 취소는 지금처럼 행을 지우므로 날짜별 기록에 나오지 않습니다.todayDuty에MISSED, 조정 이력kind에DUTY_MISSED가 새로 나옵니다.검증: 빈 PostgreSQL에서
./gradlew clean build통과(테스트 636개, 실패 0). 로컬 개발 DB(기존 데이터 있음)에서는 이번 변경과 무관한FaceTemplateRepositoryTest1개가 남은 데이터 때문에 실패했습니다. 실제 웹 연동은 확인하지 않았습니다.✅ 체크리스트
.env.example등) 변경이 필요한 경우 작성 또는 수정했나요?📎 관련 이슈(선택)
🤖 Generated with Claude Code