- Move deposit-agent.ts to src/agents/ - Add D1 session CRUD functions (getDepositSession, saveDepositSession, etc.) - Add Deposit Expert AI with function calling - Add processDepositConsultation handler for session-based flow - Add deposit_sessions table migration (006_add_deposit_sessions.sql) - Update import paths in deposit-tool.ts - Add DEPOSIT_BANK_* environment variables to Env interface Session flow: collecting_amount → collecting_name → confirming → completed Smart parsing: "홍길동 5만원" → Go directly to confirming Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
17 lines
782 B
SQL
17 lines
782 B
SQL
-- Migration: Add deposit_sessions table for session-based deposit requests
|
|
-- Date: 2026-02-05
|
|
-- Description: 입금 신고 세션 관리 (collecting_amount → collecting_name → confirming → completed)
|
|
|
|
CREATE TABLE IF NOT EXISTS deposit_sessions (
|
|
user_id TEXT PRIMARY KEY,
|
|
status TEXT NOT NULL CHECK(status IN ('collecting_amount', 'collecting_name', 'confirming', 'completed')),
|
|
collected_info TEXT, -- JSON: { amount?: number, depositor_name?: string }
|
|
messages TEXT, -- JSON: [{ role: 'user' | 'assistant', content: string }]
|
|
created_at INTEGER NOT NULL,
|
|
updated_at INTEGER NOT NULL,
|
|
expires_at INTEGER NOT NULL
|
|
);
|
|
|
|
-- Index for cleanup queries (expired sessions)
|
|
CREATE INDEX IF NOT EXISTS idx_deposit_sessions_expires_at ON deposit_sessions(expires_at);
|