From 13187070b50e8cdd612f5312089e640d35fe1033 Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Thu, 2 Apr 2026 11:53:49 +0900 Subject: [PATCH] =?UTF-8?q?fix(my-page):=20=EB=B9=84=ED=95=9C=EA=B5=AD=20?= =?UTF-8?q?=EA=B5=AD=EA=B0=80=20=EC=BF=A0=ED=8F=B0=20=EB=93=B1=EB=A1=9D=20?= =?UTF-8?q?=EB=85=B8=EC=B6=9C=20=EC=A1=B0=EA=B1=B4=EC=9D=84=20=EC=A1=B0?= =?UTF-8?q?=EC=A0=95=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SodaLive/Sources/MyPage/MyPageView.swift | 25 ++++---- ...0402_비한국국가쿠폰등록본인인증예외적용.md | 58 +++++++++++++++++++ 2 files changed, 73 insertions(+), 10 deletions(-) create mode 100644 docs/20260402_비한국국가쿠폰등록본인인증예외적용.md diff --git a/SodaLive/Sources/MyPage/MyPageView.swift b/SodaLive/Sources/MyPage/MyPageView.swift index dd2fd36..79eb5f9 100644 --- a/SodaLive/Sources/MyPage/MyPageView.swift +++ b/SodaLive/Sources/MyPage/MyPageView.swift @@ -26,6 +26,7 @@ struct MyPageView: View { .trimmingCharacters(in: .whitespacesAndNewlines) .uppercased() let isKoreanCountry = normalizedCountryCode.isEmpty || normalizedCountryCode == "KR" + let shouldShowCouponRegister = isKoreanCountry || UserDefaults.isAdultContentVisible() BaseView(isLoading: $viewModel.isLoading) { if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty && @@ -121,6 +122,7 @@ struct MyPageView: View { isShowAuthView: $viewModel.isShowAuthView, isAuthenticated: viewModel.isAuth, isKoreanCountry: isKoreanCountry, + shouldShowCouponRegister: shouldShowCouponRegister, showMessage: { viewModel.errorMessage = $0 viewModel.isShowPopup = true @@ -389,6 +391,7 @@ struct CategoryButtonsView: View { let isAuthenticated: Bool let isKoreanCountry: Bool + let shouldShowCouponRegister: Bool let showMessage: (String) -> Void let refresh: () -> Void @@ -402,16 +405,18 @@ struct CategoryButtonsView: View { AppState.shared.setAppStep(step: .blockList) } - CategoryButtonItem( - icon: "ic_my_coupon", - title: I18n.MyPage.Category.couponRegister - ) { - if isAuthenticated { - AppState.shared.setAppStep(step: .canCoupon(refresh: refresh)) - } else { - showMessage(I18n.MyPage.Auth.verifyRequiredBeforeCoupon) - DispatchQueue.main.asyncAfter(deadline: .now() + 1) { - isShowAuthView = true + if shouldShowCouponRegister { + CategoryButtonItem( + icon: "ic_my_coupon", + title: I18n.MyPage.Category.couponRegister + ) { + if isAuthenticated || !isKoreanCountry { + AppState.shared.setAppStep(step: .canCoupon(refresh: refresh)) + } else { + showMessage(I18n.MyPage.Auth.verifyRequiredBeforeCoupon) + DispatchQueue.main.asyncAfter(deadline: .now() + 1) { + isShowAuthView = true + } } } } diff --git a/docs/20260402_비한국국가쿠폰등록본인인증예외적용.md b/docs/20260402_비한국국가쿠폰등록본인인증예외적용.md new file mode 100644 index 0000000..0d8a3aa --- /dev/null +++ b/docs/20260402_비한국국가쿠폰등록본인인증예외적용.md @@ -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 조합 확인 필요)