Skip to content

fix :: PICNIC 상태 등록 시 자동 상태 복구 불가 버그 수정 - #674

Merged
1210thatman merged 1 commit into
developfrom
672-현장체험학습으로-상태-변경-시-자동-상태-복구-불가
Jun 4, 2026

Hidden character warning

The head ref may contain hidden characters: "672-\ud604\uc7a5\uccb4\ud5d8\ud559\uc2b5\uc73c\ub85c-\uc0c1\ud0dc-\ubcc0\uacbd-\uc2dc-\uc790\ub3d9-\uc0c1\ud0dc-\ubcf5\uad6c-\ubd88\uac00"
Merged

1210thatman merged 1 commit into
developfrom
672-현장체험학습으로-상태-변경-시-자동-상태-복구-불가

Conversation

@1210thatman

Copy link
Copy Markdown
Contributor

문제 원인

PICNIC(현장체험학습)으로 상태 변경 후 매일 21:00에 실행되는 리셋 스케줄러가 동작하지 않는 버그 두 가지가 겹쳐 있었습니다.


Bug 1: ResetStatusService — @Transactional(readOnly = true) 로 인한 리셋 불가

// 수정 전
@Transactional(readOnly = true)
override fun reset() {
    // ...
    saveStatusPort.saveAll(update)  // readOnly = true → flush 안 됨 → DB 미반영
}

// 수정 후
@Transactional
override fun reset() {

readOnly = true로 설정 시 JPA의 FlushMode가 MANUAL로 강제되어 saveAll() 호출이 있어도 실제 DB에 커밋되지 않았습니다. PICNIC뿐 아니라 모든 상태 리셋이 동작하지 않는 근본 원인이었습니다.


Bug 2: ResetAttendanceService — PICNIC 출석 상태를 영구 보존 처리

// 수정 전
when (currentStatus) {
    AttendanceStatus.DROPOUT, AttendanceStatus.PICNIC, AttendanceStatus.EMPLOYMENT -> currentStatus
    else -> AttendanceStatus.ATTENDANCE
}

// 수정 후
when (currentStatus) {
    AttendanceStatus.DROPOUT, AttendanceStatus.EMPLOYMENT -> currentStatus
    else -> AttendanceStatus.ATTENDANCE
}

퇴학(DROPOUT)·취업(EMPLOYMENT)은 영속성 유지가 맞지만, 현장체험학습(PICNIC)은 하루짜리 상태이므로 다음날 ATTENDANCE로 돌아와야 합니다.


영향 범위

  • ScheduleService.resetTable() (매일 21:00 실행) 내 resetStatusUseCase.reset() + resetAttendanceUseCase.resetAttendance() 정상화
  • PICNIC 상태 학생이 다음날 자동으로 ATTENDANCE로 복구됨

Test plan

  • PICNIC으로 상태 변경 후 reset() 호출 시 Status가 ATTENDANCE로 변경되는지 확인
  • PICNIC 상태의 출석(period6~10)이 리셋 후 ATTENDANCE로 돌아오는지 확인
  • DROPOUT, EMPLOYMENT 상태는 리셋 후에도 유지되는지 확인

🤖 Generated with Claude Code

1. ResetStatusService의 @transactional(readOnly = true) 제거
   - readOnly = true로 인해 flush가 되지 않아 모든 상태 리셋이 DB에 반영되지 않던 문제 수정

2. ResetAttendanceService에서 PICNIC 보존 조건 제거
   - PICNIC(현장체험학습)을 DROPOUT/EMPLOYMENT와 동일하게 영구 보존 처리하던 문제 수정
   - 일일 리셋 시 ATTENDANCE로 정상 복구되도록 변경

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@1210thatman, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 56 minutes and 41 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: aa842300-ee5e-4120-96ba-658c06f7fd5a

📥 Commits

Reviewing files that changed from the base of the PR and between 44ece16 and a3365a5.

📒 Files selected for processing (2)
  • src/main/kotlin/dsm/pick2024/domain/attendance/service/ResetAttendanceService.kt
  • src/main/kotlin/dsm/pick2024/domain/status/service/ResetStatusService.kt
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 672-현장체험학습으로-상태-변경-시-자동-상태-복구-불가

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.

@1210thatman 1210thatman self-assigned this Jun 4, 2026
@1210thatman
1210thatman merged commit fc1d437 into develop Jun 4, 2026
2 checks 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.

현장체험학습으로 상태 변경 시 자동 상태 복구 불가

2 participants