Conversation
- 임시 UI 확인용으로 사용되던 `IdentityEmailVerificationStub`을 제거하고 실제 백엔드 연동을 위한 인프라 구축 - `ReceiverAuthRepository`에 이메일 인증 코드 발송(`sendEmailAuthCode`) 및 검증(`verifyEmailAuthCode`) 메서드 추가 - 도메인 계층에 인증 결과를 담는 `ReceiverEmailAuthResult` 모델 및 전용 예외 클래스 `ReceiverEmailAuthException` 정의 - 서버 통신을 위한 Request/Response DTO 정의 및 도메인 모델 매핑 로직(`toDomain`) 구현 - API 응답 JSON 디코딩 계약 검증 및 `ApiException`의 도메인 예외 변환을 확인하는 단위 테스트 추가 - 인증번호 발송 실패 시 사용자에게 노출할 에러 메시지 리소스(`strings.xml`) 추가
- `ReceiverAuthApiService`에 이메일 인증번호 발송(`sendEmailAuthCode`) 및 검증(`verifyEmailAuthCode`) API 정의 추가 - `ReceiverAuthRepositoryImpl`에 이메일 인증 기능 구현 및 `ApiException`을 도메인 예외로 변환하는 에러 처리 구조 개선 (runCatching 내 try-catch 패턴 적용) - `BaseResponse` 및 `ApiException`에 서버 응답 스키마 처리 정책과 예외 메시지 전달 방식에 대한 상세 설명(KDoc) 추가 - `IdentityVerificationIntroScreen`에서 이메일 인증 단계가 스텁(Stub) 대신 실제 API를 호출하도록 관련 주석 업데이트 - `ReceiverAuthApiService`에서 `X-Auth-Code` 헤더가 필요한 엔드포인트와 제외되는 엔드포인트에 대한 설명 보완
- `IdentityEmailVerificationStub`을 제거하고 `ReceiverAuthRepository`를 통한 실제 이메일 인증 API(인증번호 발송 및 검증) 연동 - UI 상태 내 `errorMessageRes`(Int)를 `ErrorPayload`(Sealed Interface)로 변경하여 서버 전달 메시지와 로컬 리소스 폴백을 함께 지원 - `IdentityVerificationViewModel`에서 API 호출 결과에 따른 에러 처리 로직(`toErrorPayload`) 구현 - 인증번호 발송 및 검증 요청 시 입력값(이메일, 코드)에 대한 `trim()` 처리 추가 - `IdentityVerificationEmailScreen`에서 `ErrorPayload` 타입에 따라 스낵바 메시지를 구성하도록 로직 수정 - `BaseResponse` 및 관련 UI 상태 클래스의 KDoc 주석 보완 및 정리
koongmai
reviewed
Jun 29, 2026
koongmai
left a comment
Contributor
There was a problem hiding this comment.
#409 이메일 인증 성공 후 accessCode를 저장하지 않아 이후 receiver-auth API 인증 헤더가 비어 있을 수 있음
IdentityVerificationViewModel.kt:89-93에서 verifyEmailAuthCode() 성공 시 markVerified()만 하고 응답의 accessCode는 사용하지 않습니다. 그런데 기존 구조는 ReceiverAuthCodeDataSource에 저장된 값이 ReceiverAuthInterceptor.kt:25-33에서 X-Auth-Code로 붙고, 마스터키 화면은 MasterKeyViewModel.kt:56-60에서 검증 성공 후 saveAuthCode(trimmed)를 호출합니다.
즉 이메일 인증이 마스터키와 같은 accessCode를 내려주는 흐름이라면, 여기서도 저장해야 이후 서류 업로드/수신자 API가 정상 인증됩니다. 아니면 markVerified()로 마스터키 단계 진입 조건만 켜는 현재 동작이 설계상 맞는지 명확히 해야 합니다.
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 #407 — feat(afternote): 수신자 본인확인 이메일 인증 stub → 실 API(receiver-auth/email) 전환
📎𝘞𝘰𝘳𝘬 𝘋𝘦𝘴𝘤𝘳𝘪𝘱𝘵𝘪𝘰𝘯
ReceiverAuthApiService에POST receiver-auth/email/auth-code·POST receiver-auth/email/verify추가, DTO·toDomain매퍼·도메인 모델(ReceiverEmailAuthResult) 신설 (c76f3ad)ReceiverAuthRepository에sendEmailAuthCode/verifyEmailAuthCode추가,ApiException→ 도메인 예외ReceiverEmailAuthException변환 (서버 message·code 보존)IdentityVerificationViewModel의 stub 의존을 실 Repository 로 교체, 에러 표시를ErrorPayload(서버 message 우선 + 리소스 폴백) 로 격상,IdentityEmailVerificationStub삭제 + "백엔드 미구현" 전제 KDoc 일괄 갱신 (a0d3194)submitDeliveryVerification포함), 회귀 테스트 3종(매퍼·응답 계약·예외 매핑) 추가, KDoc 보강 (1076f60)📷𝘚𝘤𝘳𝘦𝘦𝘯𝘴𝘩𝘰𝘵
화면 구성 변경 없음 (stub → 실 API 동작 전환). 에뮬레이터 실서버 E2E 검증 완료 — 미등록 이메일 404/1901 서버 문구 스낵바, 인증번호 불일치 문구 스낵바, Gmail 실수신 인증번호로 verify 성공 → 마스터 키 화면 전환.
💬𝘛𝘰 𝘙𝘦𝘷𝘪𝘦𝘸𝘦𝘳𝘴
ReceiverAuthDto.kt·ReceiverAuthModels.kt가 feat(receiver): 수신자 홈 한 마디 작성일(createdAt) 표시 매핑 (closes 209) #406 변경과 같은 파일이라 그 위에 쌓았습니다. feat(receiver): 수신자 홈 한 마디 작성일(createdAt) 표시 매핑 (closes 209) #406 머지 후 develop 로 재타겟 예정.recoverCatching헬퍼가 아닌 try/catch 인라인으로 — 공식 가이드(data layer "Expose errors")가 언급하는 try/catch + custom exception 결합이고, 출처 없는 관용구를 배제하는 결정입니다. 기존submitDeliveryVerification(PR feat(afternote): 발신자 상세 PENDING 분리 + submit 에러 메시지 정밀화 (#225) #252 분)도 같은 모양으로 통일했습니다.accessCode는 마스터 키와 동일한 UUID 임을 실서버로 확인했으나, 마스터 키 단계 스킵/자동 채움은 디자인 결정 전이라 수신만 하고 미사용 (도메인 모델 KDoc 에 명시).core:networkBaseResponse·ApiException과 deliveryverification 쪽 KDoc 보강이 다수 포함 — 전부 주석이며 동작 변경 없음../gradlew :feature:afternote:data:testDebugUnitTest외 변경 5개 모듈 compileDebugKotlin·ktlint BUILD SUCCESSFUL (단위 테스트 14건 통과)