fix(gift): 상세 문의를 TALK에 연결한다

This commit is contained in:
Yu Sung
2026-10-08 20:34:54 +09:00
parent f36faf7ee4
commit 2997714e2c
7 changed files with 50 additions and 6 deletions
@@ -7,6 +7,12 @@
import SwiftUI import SwiftUI
enum ServiceCenterInquiry {
static func openTalk() {
UIApplication.shared.open(URL(string: "http://pf.kakao.com/_lkxgxhG/chat")!)
}
}
struct ServiceCenterView: View { struct ServiceCenterView: View {
@ObservedObject var viewModel = ServiceCenterViewModel() @ObservedObject var viewModel = ServiceCenterViewModel()
@@ -45,7 +51,7 @@ struct ServiceCenterView: View {
.padding(.horizontal, 13.3) .padding(.horizontal, 13.3)
.padding(.top, 20) .padding(.top, 20)
.onTapGesture { .onTapGesture {
UIApplication.shared.open(URL(string: "http://pf.kakao.com/_lkxgxhG/chat")!) ServiceCenterInquiry.openTalk()
} }
Rectangle() Rectangle()
@@ -4,7 +4,6 @@ enum GiftConstants {
static let termsURL = URL(string: "https://app.notion.com/p/3eb27b359673802b937ae741ab7b4ad3") static let termsURL = URL(string: "https://app.notion.com/p/3eb27b359673802b937ae741ab7b4ad3")
static let damagePolicyURL = URL(string: "https://app.notion.com/p/3f227b3596738018ba5dea2e5205293b") static let damagePolicyURL = URL(string: "https://app.notion.com/p/3f227b3596738018ba5dea2e5205293b")
static let addressSearchAvailable = false static let addressSearchAvailable = false
static let inquiryStep: AppStep = .serviceCenter
static let feedbackStep: AppStep = .serviceCenter static let feedbackStep: AppStep = .serviceCenter
static let unavailableActionMessage = "준비 중입니다." static let unavailableActionMessage = "준비 중입니다."
static let courierCompanyNames = [ static let courierCompanyNames = [
@@ -59,7 +59,7 @@ struct GiftCancelCompleteView: View {
Button { Button {
guard !isNavigating else { return } guard !isNavigating else { return }
isNavigating = true isNavigating = true
AppState.shared.setAppStep(step: GiftConstants.inquiryStep) ServiceCenterInquiry.openTalk()
} label: { } label: {
Text("문의하기") Text("문의하기")
.appFont(.body2) .appFont(.body2)
@@ -44,7 +44,7 @@ struct GiftDetailActionBar: View {
Button { Button {
guard !isNavigating else { return } guard !isNavigating else { return }
isNavigating = true isNavigating = true
AppState.shared.setAppStep(step: GiftConstants.inquiryStep) ServiceCenterInquiry.openTalk()
} label: { } label: {
secondaryLabel("문의하기", isEnabled: !isNavigating) secondaryLabel("문의하기", isEnabled: !isNavigating)
} }
@@ -119,7 +119,7 @@ struct ReceivedGiftDetailActionBar: View {
Button { Button {
guard !isNavigating else { return } guard !isNavigating else { return }
isNavigating = true isNavigating = true
AppState.shared.setAppStep(step: GiftConstants.inquiryStep) ServiceCenterInquiry.openTalk()
} label: { } label: {
secondaryLabel("문의하기", isEnabled: !isNavigating) secondaryLabel("문의하기", isEnabled: !isNavigating)
} }
@@ -0,0 +1,39 @@
#!/usr/bin/env bash
set -euo pipefail
root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
ruby - "$root" <<'RUBY'
root = ARGV.fetch(0)
source_root = File.join(root, 'SodaLive/Sources')
read = lambda do |path|
File.read(File.join(source_root, path))
.gsub(%r{"(?:\\.|[^"\\])*"|//[^\n]*|/\*.*?\*/}m) { |token| token.start_with?('"') ? token : '' }
.gsub(/\s+/, ' ').gsub(/\s*([(),:])\s*/, '\1').strip
end
check = lambda do |condition, message|
abort "RED gift-detail TALK inquiry: #{message}" unless condition
end
service = read.call('MyPage/ServiceCenter/ServiceCenterView.swift')
gift_sources = [
'V2/Gift/Detail/Components/GiftDetailActionBar.swift',
'V2/Gift/Detail/Components/ReceivedGiftDetailContentView.swift',
'V2/Gift/Detail/Components/GiftCancelCompleteView.swift'
].map { |path| [path, read.call(path)] }
helper = 'enum ServiceCenterInquiry { static func openTalk(){ UIApplication.shared.open(URL(string:"http://pf.kakao.com/_lkxgxhG/chat")!)} }'
check.call(service.include?(helper), 'ServiceCenterInquiry.openTalk must own the existing Kakao TALK action')
check.call(service.scan('ServiceCenterInquiry.openTalk()').length == 1, 'ServiceCenter TALK button must call the shared action once')
check.call(service.scan('http://pf.kakao.com/_lkxgxhG/chat').length == 1, 'Kakao TALK URL must have one source of truth')
gift_sources.each do |path, source|
check.call(source.scan('ServiceCenterInquiry.openTalk()').length == 1, "#{path} must call the shared action once")
check.call(!source.include?('GiftConstants.inquiryStep'), "#{path} must not navigate to the in-app service center")
check.call(!source.include?('.serviceCenter'), "#{path} must not navigate directly to the in-app service center")
check.call(!source.include?('http://pf.kakao.com/_lkxgxhG/chat'), "#{path} must not duplicate the TALK URL")
end
puts 'PASS gift-detail TALK inquiry: ServiceCenter and all three Gift actions share one TALK action'
RUBY
+1 -1
View File
@@ -218,7 +218,7 @@ for probe in ('GiftInfoSectionView(title: "받는 주소")', 'GiftInfoRow(title:
require(not re.search(r"model\.(senderInfo|mailbox|applicationNo|paidCan|tracking)\b", component), "privacy-safe component") require(not re.search(r"model\.(senderInfo|mailbox|applicationNo|paidCan|tracking)\b", component), "privacy-safe component")
actions, _ = block(component, "struct ReceivedGiftDetailActionBar: View") actions, _ = block(component, "struct ReceivedGiftDetailActionBar: View")
require("guard !isNavigating else { return }" in actions and "isNavigating = true" in actions and ".disabled(isNavigating)" in actions, "inquiry repeat guard") require("guard !isNavigating else { return }" in actions and "isNavigating = true" in actions and ".disabled(isNavigating)" in actions, "inquiry repeat guard")
require("AppState.shared.setAppStep(step: GiftConstants.inquiryStep)" in actions and '"문의하기"' in actions, "existing inquiry route") require("ServiceCenterInquiry.openTalk()" in actions and '"문의하기"' in actions, "shared TALK inquiry action")
appear, _ = block(actions, ".onAppear") appear, _ = block(actions, ".onAppear")
require("isNavigating = false" in appear, "navigation guard resets") require("isNavigating = false" in appear, "navigation guard resets")
require("let onPolicy: () -> Void" in actions and "onPolicy()" in actions and '"선물 정책 확인"' in actions, "policy callback") require("let onPolicy: () -> Void" in actions and "onPolicy()" in actions and '"선물 정책 확인"' in actions, "policy callback")