PBM-AgentAI_Postgres

Tables (12)

command_db (commands)

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL — logical
  • raw_text — TEXT
  • parsed_json — JSONB — PostgreSQL
  • status — command_status — PENDING
  • missing_fields_json — JSONB — GPT가
  • collected_answers_json — JSONB — 사용자가
  • created_at — TIMESTAMPTZ
  • updated_at — TIMESTAMPTZ
  • deleted_at — TIMESTAMPTZ

command_db (conditions)

  • id — BIGINT — Primary key — NOT NULL
  • command_id — BIGINT — Foreign key → command_db.id — NOT NULL — logical
  • user_id — BIGINT — Foreign key → users.id — NOT NULL — logical
  • monitor_target_id — BIGINT — Foreign key → price_db.id — logical
  • platform — VARCHAR(30) — NAVER
  • keyword — VARCHAR(100)
  • max_price — NUMERIC(19,4)
  • mode — condition_mode — ALERT_ONLY
  • is_active — BOOLEAN
  • max_execution_count — INT
  • current_execution_count — INT
  • last_checked_at — TIMESTAMPTZ
  • option_json — JSONB — 플랫폼별
  • expired_at — TIMESTAMPTZ
  • created_at — TIMESTAMPTZ
  • updated_at — TIMESTAMPTZ
  • deleted_at — TIMESTAMPTZ
  • priority — INT

notification_db (notification_settings)

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL — logical
  • mode — condition_mode — ALERT_ONLY
  • telegram_chat_id — VARCHAR(100)
  • telegram_enabled — BOOLEAN
  • email — VARCHAR(100)
  • email_enabled — BOOLEAN
  • timezone — VARCHAR(50) — 사용자
  • quiet_hours_start — TIME — 방해금지
  • quiet_hours_end — TIME — 방해금지
  • quiet_hours_crosses_midnight — BOOLEAN — 자정
  • created_at — TIMESTAMPTZ
  • updated_at — TIMESTAMPTZ

notification_db (notifications)

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL — logical
  • message — TEXT
  • type — notification_type — PRICE_ALERT
  • channel — notification_channel — TELEGRAM
  • is_read — BOOLEAN
  • read_at — TIMESTAMPTZ
  • retry_count — INT
  • failed_reason — TEXT
  • sent_at — TIMESTAMPTZ
  • created_at — TIMESTAMPTZ

payment_db (payment_settings)

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL — logical
  • monthly_limit — NUMERIC(19,4) — 월
  • max_per_transaction — NUMERIC(19,4) — 건당
  • allowed_platforms — JSONB — 허용
  • created_at — TIMESTAMPTZ
  • updated_at — TIMESTAMPTZ

payment_db (payments)

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL — logical
  • condition_id — BIGINT — Foreign key → command_db.id — NOT NULL — logical
  • price_history_id — BIGINT — Foreign key → price_db.id — NOT NULL — logical
  • product_name — VARCHAR(200)
  • platform — VARCHAR(30) — NAVER
  • amount — NUMERIC(19,4)
  • currency — currency_type — KRW
  • fee — NUMERIC(19,4) — 수수료
  • tx_hash — VARCHAR(200)
  • status — payment_status — PENDING
  • failure_reason — TEXT — 실패
  • retry_count — INT — 재시도
  • refunded_at — TIMESTAMPTZ — 환불
  • paid_at — TIMESTAMPTZ
  • created_at — TIMESTAMPTZ
  • updated_at — TIMESTAMPTZ

price_db (monitor_targets)

  • id — BIGINT — Primary key — NOT NULL
  • platform — VARCHAR(30) — NOT NULL — NAVER
  • normalized_keyword — VARCHAR(150) — NOT NULL — 공백/대소문자
  • fetch_interval_minutes — INT — NOT NULL — 공유
  • last_fetched_at — TIMESTAMPTZ — 마지막
  • next_fetch_at — TIMESTAMPTZ — 다음
  • created_at — TIMESTAMPTZ
  • updated_at — TIMESTAMPTZ

price_db (products)

  • id — BIGINT — Primary key — NOT NULL
  • monitor_target_id — BIGINT — Foreign key → price_db.id — NOT NULL — FK
  • platform — VARCHAR(30) — NOT NULL — NAVER
  • external_product_id — VARCHAR(120) — NOT NULL — 플랫폼별
  • title — VARCHAR(255) — 상품명
  • product_url — VARCHAR(500) — 상품
  • image_url — VARCHAR(500) — 대표
  • mall_name — VARCHAR(120) — 쇼핑몰명
  • last_seen_at — TIMESTAMPTZ — 마지막으로
  • created_at — TIMESTAMPTZ
  • updated_at — TIMESTAMPTZ

price_db (price_history)

  • id — BIGINT — Primary key — NOT NULL
  • product_id — BIGINT — Foreign key → price_db.id — NOT NULL — logical
  • current_price — NUMERIC(19,4) — 현재
  • original_price — NUMERIC(19,4) — 원가
  • currency — currency_type — KRW
  • checked_at — TIMESTAMPTZ — 가격

price_db (image_searches)

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL — logical
  • image_url — VARCHAR(500)
  • recognized_brand — VARCHAR(100) — Gemini가
  • recognized_model — VARCHAR(100) — Gemini가
  • search_results_json — JSONB — 쇼핑몰
  • created_at — TIMESTAMPTZ

price_db (recommendations)

  • id — BIGINT — Primary key — NOT NULL
  • category — VARCHAR(50)
  • product_name — VARCHAR(200)
  • rank — INT
  • pros — TEXT — 장점
  • cons — TEXT — 단점
  • youtuber — VARCHAR(100)
  • video_url — VARCHAR(500)
  • analysis_date — DATE — 분석
  • created_at — TIMESTAMPTZ
  • updated_at — TIMESTAMPTZ — 수정일

users

  • id — BIGINT — Primary key — NOT NULL
  • email — VARCHAR(100) — NOT NULL
  • password — VARCHAR(255) — NOT NULL
  • name — VARCHAR(50) — NOT NULL
  • pbm_wallet_address — VARCHAR(100)
  • role — user_role — USER
  • is_active — BOOLEAN
  • login_failed_count — INT
  • locked_until — TIMESTAMPTZ
  • last_login_at — TIMESTAMPTZ
  • created_at — TIMESTAMPTZ
  • updated_at — TIMESTAMPTZ