Skip to content

feat(user): 전화번호 정규식 010-XXXX-XXXX 고정#76

Merged
chanwoo7 merged 1 commit intodevelopfrom
feat/mypage-figma-phone-regex
Apr 29, 2026
Merged

feat(user): 전화번호 정규식 010-XXXX-XXXX 고정#76
chanwoo7 merged 1 commit intodevelopfrom
feat/mypage-figma-phone-regex

Conversation

@chanwoo7
Copy link
Copy Markdown
Member

@chanwoo7 chanwoo7 commented Apr 29, 2026

Summary

  • 전화번호 검증을 ^010-\d{4}-\d{4}$ (13자 고정)로 강화
  • 기존 ^[0-9-]+$ + 7~20자 정책은 '01-2-3' 같은 비정상 패턴도 통과시켜 사실상 비검증 상태였음
  • 마이페이지 figma 명세에 맞춰 010 prefix만 허용

변경 사항

  • PHONE_REGEX, PHONE_FORMAT_EXAMPLE 상수 추가 (user.constants.ts)
  • MIN_PHONE_LENGTH, MAX_PHONE_LENGTH 상수 제거 (정규식으로 대체)
  • normalizePhoneNumber: 정규식 단일 검증으로 단순화 + 명확한 에러 메시지
  • 회귀 테스트: 정상 3건 + trim 1건 + 비정상 10건 (table-driven)

Breaking 여부

  • 부분 Breaking: 기존에 통과하던 비-010 번호, 자릿수 다른 번호가 reject됨
  • 영향 범위: completeOnboarding / updateMyProfile 입력 검증
  • DB 기존 row: 영향 없음 (읽기 시 검증 안 함, 새 입력만 검증)
  • DB 데이터 현재 0건 + 프론트 미개발 → 운영 영향 없음

Test plan

  • 로컬 yarn test:cov 통과 (831 tests)
  • CI check 통과
  • CI coverage-report 통과
  • CodeQL 통과

기존 ^[0-9-]+\$ + 7~20자 정책은 '01-2-3' 같은 비정상 패턴도 통과시켜
사실상 비검증 상태였음. 기획 figma 명세에 맞춰 010만 13자 고정 규칙으로 강화한다.

- PHONE_REGEX = /^010-\\d{4}-\\d{4}\$/ 상수 추가
- PHONE_FORMAT_EXAMPLE 예시 문자열 상수 추가
- MIN_PHONE_LENGTH/MAX_PHONE_LENGTH 제거 (정규식으로 대체)
- normalizePhoneNumber: 정규식 단일 검증으로 단순화 + 명확한 에러 메시지
- 회귀 테스트: 정상 3건 + trim 1건 + 비정상 10건으로 보강
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 29, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b37c0c6f-5f75-46dc-9b2f-baebe3e7932d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/mypage-figma-phone-regex

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.

@github-actions
Copy link
Copy Markdown

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 96.57% 2788/2887
🟢 Branches 86.5% 1596/1845
🟢 Functions 93.08% 592/636
🟢 Lines 96.91% 2544/2625

Test suite run success

831 tests passing in 75 suites.

Report generated by 🧪jest coverage report action from f10dc2c

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@chanwoo7 chanwoo7 merged commit 7af4b11 into develop Apr 29, 2026
10 checks passed
@chanwoo7 chanwoo7 deleted the feat/mypage-figma-phone-regex branch April 29, 2026 15:56
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.

1 participant