feat: #1 planner 모델 작성 - #2
Draft
wngjs8114 wants to merge 3 commits into
Draft
Conversation
…ryPlan, RecoveryPlanItem)
- study_task FK를 CASCADE에서 PROTECT로 변경 (과거 계획 기록 보존) - ProgressLog를 OneToOneField로 변경 (하루 한 번 결과 입력 정책) - completed_amount를 completion_percent(0~100)로 명확화 - RecoveryPlan에 recovery_group_id(UUID) 추가 (분량유지형/핵심집중형 비교 그룹) - exams.Exam, exams.StudyTask 참조를 문자열 참조로 변경 - planner/admin.py 등록 - shell 테스트로 PROTECT, OneToOne, group_id 정상 동작 검증
wngjs8114
marked this pull request as draft
July 27, 2026 09:54
1 task
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.
관련 이슈
Closes #1
작업 내용
planner 앱의 핵심 모델 작성 및 마이그레이션 확인
DailyPlan: 날짜별 학습 계획 (시험, 날짜, 가용시간, 계획시간, 상태)DailyPlanItem: 계획 내 개별 작업 항목 (계획 생성 당시 planned_minutes를 별도 저장 → 이후 StudyTask 예상시간이 바뀌어도 과거 계획 기록 불변)ProgressLog: 진행 결과 기록 (완료/일부완료/못함, 실제 진행시간·진행량)RecoveryPlan: 복구안 (분량 유지형 / 핵심 집중형)RecoveryPlanItem: 복구안 내 개별 작업 변경 내역 (원래 날짜, 변경 날짜, 액션 타입, 사유)참고 사항
planner가exams.Exam,exams.StudyTask를 FK로 참조하는 구조라, 로컬에서는exams/models.py를 임시로 채워서makemigrations/migrate가 정상 동작하는지 검증했습니다.planner/models.py와planner/migrations/0001_initial.py만 포함되어 있으며,exams/accounts/core/choices.py는 담당자(장희원) 확정 후 별도 PR로 올라갈 예정입니다.core.choices의DailyPlanStatus,ProgressStatus,RecoveryType,RecoveryPlanStatus,RecoveryActionType은 로컬 테스트 시 사용한 Enum이며, 실제core/choices.py에는 아직 반영되지 않았습니다. 병합 전 공통 Enum 정의 관련 팀 합의가 필요합니다.테스트
python manage.py makemigrations정상 동작 확인python manage.py migrate정상 동작 확인 (exams 임시 모델 기준)study_taskFK: CASCADE → PROTECT 변경 (과거 계획/복구 기록 보존)ProgressLog.daily_plan_item: ForeignKey → OneToOneField (하루 1회 결과 입력 정책)completed_amount→completion_percent(0~100)로 단위 명확화RecoveryPlan.recovery_group_id(UUID) 추가 — 같은 계산 시점에 생성된 분량유지형/핵심집중형을 그룹으로 묶어 비교 가능exams.Exam,exams.StudyTask→ 문자열 참조('exams.Exam')로 변경, 직접 import 제거planner/admin.py5개 모델 등록Shell 검증 완료
ProtectedError정상 발생 (StudyTask 삭제 시 PROTECT 작동 확인)item.progress_logOneToOne 역참조 정상recovery_group_id로 생성한 두 RecoveryPlan 정상 필터링 (count=2)보류 중 (미해결)
DailyPlanItem.statusvsProgressLog.progress_status) 동기화는 서비스 레이어(planner/services/) 구현 시 반영 예정.ProgressLog를 상태의 기준(source of truth)으로 삼고, 갱신 시 트랜잭션으로 함께 처리하는 방향으로 진행하겠습니다.exams 쪽 진행 상황 공유되면 바로 rebase하겠습니다.
업데이트 (ExamPeriod 구조 반영)
ExamPeriod가 전체 시험기간, Exam이 개별 과목으로 분리됨에 따라
DailyPlan과 RecoveryPlan의 참조 대상을 ExamPeriod로 변경했습니다.
최종 migration은 exams 모델 병합 후 다시 생성할 예정입니다.
리뷰 요청
@h2ew0n — planner가 참조하는 exams.Exam / exams.StudyTask 필드 구조가 이 방향으로 맞는지 확인 부탁드립니다.