Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
c8f930f
feat: 스키마 갱신과 상품·주문 커스텀 표시
chanwoo7 Nov 18, 2026
ebde314
docs: 처리 대기 딥링크 계약·계좌번호 표시 규칙과 커스텀 표시 결정 기록
chanwoo7 Nov 18, 2026
c6904cf
fix: 사정 선택이 필요한 주문의 취소 버튼을 숨기고 자유 편집 표시를 슬롯형 상품에만
chanwoo7 Nov 18, 2026
3cb6f7a
docs: 계좌번호 원문이 오는 처리 mutation 응답도 표시 규칙에 포함
chanwoo7 Nov 18, 2026
b439ed4
Merge pull request #86 from CaQuick/feat/schema-sync-custom-display
chanwoo7 Nov 18, 2026
960abdc
feat: 주문 입금 대기·노쇼 상태와 결제·환불·정산 카드, 강제 취소 사유·환불 금액
chanwoo7 Nov 18, 2026
efb2af9
fix: 강제 취소 입력 오류는 폼 위에, 다시 열면 입력을 비우고 매장 조회 전에는 자동 픽업을 단정하지 않음
chanwoo7 Nov 19, 2026
1dc885c
Merge pull request #87 from CaQuick/feat/orders-payment-cancel
chanwoo7 Nov 19, 2026
eb6c3a8
feat: 결제 설정·주간 정산·월 수수료와 매장 정산 계좌·진행 주문 경고
chanwoo7 Nov 18, 2026
5523a7c
fix: 월 입력 부분 값을 URL에 싣지 않고 매장도 숨기기를 다시 기본 켬으로
chanwoo7 Nov 19, 2026
2490e46
fix: 월 수수료에서 월을 바꾸는 동안 이전 달 금액을 보이지 않음
chanwoo7 Nov 19, 2026
d979360
Merge pull request #88 from CaQuick/feat/settlements-settings
chanwoo7 Nov 19, 2026
eaaabd2
feat: 처리 대기 허브(입금 확인·입금 반환·환불 송금·정산 송금)
chanwoo7 Nov 19, 2026
4676396
fix: 입금 확인 시트의 픽업 지남 거절을 안내로 바꾸고 기한 지남은 미클릭 주문에만 표시
chanwoo7 Nov 19, 2026
a628a1e
fix: 처리 대기 라벨·송금 확인을 주문·정산과 한 벌로 묶고 화면 간 캐시를 서로 무효화
chanwoo7 Nov 19, 2026
c9b0648
fix: 처리 대기 금액 필터를 금액 규칙으로 검사
chanwoo7 Nov 19, 2026
e07d4b1
fix: 처리 대기 시트의 상세도 목록과 같은 주기로 다시 읽음
chanwoo7 Nov 19, 2026
0c9e740
Merge pull request #89 from CaQuick/feat/tasks-hub
chanwoo7 Nov 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/guide/architecture-conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ src/
- **요청**은 `gqlRequest(Document, variables)`(`@/shared/api`) 하나로. 인증 헤더·쿠키·401 갱신·에러 정규화(`ApiError`)를 여기서 끝낸다. REST는 `authRequest`.
- **쿼리 키**는 feature별 팩토리(`ordersKeys.list(filters)`, `ordersKeys.detail(id)`)로만 만든다. 문자열 리터럴 키 금지.
- **mutation 뒤**에는 그 feature의 list·detail 키를 invalidate한다. 낙관적 업데이트는 쓰지 않는다 — 감사 대상 작업이라 서버 결과가 진실이다.
- 다른 feature의 화면도 바꾸는 mutation(처리 대기 처리 → 주문·정산·대시보드, 강제 취소·정산 송금 완료 → 처리 대기)은 상대 배럴의 `invalidate*` helper를 부른다. 키는 소유 feature만 만든다. 서로 부르는 feature는 순환 import가 되므로 상대 export를 모듈 평가 때(최상위 상수·zod 스키마) 쓰지 않는다.
- **목록**은 커서 방식(`items · totalCount · hasMore · nextCursor`). 필터·커서는 URL 검색 파라미터(zod)로 유지해 새로고침·공유가 된다.
- **ID**는 문자열 그대로. `"0"`·빈 문자열을 truthy 검사로 버리지 않는다.
- **enum 라벨**은 `Record<생성 enum, …>`로 둬 값이 늘면 tsc가 잡게 하고, 조회는 모르는 값에 원문으로 폴백한다. BE가 먼저 배포돼 새 값이 와도 화면이 죽지 않아야 한다.
- **날짜**는 표시·입력 KST, 전송 ISO(UTC). 기간 필터의 경계는 KST 하루 시작·끝을 UTC로 바꿔 보낸다.

## 4. 인증
Expand Down
43 changes: 23 additions & 20 deletions docs/guide/decisions.md

Large diffs are not rendered by default.

3,651 changes: 3,277 additions & 374 deletions schema/schema.graphql

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/app/router.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ describe('ID 검색 파라미터 정밀도', () => {
'/_authed/_shell/reviews accountId',
'/_authed/_shell/reviews reviewId',
'/_authed/_shell/reviews storeId',
'/_authed/_shell/settlements/ storeId',
'/_authed/_shell/stores/ regionId',
'/_authed/_shell/tasks/deposits orderId',
'/_authed/_shell/tasks/refunds refundId',
'/_authed/_shell/tasks/settlements settlementId',
].sort(),
);
});
Expand Down
4 changes: 4 additions & 0 deletions src/app/shell/nav.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ 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: '/tasks/deposits', want: '처리 대기' },
])('하위 화면도 메뉴 제목을 따른다: $path → $want', ({ path, want }) => {
expect(titleFor(path)).toBe(want);
});
Expand Down
16 changes: 15 additions & 1 deletion src/app/shell/nav.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
type LucideIcon,
BriefcaseIcon,
InboxIcon,
LayoutDashboardIcon,
PackageIcon,
TagsIcon,
Expand All @@ -11,19 +12,26 @@ import {
MapPinIcon,
ScrollTextIcon,
SearchIcon,
SettingsIcon,
ShieldIcon,
MessageSquareIcon,
MessagesSquareIcon,
ShoppingBagIcon,
StoreIcon,
UsersIcon,
WalletIcon,
} from 'lucide-react';
import { type ComponentType } from 'react';

import { TaskCountBadge } from '@/features/tasks';

/** 사이드바 메뉴. 각 영역 PR이 자기 항목을 붙인다 — Link의 to가 라우트 타입으로 검사되므로 있는 경로만 둔다. */
interface NavItem {
to:
| '/'
| '/tasks'
| '/orders'
| '/settlements'
| '/users'
| '/sellers'
| '/stores'
Expand All @@ -38,9 +46,12 @@ interface NavItem {
| '/notifications'
| '/regions'
| '/audit-logs'
| '/admins';
| '/admins'
| '/settings';
label: string;
icon: LucideIcon;
/** 메뉴 오른쪽 건수 배지 */
badge?: ComponentType;
}
export interface NavGroup {
label: string | null;
Expand All @@ -52,7 +63,9 @@ export const NAV_GROUPS: NavGroup[] = [
{
label: '운영',
items: [
{ to: '/tasks', label: '처리 대기', icon: InboxIcon, badge: TaskCountBadge },
{ 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 },
Expand Down Expand Up @@ -80,6 +93,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 {
Expand Down
1 change: 1 addition & 0 deletions src/app/shell/sidebar-nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export function SidebarNav({ onNavigate }: { onNavigate?: () => void }) {
>
<item.icon className="size-4 shrink-0 opacity-70" aria-hidden />
{item.label}
{item.badge && <item.badge />}
</Link>
))}
</div>
Expand Down
19 changes: 16 additions & 3 deletions src/features/accounts/components/account-status-actions.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -28,10 +28,21 @@ interface Props {
label: string;
/** 성공 뒤 호출자의 캐시 무효화 */
onChanged: () => Promise<void> | void;
/** 정지 다이얼로그에 덧붙일 내용(판매자: 진행 주문 경고·매장도 숨기기) */
suspendExtra?: ReactNode;
/** 정지 성공 뒤 이어서 할 일. 실패 안내는 스스로 하고 던지지 않는다 — 정지는 이미 됐다 */
afterSuspend?: (reason: string) => Promise<void>;
}

/** 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);
Expand Down Expand Up @@ -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) {
Expand All @@ -86,6 +98,7 @@ export function AccountStatusActions({ accountId, status, label, onChanged }: Pr
즉시 로그아웃되고 앱·판매자 센터를 이용할 수 없게 됩니다. 사유는 감사 로그에 남습니다.
</DialogDescription>
</DialogHeader>
{suspendExtra}
<div className="flex flex-col gap-1.5">
<Label htmlFor="suspend-reason">정지 사유 (필수)</Label>
<Textarea
Expand Down
2 changes: 2 additions & 0 deletions src/features/accounts/pages/users.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ describe('구매자', () => {
const dialog = await screen.findByRole('dialog');
expect(dialog).toHaveTextContent('즉시 로그아웃되고 앱·판매자 센터를 이용할 수 없게 됩니다.');
expect(dialog).not.toHaveTextContent('API');
// 매장도 숨기기는 판매자 정지에만 있다
expect(within(dialog).queryByRole('checkbox')).not.toBeInTheDocument();
expect(within(dialog).getByRole('button', { name: '계정 정지' })).toBeDisabled();
await userEvent.type(within(dialog).getByLabelText('정지 사유 (필수)'), ' 욕설 신고 누적 ');
await userEvent.click(within(dialog).getByRole('button', { name: '계정 정지' }));
Expand Down
48 changes: 47 additions & 1 deletion src/features/audit-logs/components/audit-links.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@ import { actorTypeLabel, targetLabel } from '../meta';
const linkClass = 'text-primary-soft-foreground hover:underline';

/** 대상 종류별 화면으로 잇는다. 상세 화면이 없는 종류(계정·분류·지역·알림 등)는 글자만 보인다 */
export function TargetLink({ targetType, targetId }: { targetType: string; targetId: string }) {
export function TargetLink({
targetType,
targetId,
storeId,
}: {
targetType: string;
targetId: string;
storeId?: string | null;
}) {
const text = `${targetLabel(targetType)} #${targetId}`;
switch (targetType) {
case 'ORDER':
Expand Down Expand Up @@ -45,6 +53,44 @@ export function TargetLink({ targetType, targetId }: { targetType: string; targe
{text}
</Link>
);
case 'SETTLEMENT':
return (
<Link
to="/settlements/$settlementId"
params={{ settlementId: targetId }}
className={linkClass}
>
{text}
</Link>
);
case 'PAYMENT_SETTING':
return (
<Link to="/settings" className={linkClass}>
{text}
</Link>
);
case 'SETTLEMENT_ACCOUNT':
// targetId는 계좌 행 번호라 화면이 없다. 계좌는 매장 상세에서 본다
return storeId == null ? (
<span>{text}</span>
) : (
<Link to="/stores/$storeId" params={{ storeId }} className={linkClass}>
{text}
</Link>
);
case 'REFUND':
return (
<Link to="/tasks/refunds" search={{ refundId: targetId }} className={linkClass}>
{text}
</Link>
);
case 'DEPOSIT_RECORD':
// 입금 기록은 단건 조회가 없어 목록으로 연다
return (
<Link to="/tasks/deposits" search={{ view: 'records' }} className={linkClass}>
{text}
</Link>
);
default:
return <span>{text}</span>;
}
Expand Down
18 changes: 18 additions & 0 deletions src/features/audit-logs/meta.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,24 @@ describe('감사 대상 유형 라벨', () => {
expect(targetLabel(value)).not.toBe(value);
});

it.each([
['PAYMENT_SETTING', '결제 설정'],
['SETTLEMENT_ACCOUNT', '정산 계좌'],
['SETTLEMENT', '정산'],
['REFUND', '환불'],
['DEPOSIT_RECORD', '입금 기록'],
])('결제·정산 대상 %s의 라벨: %s', (value, label) => {
expect(targetLabel(value)).toBe(label);
});

it.each([['PAYOUT'], ['constructor'], ['']])(
'모르는 유형 %j는 원문으로 보이고 필터에는 나오지 않는다',
(value) => {
expect(targetLabel(value)).toBe(value);
expect(auditSearchSchema.parse({ targetType: value }).targetType).toBeUndefined();
},
);

it('스키마에 없는 유형은 라벨 표에도 없다', () => {
const known = new Set(schemaTargetTypes());
expect(TARGET_TYPES.map((t) => t.value).filter((v) => !known.has(v))).toEqual([]);
Expand Down
5 changes: 5 additions & 0 deletions src/features/audit-logs/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ const TARGET_LABELS: Record<AuditTargetType, string> = {
REVIEW_REPORT: '신고',
NOTIFICATION: '알림',
CONVERSATION: '대화',
PAYMENT_SETTING: '결제 설정',
SETTLEMENT_ACCOUNT: '정산 계좌',
SETTLEMENT: '정산',
REFUND: '환불',
DEPOSIT_RECORD: '입금 기록',
};
export const TARGET_TYPES = (Object.keys(TARGET_LABELS) as AuditTargetType[]).map((value) => ({
value,
Expand Down
6 changes: 5 additions & 1 deletion src/features/audit-logs/pages/audit-logs-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ const columns: ColumnDef<AuditRow, unknown>[] = [
id: 'target',
header: '대상',
cell: ({ row }) => (
<TargetLink targetType={row.original.targetType} targetId={row.original.targetId} />
<TargetLink
targetType={row.original.targetType}
targetId={row.original.targetId}
storeId={row.original.storeId}
/>
),
},
{
Expand Down
36 changes: 36 additions & 0 deletions src/features/audit-logs/pages/audit-logs.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ describe('감사 로그', () => {
['BANNER', '배너 #5', '/banners/5'],
['REVIEW', '리뷰 #5', '/reviews?reviewId=5&deleted=true'],
['REVIEW_REPORT', '신고 #5', '/reports/5'],
['REFUND', '환불 #5', '/tasks/refunds?refundId=5'],
['DEPOSIT_RECORD', '입금 기록 #5', '/tasks/deposits?view=records'],
['ACCOUNT', '계정 #5', null],
['CHANGE_PASSWORD', '비밀번호 변경 #5', null],
['CATEGORY', '카테고리 #5', null],
Expand All @@ -139,6 +141,10 @@ describe('감사 로그', () => {
['REVIEW_COMMENT', '리뷰 댓글 #5', null],
['NOTIFICATION', '알림 #5', null],
['CONVERSATION', '대화 #5', null],
['SETTLEMENT', '정산 #5', '/settlements/5'],
['PAYMENT_SETTING', '결제 설정 #5', '/settings'],
// 계좌 행 번호라 화면이 없어 기록의 매장(17)으로 간다
['SETTLEMENT_ACCOUNT', '정산 계좌 #5', '/stores/17'],
])('대상 %s는 "%s" → %s', async (targetType, text, href) => {
server.use(
gqlOk('AdminAuditLogs', {
Expand All @@ -156,6 +162,21 @@ describe('감사 로그', () => {
else expect(decodeURIComponent(cell.closest('a')!.getAttribute('href')!)).toBe(href);
});

it('매장이 없는 정산 계좌 기록은 글자만 보인다', async () => {
server.use(
gqlOk('AdminAuditLogs', {
adminAuditLogs: {
items: [{ ...log, targetType: 'SETTLEMENT_ACCOUNT', targetId: '5', storeId: null }],
totalCount: 1,
hasMore: false,
nextCursor: null,
},
}),
);
boot('/audit-logs');
expect((await screen.findByText('정산 계좌 #5')).closest('a')).toBeNull();
});

it.each([
['SELLER', '판매자', '/sellers/3'],
['USER', '구매자', '/users/3'],
Expand Down Expand Up @@ -316,6 +337,21 @@ describe('감사 로그', () => {
updatedAt: '2026-09-27T02:34:00.000Z',
items: [],
statusHistories: [],
requestNote: null,
payment: null,
refunds: [],
cancellation: null,
cancelOptions: { cancelable: false, reasons: [], refundRule: null, paidAmount: 0 },
confirmDeadlineAt: null,
autoPickupAt: null,
noShowAt: null,
pickupChanges: [],
commissionRateBps: 0,
expectedPayoutAmount: null,
settlementBaseAmount: null,
commissionAmount: null,
settlementFinalizedAt: null,
settlementId: null,
},
}),
);
Expand Down
16 changes: 16 additions & 0 deletions src/features/custom/components/color-swatch.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const HEX = /^#[0-9A-Fa-f]{6}$/;

/** 판매자가 고른 글자색 견본과 값. 형식이 어긋난 값은 견본 없이 글자만 보인다 */
export function ColorSwatch({ color }: { color: string }) {
return (
<span className="inline-flex items-center gap-1.5 font-mono text-xs">
<span
aria-hidden
data-slot="color-swatch"
className="size-3.5 shrink-0 rounded-sm border"
style={HEX.test(color) ? { backgroundColor: color } : undefined}
/>
{color}
</span>
);
}
Loading