feat(auth): 회원가입 시 휴대폰·전화번호 선택 입력 추가
마이페이지·관리자 회원 폼에는 이미 연락처 필드가 있으나 회원가입 폼에만 빠져 두 화면이 불일치했다. DB·모델·Resource는 기존 존재하므로 회원가입 경로에만 검증·저장·입력 UI를 연결한다. 연락처는 선택 항목이다.
This commit is contained in:
1 parent
eb0c72c32b
commit
cd11fc60ce
18 files changed
+363
-6
No files matched your search
@@ -403,6 +403,76 @@ class UserAuthControllerTest extends TestCase
|
||||
$this->assertEquals('en', $user->language);
|
||||
}
|
||||
|
||||
/**
|
||||
* 회원가입 시 휴대폰/전화번호가 저장되는지 확인
|
||||
*/
|
||||
public function test_register_stores_mobile_and_phone(): void
|
||||
{
|
||||
$response = $this->jsonRequest()->postJson('/api/auth/register', [
|
||||
'name' => '테스트 사용자',
|
||||
'email' => 'contact@example.com',
|
||||
'password' => 'password123',
|
||||
'password_confirmation' => 'password123',
|
||||
'mobile' => '010-1234-5678',
|
||||
'phone' => '02-123-4567',
|
||||
'agree_terms' => true,
|
||||
'agree_privacy' => true,
|
||||
]);
|
||||
|
||||
$response->assertStatus(201);
|
||||
|
||||
$this->assertDatabaseHas('users', [
|
||||
'email' => 'contact@example.com',
|
||||
'mobile' => '010-1234-5678',
|
||||
'phone' => '02-123-4567',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 휴대폰/전화번호는 선택 항목이므로 미입력 시에도 가입에 성공한다
|
||||
*/
|
||||
public function test_register_mobile_and_phone_are_optional(): void
|
||||
{
|
||||
$response = $this->jsonRequest()->postJson('/api/auth/register', [
|
||||
'name' => '테스트 사용자',
|
||||
'email' => 'nocontact@example.com',
|
||||
'password' => 'password123',
|
||||
'password_confirmation' => 'password123',
|
||||
'agree_terms' => true,
|
||||
'agree_privacy' => true,
|
||||
]);
|
||||
|
||||
$response->assertStatus(201);
|
||||
|
||||
$user = User::where('email', 'nocontact@example.com')->first();
|
||||
$this->assertNotNull($user);
|
||||
$this->assertNull($user->mobile);
|
||||
$this->assertNull($user->phone);
|
||||
}
|
||||
|
||||
/**
|
||||
* 휴대폰번호 형식 위반 시 검증 실패(422)
|
||||
*/
|
||||
public function test_register_validates_mobile_format(): void
|
||||
{
|
||||
$response = $this->jsonRequest()->postJson('/api/auth/register', [
|
||||
'name' => '테스트 사용자',
|
||||
'email' => 'badmobile@example.com',
|
||||
'password' => 'password123',
|
||||
'password_confirmation' => 'password123',
|
||||
'mobile' => '휴대폰없음',
|
||||
'agree_terms' => true,
|
||||
'agree_privacy' => true,
|
||||
]);
|
||||
|
||||
$response->assertStatus(422)
|
||||
->assertJsonValidationErrors(['mobile']);
|
||||
|
||||
$this->assertDatabaseMissing('users', [
|
||||
'email' => 'badmobile@example.com',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 회원가입 시 'user' 역할 자동 할당
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
# audit:allow test-scenario-coverage reason: 본 매니페스트는 신규 표면(회원가입 연락처 필드) 시나리오 SSoT 로 기록. 핵심 회귀 가드는 test_files 의 통과 테스트(백엔드 3 + 레이아웃 렌더링 8)로 커버. 선택 입력 필드 2개 추가라 발행/상태 전이 등 브라우저 특유 로직이 없어 Playwright spec 대신 렌더링 테스트로 대체(위지윅 발행 회귀 #238 유형의 위험 부재).
|
||||
|
||||
feature: 회원가입 시 휴대폰/전화번호 선택 입력
|
||||
|
||||
description: |
|
||||
회원가입 폼에서 연락처(휴대폰/전화번호)를 선택 항목으로 수집한다.
|
||||
|
||||
배경:
|
||||
- 마이페이지 프로필 편집·관리자 회원 폼에는 이미 mobile/phone 필드가 있으나
|
||||
회원가입 폼에만 빠져 두 화면이 불일치했다. 회원가입 경로에 "연결"만 추가.
|
||||
- DB(users.mobile/phone)·모델 $fillable·UserResource 는 이미 존재.
|
||||
RegisterRequest 검증 + AuthService::register $userData 주입 + 폼 입력칸만 추가.
|
||||
- 순수 개인정보 수집 (선택). 마케팅/광고 수신 동의는 코어에 넣지 않으며
|
||||
별도 마케팅 동의 플러그인이 register_extension_fields 앵커 +
|
||||
core.auth.record_consents 훅으로 주입한다.
|
||||
|
||||
axes:
|
||||
mobile_input: [empty, valid, invalid_chars]
|
||||
phone_input: [empty, valid, invalid_chars]
|
||||
|
||||
exclusions:
|
||||
- { mobile_input: invalid_chars, phone_input: valid, reason: "필드별 독립 검증 — 한 필드 위반 시 해당 필드 에러만 확인하면 충분" }
|
||||
- { mobile_input: valid, phone_input: invalid_chars, reason: "동일 사유 (필드별 독립 regex)" }
|
||||
|
||||
effects:
|
||||
- empty_mobile_and_phone_still_registers_successfully
|
||||
- valid_mobile_and_phone_persist_to_users_table
|
||||
- invalid_mobile_chars_rejected_with_422_validation_error
|
||||
- mobile_phone_are_nullable_optional_not_required
|
||||
- register_form_renders_mobile_and_phone_input_nodes
|
||||
- mobile_phone_per_field_error_span_present
|
||||
- error_filter_whitelist_includes_mobile_phone_to_prevent_double_display
|
||||
- core_register_form_excludes_marketing_consent_copy
|
||||
|
||||
test_files:
|
||||
- tests/Feature/Api/Auth/UserAuthControllerTest.php
|
||||
- templates/_bundled/sirsoft-basic/__tests__/layouts/auth-register-contact-fields.test.tsx
|
||||
Reference in new issue
Block a user