fix(my-page): 비한국 국가 쿠폰 등록 노출 조건을 조정한다
This commit is contained in:
@@ -26,6 +26,7 @@ struct MyPageView: View {
|
|||||||
.trimmingCharacters(in: .whitespacesAndNewlines)
|
.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||||
.uppercased()
|
.uppercased()
|
||||||
let isKoreanCountry = normalizedCountryCode.isEmpty || normalizedCountryCode == "KR"
|
let isKoreanCountry = normalizedCountryCode.isEmpty || normalizedCountryCode == "KR"
|
||||||
|
let shouldShowCouponRegister = isKoreanCountry || UserDefaults.isAdultContentVisible()
|
||||||
|
|
||||||
BaseView(isLoading: $viewModel.isLoading) {
|
BaseView(isLoading: $viewModel.isLoading) {
|
||||||
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty &&
|
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty &&
|
||||||
@@ -121,6 +122,7 @@ struct MyPageView: View {
|
|||||||
isShowAuthView: $viewModel.isShowAuthView,
|
isShowAuthView: $viewModel.isShowAuthView,
|
||||||
isAuthenticated: viewModel.isAuth,
|
isAuthenticated: viewModel.isAuth,
|
||||||
isKoreanCountry: isKoreanCountry,
|
isKoreanCountry: isKoreanCountry,
|
||||||
|
shouldShowCouponRegister: shouldShowCouponRegister,
|
||||||
showMessage: {
|
showMessage: {
|
||||||
viewModel.errorMessage = $0
|
viewModel.errorMessage = $0
|
||||||
viewModel.isShowPopup = true
|
viewModel.isShowPopup = true
|
||||||
@@ -389,6 +391,7 @@ struct CategoryButtonsView: View {
|
|||||||
|
|
||||||
let isAuthenticated: Bool
|
let isAuthenticated: Bool
|
||||||
let isKoreanCountry: Bool
|
let isKoreanCountry: Bool
|
||||||
|
let shouldShowCouponRegister: Bool
|
||||||
let showMessage: (String) -> Void
|
let showMessage: (String) -> Void
|
||||||
let refresh: () -> Void
|
let refresh: () -> Void
|
||||||
|
|
||||||
@@ -402,11 +405,12 @@ struct CategoryButtonsView: View {
|
|||||||
AppState.shared.setAppStep(step: .blockList)
|
AppState.shared.setAppStep(step: .blockList)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if shouldShowCouponRegister {
|
||||||
CategoryButtonItem(
|
CategoryButtonItem(
|
||||||
icon: "ic_my_coupon",
|
icon: "ic_my_coupon",
|
||||||
title: I18n.MyPage.Category.couponRegister
|
title: I18n.MyPage.Category.couponRegister
|
||||||
) {
|
) {
|
||||||
if isAuthenticated {
|
if isAuthenticated || !isKoreanCountry {
|
||||||
AppState.shared.setAppStep(step: .canCoupon(refresh: refresh))
|
AppState.shared.setAppStep(step: .canCoupon(refresh: refresh))
|
||||||
} else {
|
} else {
|
||||||
showMessage(I18n.MyPage.Auth.verifyRequiredBeforeCoupon)
|
showMessage(I18n.MyPage.Auth.verifyRequiredBeforeCoupon)
|
||||||
@@ -415,6 +419,7 @@ struct CategoryButtonsView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CategoryButtonItem(icon: "ic_my_notice", title: I18n.MyPage.Category.notice) {
|
CategoryButtonItem(icon: "ic_my_notice", title: I18n.MyPage.Category.notice) {
|
||||||
AppState.shared.setAppStep(step: .notices)
|
AppState.shared.setAppStep(step: .notices)
|
||||||
|
|||||||
58
docs/20260402_비한국국가쿠폰등록본인인증예외적용.md
Normal file
58
docs/20260402_비한국국가쿠폰등록본인인증예외적용.md
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
# 20260402 비한국국가 쿠폰 등록 본인인증 예외 적용
|
||||||
|
|
||||||
|
## 개요
|
||||||
|
- `MyPageView`의 쿠폰 등록 버튼 노출 및 진입 조건을 국가 기준으로 분기한다.
|
||||||
|
- 한국(`KR`) 사용자는 기존 쿠폰 버튼/본인인증 정책을 유지하고, 한국이 아닌 국가는 `민감한 콘텐츠 보기` 설정이 켜져 있을 때만 쿠폰 버튼을 노출한다.
|
||||||
|
- 한국이 아닌 국가에서 버튼이 노출된 경우에는 본인인증 없이 쿠폰 등록 화면으로 진입할 수 있도록 유지한다.
|
||||||
|
|
||||||
|
## 요구사항 요약
|
||||||
|
- 대상 파일: `SodaLive/Sources/MyPage/MyPageView.swift`
|
||||||
|
- 변경 조건:
|
||||||
|
- 국가코드를 `trim + uppercased`로 정규화한다.
|
||||||
|
- 한국(`KR`) 또는 국가코드 미수신(빈값)은 기존 쿠폰 버튼 노출/본인인증 정책을 유지한다.
|
||||||
|
- 한국이 아닌 국가는 `UserDefaults.isAdultContentVisible()`가 `true`일 때만 쿠폰 버튼을 노출한다.
|
||||||
|
- 한국이 아닌 국가는 버튼이 노출된 경우 본인인증 없이 `canCoupon`으로 진입한다.
|
||||||
|
|
||||||
|
## 완료 기준 (Acceptance Criteria)
|
||||||
|
- [x] AC1: 한국이 아닌 국가에서는 `민감한 콘텐츠 보기`가 켜져 있을 때만 쿠폰 등록 버튼이 노출된다.
|
||||||
|
- [x] AC2: 한국이 아닌 국가에서 버튼이 노출된 경우 `isAuth`와 무관하게 `canCoupon`으로 이동한다.
|
||||||
|
- [x] AC3: 한국 사용자와 국가코드 미수신 사용자는 기존 쿠폰 버튼/본인인증 정책이 유지된다.
|
||||||
|
- [x] AC4: `본인인증/인증완료` 카테고리 아이템의 기존 국가 조건은 유지된다.
|
||||||
|
- [x] AC5: 수정 파일 진단과 빌드 결과가 문서 하단에 기록된다.
|
||||||
|
|
||||||
|
## 구현 체크리스트
|
||||||
|
- [x] `MyPageView`에 민감한 콘텐츠 보기 설정값을 추가로 계산
|
||||||
|
- [x] `CategoryButtonsView`의 쿠폰 버튼 노출 조건을 비한국 + 민감한 콘텐츠 보기 기준으로 수정
|
||||||
|
- [x] `CategoryButtonsView`의 쿠폰 버튼 진입 조건을 국가 + 인증 상태 기준으로 유지/정리
|
||||||
|
- [x] 수정 파일 진단 및 빌드 실행
|
||||||
|
- [x] 검증 기록 문서화
|
||||||
|
|
||||||
|
## 검증 계획
|
||||||
|
- [x] 정적 진단: `lsp_diagnostics("SodaLive/Sources/MyPage/MyPageView.swift")`
|
||||||
|
- [x] 빌드: `xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive" -configuration Debug build`
|
||||||
|
- [x] 빌드(개발): `xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive-dev" -configuration Debug build`
|
||||||
|
|
||||||
|
## 검증 기록
|
||||||
|
- 일시: 2026-04-02
|
||||||
|
- 무엇: 비한국 국가 쿠폰 등록 본인인증 예외 적용 작업 계획 문서 작성
|
||||||
|
- 왜: 구현 범위와 완료 기준을 문서로 고정한 뒤 최소 수정으로 진행하기 위함
|
||||||
|
- 어떻게: 기존 `docs` 문서 형식을 기준으로 요구사항, 완료 기준, 검증 계획을 정리
|
||||||
|
- 실행 명령/도구: `glob(docs/*.md)`, `read(기존 docs 문서)`, `apply_patch(문서 생성)`
|
||||||
|
- 결과: 구현 전 계획 문서 생성 완료
|
||||||
|
|
||||||
|
- 일시: 2026-04-02
|
||||||
|
- 무엇: 비한국 국가 쿠폰 버튼 민감한 콘텐츠 보기 조건 적용 및 검증
|
||||||
|
- 왜: 한국이 아닌 국가에서만 `민감한 콘텐츠 보기` 설정이 켜진 사용자에게 쿠폰 버튼을 노출하도록 요구사항이 변경되었기 때문
|
||||||
|
- 어떻게:
|
||||||
|
- `MyPageView`에서 `shouldShowCouponRegister = isKoreanCountry || UserDefaults.isAdultContentVisible()` 계산
|
||||||
|
- `CategoryButtonsView`에 `shouldShowCouponRegister`를 전달하고 쿠폰 버튼을 조건부 렌더링
|
||||||
|
- 쿠폰 버튼 탭 동작은 기존 정책을 유지해 한국 사용자는 본인인증 필요, 비한국 사용자는 버튼 노출 시 인증 없이 진입하도록 유지
|
||||||
|
- 실행 명령/도구:
|
||||||
|
- 탐색: `grep("contentViewSettings|isAdultContentVisible|sensitive", Sources/**/*.swift)`, `read(UserDefaultsExtension.swift)`, `read(ContentSettingsView.swift)`, `background_output(bg_deefb7a9)`
|
||||||
|
- 진단: `lsp_diagnostics("SodaLive/Sources/MyPage/MyPageView.swift")`
|
||||||
|
- 빌드: `python3` 래퍼로 `xcodebuild -quiet -workspace "SodaLive.xcworkspace" -scheme "SodaLive" -configuration Debug build`, `xcodebuild -quiet -workspace "SodaLive.xcworkspace" -scheme "SodaLive-dev" -configuration Debug build` 순차 실행 및 `EXIT_CODE: 0` 확인
|
||||||
|
- 결과:
|
||||||
|
- `MyPageView`에서 비한국 사용자 쿠폰 버튼이 `민감한 콘텐츠 보기` 활성화 여부에 따라 노출되도록 반영
|
||||||
|
- 두 스킴(`SodaLive`, `SodaLive-dev`) 모두 순차 빌드 `EXIT_CODE: 0` 확인
|
||||||
|
- `lsp_diagnostics`는 SourceKit 환경에서 기존과 동일하게 `No such module 'Bootpay'`를 보고했으나, 실제 `xcodebuild` 종료 코드는 0으로 확인
|
||||||
|
- 수동 QA는 현재 CLI 환경에서 앱 UI를 직접 구동할 수 없어 미실행(실기기/시뮬레이터에서 KR/non-KR + 민감한 콘텐츠 보기 on/off 조합 확인 필요)
|
||||||
Reference in New Issue
Block a user