Skip to content

fix: 2025/2026학년도 학과 정보 오류와 저장 시 검증 누락 수정 - #2509

Merged
taejinn merged 3 commits into
developfrom
fix/2508-academic-program-year-validation
Oct 14, 2026
Merged

taejinn merged 3 commits into
developfrom
fix/2508-academic-program-year-validation

Conversation

@taejinn

@taejinn taejinn commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

🔍 개요

#2507의 V19를 먼저 develop에 병합한 뒤 이 PR을 병합해야 합니다. 배포할 때도 V19 → V20 순서로 적용해야 합니다.

2025학번이 미래융합학부로 저장되는 등 연도별 학과 정보에 잘못된 내용이 있었습니다. 같은 학부와 전공으로 다시 저장할 때는 검증도 생략되어, 잘못된 정보로 팀원 모집 지원서를 계속 작성할 수 있었습니다.

2025/2026학년도 대학요람에 맞게 학과 정보를 수정하고, 학부나 전공을 바꾸지 않았더라도 해당 학번에 맞는지 확인하도록 합니다.


🚀 주요 변경 내용

  • 대학요람에 맞게 학부와 전공의 연도 연결 수정

    • V20에 반영한 목록은 2025학년도 11개 학부/학과와 26개 연결, 2026학년도 18개 학부/학과와 36개 연결입니다.
    • 일학습병행의 기전융합공학과, 기계설계공학과, 강소기업경영학과와 2026학년도 글로벌인재학부도 포함합니다.
    • 빠진 학부와 전공, 연도 연결은 추가하고 잘못된 것으로 확인한 연결만 삭제합니다. ID를 고정해서 사용하지 않고 이름과 소속 학부로 기존 데이터를 찾아 연결합니다.
    • 이미 수정된 데이터는 그대로 두며, 다른 연도나 이번 수정에 포함되지 않은 연결도 유지합니다.
  • 학부나 전공을 바꾸지 않아도 학번에 맞는지 확인

    • 학적 정보 수정 API와 기존 회원정보 수정 API, 관리자 학생 수정 API에서 저장할 학부와 전공을 확인합니다. 전공을 보내지 않아 기존 값이 유지될 때도 저장된 전공을 확인합니다.
    • 2027학번처럼 해당 연도의 학과 정보가 DB에 하나도 없을 때만 학번에 맞는 학부와 전공인지 확인하는 과정을 생략합니다. 하나라도 등록되어 있으면 확인하며, 학번 형식과 학부 및 전공이 실제로 존재하는지는 기존대로 검사합니다.
  • 학번이나 학부를 빼서 저장하는 요청 거절

    • 연도 데이터를 조회하기 전에 학번 전체가 올바른 형식인지, 학부가 있는지 확인합니다. 전공이 있으면 선택한 학부에 속하는지도 먼저 확인하므로, 연도 데이터가 없다는 이유로 잘못된 값을 저장할 수 없습니다.
    • 기존 회원정보 수정과 이메일 회원가입, 관리자 학생 수정에서도 학번과 학부를 필수로 받습니다. 이미 발급된 이메일 인증 정보로 가입을 완료할 때도 다시 검사합니다.
    • 학적 정보 수정 API에서 학번을 보내지 않으면 기존 학번으로 검사합니다. 기존 학번도 없거나 잘못됐다면 거절하며, 학부는 생략할 수 없습니다.
  • 지원서를 제출할 때도 학번과 학부 확인

    • 팀원 모집 지원서에 회원정보를 저장하기 전에 해당 학번에 선택할 수 있는 학부인지 확인합니다.
    • 이때도 해당 연도의 학과 정보가 DB에 전혀 없으면 이 확인만 생략하며, 지원에 필요한 학번과 학부는 입력되어 있어야 합니다.

💬 참고 사항

  • 기존 회원정보 처리

    • 이번 마이그레이션으로 기존 사용자의 학번, 학부, 전공이나 기존 학부 및 전공 데이터를 바꾸거나 삭제하지 않습니다. 잘못 저장된 회원정보는 사용자가 직접 수정해야 합니다.
    • 전체 학과 목록에는 과거 학부명과 변경된 학과명이 기존처럼 함께 표시됩니다.
  • 병합 및 배포 순서

    • #2507의 V19가 develop에 반영됐고 개발 서버 적용도 끝났습니다. V20은 V19 다음에 적용해야 합니다.
    • V19 파일은 V19__split_cafeteria_weekend_hours.sql이며, 이번 학과 정보 수정은 V20__correct_academic_program_catalog_2025_2026.sql에 들어 있습니다.
  • 기준 자료


🧪 검증

  • 테스트와 빌드

    • 학적, 회원정보, 학과 목록, 팀원 모집 관련 테스트 235개가 모두 통과했으며 건너뛴 테스트는 없습니다.
    • bootJar 빌드가 통과했고 결과물에 V20 파일이 포함된 것도 확인했습니다. git diff --check도 통과했습니다.
  • 학적 저장 테스트

    • 잘못된 학부를 그대로 보내거나 전공을 보내지 않아 잘못된 기존 전공이 유지되는 요청을 확인했습니다. 기존 회원정보 수정 API에서도 검사하는지 확인했습니다.

    • 2027년 학과 정보가 전혀 없으면 허용하고 하나라도 등록되어 있으면 검사하는지 확인했습니다. 존재하지 않는 학부와 전공, 잘못된 학번 형식도 확인했습니다.

    • 학번과 학부 누락, 저장된 학번의 형식 오류, 다른 학부 소속인 기존 전공을 유지하는 요청을 거절하고 기존 회원정보가 그대로 남는지 확인했습니다. 관리자 수정과 이메일 인증 완료에서도 검사하며, 정상적인 2027학번은 연도 데이터가 없으면 저장할 수 있습니다.

  • Flyway 실행 테스트

    • V19와 V20을 함께 넣은 상태에서도 마이그레이션 테스트 14개와 bootJar 빌드가 통과했습니다.
    • MySQL에서 Flyway를 실행해 잘못된 연결은 수정하고 이미 수동으로 수정한 데이터는 그대로 두는지 확인했습니다.
    • 데이터가 없는 상태에서도 필요한 학부와 전공, 연도 연결이 추가되며 다시 실행해도 중복되지 않는지 확인했습니다. 다른 연도와 이번 수정에 포함되지 않은 연결도 그대로 남습니다.
    • 이름이 중복되어 어느 데이터를 연결해야 할지 구분할 수 없으면 실행을 중단하고, 연결을 추가하다 오류가 나면 변경한 내용을 되돌리는지 확인했습니다.

✅ Checklist (완료 조건)

  • 코드 스타일 가이드 준수
  • 테스트 코드 포함됨
  • Reviewers / Assignees / Labels 지정 완료
  • 보안 및 민감 정보 검증 (API 키, 환경 변수, 개인정보 등)
  • #2507의 V19가 develop에 먼저 반영됨. 배포 시 V19 → V20 순서 적용.

Summary by CodeRabbit

  • Bug Fixes
    • Academic information updates now check departments and majors against the student’s admission-year program catalog, including when resaving unchanged information. Clearing a department is rejected without changing saved academic information.
    • Recruitment applications now verify that an applicant’s department is valid for their admission year.
    • Registration, profile updates, and administrator updates now reject missing or invalid academic details and student numbers.
    • Corrected the 2025–2026 academic program catalog so year-specific department and major listings reflect the applicable programs.

@taejinn taejinn added 버그 정상적으로 동작하지 않는 문제상황입니다. DB DB 마이그레이션을 위한 라벨입니다. labels Oct 14, 2026
@taejinn taejinn self-assigned this Oct 14, 2026
@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 769e32b3-4dd5-42ae-9ad8-9b461f8c6c53
📥 Commits

Reviewing files that changed from the base of the PR and between 3a6007c and 2cad393.

📒 Files selected for processing: 11
  • src/main/java/in/koreatech/koin/admin/student/dto/AdminStudentUpdateRequest.java
  • src/main/java/in/koreatech/koin/admin/student/service/AdminStudentService.java
  • src/main/java/in/koreatech/koin/domain/student/dto/RegisterStudentRequest.java
  • src/main/java/in/koreatech/koin/domain/student/dto/UpdateStudentAcademicInfoRequest.java
  • src/main/java/in/koreatech/koin/domain/student/dto/UpdateStudentRequest.java
  • src/main/java/in/koreatech/koin/domain/student/service/StudentService.java
  • src/main/java/in/koreatech/koin/domain/student/service/StudentValidationService.java
  • src/main/java/in/koreatech/koin/domain/team/recruitment/service/TeamRecruitmentApplicationService.java
  • src/test/java/in/koreatech/koin/acceptance/domain/AcademicProgramYearApiTest.java
  • src/test/java/in/koreatech/koin/acceptance/domain/StudentAcademicValidationApiTest.java
  • src/test/java/in/koreatech/koin/unit/domain/team/recruitment/service/TeamRecruitmentApplicationServiceTest.java

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The change corrects the 2025–2026 academic-program catalog and centralizes academic-program validation. Student updates, registration, authentication, administrator updates, and team recruitment application snapshots now use validation based on the student-number year.

Changes: Academic program catalog and validation

Layer / File(s) Summary
Correct the 2025–2026 catalog
src/main/resources/db/migration/V20__correct_academic_program_catalog_2025_2026.sql, src/test/java/in/koreatech/koin/acceptance/migration/AcademicProgramCatalogCorrectionMigrationTest.java
The migration adds specified department and major mappings, checks that catalog entries resolve unambiguously, and deletes only specified incorrect mappings. Acceptance tests cover expected mappings, preserved records, reruns, and migration failures.
Centralize student academic-program validation
src/main/java/in/koreatech/koin/domain/student/service/StudentValidationService.java, src/main/java/in/koreatech/koin/domain/student/service/StudentService.java, src/main/java/in/koreatech/koin/admin/student/..., src/main/java/in/koreatech/koin/domain/student/dto/..., src/test/java/in/koreatech/koin/acceptance/domain/AcademicProgram*CohortCorrectionApiTest.java, src/test/java/in/koreatech/koin/acceptance/domain/AcademicProgramYearApiTest.java, src/test/java/in/koreatech/koin/acceptance/domain/StudentAcademicValidationApiTest.java
StudentValidationService checks student-number format, department presence, and major ownership against year-specific program records. Student and administrator updates, registration, and authentication use the validation. Request constraints and acceptance tests cover invalid selections and preservation of stored information.
Validate recruitment application snapshots
src/main/java/in/koreatech/koin/domain/team/recruitment/service/TeamRecruitmentApplicationService.java, src/test/java/in/koreatech/koin/unit/domain/team/recruitment/service/TeamRecruitmentApplicationServiceTest.java
Profile snapshot creation validates the applicant’s student number and department. Unit tests cover mapped and unmapped years, malformed numbers, and application-related persistence.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant TeamRecruitmentApplicationService
  participant StudentValidationService
  participant AcademicProgramYearRepository
  TeamRecruitmentApplicationService->>StudentValidationService: Validate student number and department
  StudentValidationService->>AcademicProgramYearRepository: Retrieve programs for student-number year
  AcademicProgramYearRepository-->>StudentValidationService: Return mapped programs
  StudentValidationService-->>TeamRecruitmentApplicationService: Return validation result
Loading
Merge Risk: ⚪ Minimal · up to 2cad3

No actionable current-head defect was established. Confirm the required V19-before-V20 deployment sequence before release.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 100 functions across 13 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed Issue #2508 requirements are implemented. V20 adds the reviewed 2025/2026 mappings, includes the work-study departments and 글로벌인재학부, and deletes only listed incorrect mappings. The migration preserves…
Out of Scope Changes check Passed The production changes support issue #2508. The DTO constraints prevent missing or malformed required academic data, the shared validator removes duplicated validation, the migration corrects the cata…
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes the main changes: correcting 2025/2026 academic department data and fixing missing validation during saves.
  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@taejinn taejinn changed the title fix: 2025/2026학년도 학과 연결 정정 및 학적 검증 보완 fix: 2025/2026학년도 학과 정보 오류와 저장 시 검증 누락 수정 Oct 14, 2026
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Unit Test Results

   308 files     308 suites   5m 11s ⏱️
1 647 tests 1 644 ✔️ 3 💤 0 ❌
1 674 runs  1 671 ✔️ 3 💤 0 ❌

Results for commit 2cad393.

♻️ This comment has been updated with latest results.

@taejinn
taejinn merged commit 64189f6 into develop Oct 14, 2026
8 checks passed
@taejinn
taejinn deleted the fix/2508-academic-program-year-validation branch October 14, 2026 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DB DB 마이그레이션을 위한 라벨입니다. 버그 정상적으로 동작하지 않는 문제상황입니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[버그] 2025/2026학년도 학과 정보 오류와 저장 시 검증 누락

2 participants