기능은 대부분 완성됐지만, functions/lib/tax.ts(1인 사업자 부가세/종합소득세 추정 로직)가
배포는 되어 있어도 실거래 데이터로 API 응답을 수기 계산과 대조 검증한 적은 없었음.
wrangler d1 execute --local)에 전용 테스트 유저(taxtest-user)를 만들고unsettled=1)/카드정산기 미확인(예정) 거래를 섞어 1~3월 데이터 삽입wrangler pages dev dist --port=8788로 로컬 풀스택 서버를 띄워 GET /api/tax/estimate?month=...를 실제 호출삽질 포인트:
wrangler pages dev에--d1=DB=budget-db플래그를 주면
wrangler.toml의database_id를 무시하고 별도의 로컬 D1 파일(빈 스키마)이 새로 생성됨.
플래그 없이wrangler.toml설정만으로 띄워야wrangler d1 execute가 쓰는 것과
동일한 D1 파일에 연결됨.
| 시나리오 | 부가세 추정 | 종소세 추정 | 세금 적립액 | 실수령 추정 |
|---|---|---|---|---|
| 일반과세자 (3월, 누적3개월) | 350,000 | 891,000 | 1,241,000 | 2,109,000 |
| 간이과세자 20% (3월) | 100,000 | 891,000 | 991,000 | 2,359,000 |
| 프리랜서 3.3% (3월) | 해당없음 | 891,000 | 891,000 | 2,459,000 |
| 간이과세자, 부가율 미입력 | 계산불가 | 891,000 | 891,000 | 2,459,000 |
| 일반과세자 (1월, 누적1개월) | 200,000 | 140,250 | 340,250 | 1,209,750 |
| 일반과세자 (2월, 누적2개월) | 280,000 | 453,750 | 733,750 | 1,866,250 |
검증된 로직:
에러 케이스도 확인:
코드 변경 없이 검증만 진행 — 테스트 데이터/세션은 검증 후 전부 삭제, dev 서버 프로세스 종료.
세금 계산기 검증 작업 중 카드 정산 알림을 실제로 확인하다가 "푸시를 놓치면 다시 볼 방법이
전혀 없다"는 문제를 발견. 당시 notification_log엔 발송 여부만 기록되고 실제 알림 문구는
저장되지 않고 있었음.
notification_log에 title/body/url/read_at 컬럼 추가 (마이그레이션 031)GET /api/notifications(목록 + 안읽음 개수), PATCH /api/notifications/read(전체 읽음) API 추가NotificationBell) 배치 — 뱃지 표시, 클릭 시 목록 열람 + 자동 읽음 처리 + 딥링크 이동migrations/031_notification_log_content.sql + schema.sql 반영workers/card-settlement-notifier, workers/monthly-tax-reporter의 logNotified가functions/api/notifications/index.ts(GET), functions/api/notifications/read.ts(PATCH) 신규 추가src/components/NotificationBell.tsx 신규 컴포넌트, App.tsx 헤더에 다크모드 토글 옆에 배치npm run build(tsc+vite), npm run lint(oxlint), 양쪽 워커 npm run typecheck 통과SearchView.tsx 필터 패널의 금액 범위)