feat(chat): 협상 유의사항 안내 팝업 2종 이식 + 팝업 숨김 저장 API
KT-NEGOWIZ fe_v2 의 서비스 안내 팝업을 우리 구조로 이식.
- frontend: GuideContent(공용 본문, VAT/배송비는 chat init 메타로 동적 표시)
+ ServiceInfoPopup(채팅 진입 시 자동 — 안내 보지 않기/오늘 하루 보지 않기)
+ ServiceGuidePopup(메뉴 유의사항·이용 가이드 버튼 수동 — X/배경/ESC 닫기)
+ useServiceInfoPopup 훅(서버 상태 + localStorage 오늘 하루)
+ apis/auth 에 popupStatus 쿼리·hidePopup 뮤테이션, 헬프데스크 연락처 반영,
한국어 단어 잘림 방지(break-keep)
- backend: GET /v1/auth/popup/status, POST /v1/auth/popup/hide
(authenticate 공통 인증 + supplier_users.hide_service_info 영구 저장), 테스트 4건
- db: supplier_users.hide_service_info 컬럼 — 00-init 테이블 정의 갱신,
기존 DB 보정은 alters/2026-07-07-supplier-users-hide-service-info.sql 별도 파일
(기준선 이후 보정 ALTER 는 alters/ 파일로 관리하도록 규칙 변경)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
dc0e78ec73
commit
3c8923c075
21 files changed
+488
-21
No files matched your search
@@ -322,3 +322,52 @@ async def test_relogin_invalidates_previous_access(client, account_seed):
|
||||
# 새 access → 정상
|
||||
r_new = await client.get("/v1/auth/me", headers={"Authorization": f"Bearer {second['access_token']}"})
|
||||
assert r_new.json()["result"]["success"] is True
|
||||
|
||||
|
||||
# ---- 팝업 숨김 (popup/status, popup/hide) --------------------------------------
|
||||
async def test_popup_status_default_false(client, account_seed):
|
||||
# 신규 유저는 숨김 상태가 아니다.
|
||||
access = (await _login(client)).json()["access_token"]
|
||||
r = await client.get("/v1/auth/popup/status", headers={"Authorization": f"Bearer {access}"})
|
||||
assert r.status_code == 200
|
||||
body = r.json()
|
||||
assert body["result"]["success"] is True
|
||||
assert body["service_info"] is False
|
||||
|
||||
|
||||
async def test_popup_hide_persists(client, account_seed):
|
||||
# hide 후 status 가 True 로 바뀌고, 재로그인해도 유지된다(유저 행에 영구 저장).
|
||||
access = (await _login(client)).json()["access_token"]
|
||||
r = await client.post(
|
||||
"/v1/auth/popup/hide",
|
||||
json={"popup_type": "service_info"},
|
||||
headers={"Authorization": f"Bearer {access}"},
|
||||
)
|
||||
assert r.status_code == 200
|
||||
assert r.json()["result"]["success"] is True
|
||||
|
||||
r2 = await client.get("/v1/auth/popup/status", headers={"Authorization": f"Bearer {access}"})
|
||||
assert r2.json()["service_info"] is True
|
||||
|
||||
# 재로그인(토큰 교체) 후에도 유지
|
||||
new_access = (await _login(client)).json()["access_token"]
|
||||
r3 = await client.get("/v1/auth/popup/status", headers={"Authorization": f"Bearer {new_access}"})
|
||||
assert r3.json()["service_info"] is True
|
||||
|
||||
|
||||
async def test_popup_hide_invalid_type(client, account_seed):
|
||||
access = (await _login(client)).json()["access_token"]
|
||||
r = await client.post(
|
||||
"/v1/auth/popup/hide",
|
||||
json={"popup_type": "unknown_popup"},
|
||||
headers={"Authorization": f"Bearer {access}"},
|
||||
)
|
||||
assert r.status_code == 200
|
||||
body = r.json()
|
||||
assert body["result"]["success"] is False
|
||||
assert body["result"]["code"] == 101 # INVALID_REQUEST_DATA
|
||||
|
||||
|
||||
async def test_popup_status_without_token(client):
|
||||
r = await client.get("/v1/auth/popup/status")
|
||||
assert r.status_code in (401, 403)
|
||||
Reference in new issue
Block a user