diff --git a/src/app/router.spec.ts b/src/app/router.spec.ts index f67de30..9e0ac6e 100644 --- a/src/app/router.spec.ts +++ b/src/app/router.spec.ts @@ -55,6 +55,7 @@ describe('ID 검색 파라미터 정밀도', () => { '/_authed/_shell/reviews accountId', '/_authed/_shell/reviews reviewId', '/_authed/_shell/reviews storeId', + '/_authed/_shell/settlements/ storeId', '/_authed/_shell/stores/ regionId', ].sort(), ); diff --git a/src/app/shell/nav.spec.ts b/src/app/shell/nav.spec.ts index 025f380..0b527bb 100644 --- a/src/app/shell/nav.spec.ts +++ b/src/app/shell/nav.spec.ts @@ -11,6 +11,9 @@ describe('nav', () => { { path: '/notifications/send', want: '알림' }, { path: '/banners/5', want: '배너' }, { path: '/search-chips', want: '검색 칩' }, + { path: '/settlements/monthly', want: '정산' }, + { path: '/settlements/31', want: '정산' }, + { path: '/settings', want: '결제 설정' }, ])('하위 화면도 메뉴 제목을 따른다: $path → $want', ({ path, want }) => { expect(titleFor(path)).toBe(want); }); diff --git a/src/app/shell/nav.ts b/src/app/shell/nav.ts index e29e2de..319be97 100644 --- a/src/app/shell/nav.ts +++ b/src/app/shell/nav.ts @@ -11,12 +11,14 @@ import { MapPinIcon, ScrollTextIcon, SearchIcon, + SettingsIcon, ShieldIcon, MessageSquareIcon, MessagesSquareIcon, ShoppingBagIcon, StoreIcon, UsersIcon, + WalletIcon, } from 'lucide-react'; /** 사이드바 메뉴. 각 영역 PR이 자기 항목을 붙인다 — Link의 to가 라우트 타입으로 검사되므로 있는 경로만 둔다. */ @@ -24,6 +26,7 @@ interface NavItem { to: | '/' | '/orders' + | '/settlements' | '/users' | '/sellers' | '/stores' @@ -38,7 +41,8 @@ interface NavItem { | '/notifications' | '/regions' | '/audit-logs' - | '/admins'; + | '/admins' + | '/settings'; label: string; icon: LucideIcon; } @@ -53,6 +57,7 @@ export const NAV_GROUPS: NavGroup[] = [ label: '운영', items: [ { to: '/orders', label: '주문', icon: ShoppingBagIcon }, + { to: '/settlements', label: '정산', icon: WalletIcon }, { to: '/reports', label: '신고', icon: FlagIcon }, { to: '/reviews', label: '리뷰', icon: MessageSquareIcon }, { to: '/review-comments', label: '리뷰 댓글', icon: MessagesSquareIcon }, @@ -80,6 +85,7 @@ export const NAV_GROUPS: NavGroup[] = [ ], }, { label: '기록', items: [{ to: '/audit-logs', label: '감사 로그', icon: ScrollTextIcon }] }, + { label: '설정', items: [{ to: '/settings', label: '결제 설정', icon: SettingsIcon }] }, ]; export function titleFor(pathname: string): string { diff --git a/src/features/accounts/components/account-status-actions.tsx b/src/features/accounts/components/account-status-actions.tsx index 820f2cb..716c8f5 100644 --- a/src/features/accounts/components/account-status-actions.tsx +++ b/src/features/accounts/components/account-status-actions.tsx @@ -1,4 +1,4 @@ -import { useState } from 'react'; +import { type ReactNode, useState } from 'react'; import { toast } from 'sonner'; import { type AccountStatus } from '@/graphql/generated/graphql'; @@ -28,10 +28,21 @@ interface Props { label: string; /** 성공 뒤 호출자의 캐시 무효화 */ onChanged: () => Promise | void; + /** 정지 다이얼로그에 덧붙일 내용(판매자: 진행 주문 경고·매장도 숨기기) */ + suspendExtra?: ReactNode; + /** 정지 성공 뒤 이어서 할 일. 실패 안내는 스스로 하고 던지지 않는다 — 정지는 이미 됐다 */ + afterSuspend?: (reason: string) => Promise; } /** USER·SELLER 공용 정지/정지 해제. 정지는 사유 필수(감사 로그), 해제는 확인만. */ -export function AccountStatusActions({ accountId, status, label, onChanged }: Props) { +export function AccountStatusActions({ + accountId, + status, + label, + onChanged, + suspendExtra, + afterSuspend, +}: Props) { const [open, setOpen] = useState(false); const [reason, setReason] = useState(''); const [busy, setBusy] = useState(false); @@ -62,8 +73,9 @@ export function AccountStatusActions({ accountId, status, label, onChanged }: Pr setBusy(true); try { await suspendAccount(accountId, trimmed); - await onChanged(); toast.success(`${label} 계정을 정지했습니다.`); + await afterSuspend?.(trimmed); + await onChanged(); setOpen(false); setReason(''); } catch (e) { @@ -86,6 +98,7 @@ export function AccountStatusActions({ accountId, status, label, onChanged }: Pr 즉시 로그아웃되고 앱·판매자 센터를 이용할 수 없게 됩니다. 사유는 감사 로그에 남습니다. + {suspendExtra}