donworry

Tables (14)

asset_class

  • asset_class_id — INT — Primary key — NOT NULL
  • name — VARCHAR(50) — NOT NULL
  • risk_level — INT — NOT NULL
  • sort_order — INT

deposit_detail

  • product_id — BIGINT — Foreign key → products.product_id — NOT NULL
  • interest_rate — DECIMAL(5,2)
  • term_months — INT
  • protection — BOOLEAN
  • max_limit — DECIMAL(15,0)

distribution_history

  • dist_id — BIGINT — Primary key — NOT NULL
  • product_id — BIGINT — Foreign key → products.product_id — NOT NULL
  • dist_type — VARCHAR(20)
  • ex_date — DATE
  • pay_date — DATE
  • amount — DECIMAL(15,2)

holdings

  • holding_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • product_id — BIGINT — Foreign key → products.product_id
  • eval_amount — DECIMAL(15,0)
  • account_type — VARCHAR(20)
  • is_locked — BOOLEAN

liquidity_event

  • event_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • horizon — VARCHAR(20)
  • amount — DECIMAL(15,0)
  • reason — VARCHAR(100)

pension

  • pension_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • type — VARCHAR(20)
  • monthly_amount — DECIMAL(15,0)
  • start_age — INT

price_history

  • price_id — BIGINT — Primary key — NOT NULL
  • product_id — BIGINT — Foreign key → products.product_id — NOT NULL
  • base_date — DATE — NOT NULL
  • close_price — DECIMAL(15,2)
  • nav — DECIMAL(15,2)

products

  • product_id — BIGINT — Primary key — NOT NULL
  • asset_class_id — INT — Foreign key → asset_class.asset_class_id — NOT NULL
  • product_type — VARCHAR(20) — NOT NULL
  • name — VARCHAR(200) — NOT NULL
  • data_source — VARCHAR(20)
  • currency — VARCHAR(10)
  • updated_at — TIMESTAMP

recommendation

  • rec_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • plan_type — VARCHAR(20)
  • expected_income — DECIMAL(15,0)
  • coverage_ratio — DECIMAL(5,2)
  • created_at — TIMESTAMP

recommendation_item

  • item_id — BIGINT — Primary key — NOT NULL
  • rec_id — BIGINT — Foreign key → recommendation.rec_id — NOT NULL
  • product_id — BIGINT — Foreign key → products.product_id — NOT NULL
  • weight_pct — DECIMAL(5,2)
  • amount — DECIMAL(15,0)
  • income_contrib — DECIMAL(15,0)

risk_profile

  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • floor_ratio — DECIMAL(5,2)
  • liquidity_score — INT
  • risk_capacity — INT
  • risk_preference — VARCHAR(20)
  • cashflow_pref — VARCHAR(20)
  • guardrail_score — INT
  • final_profile — VARCHAR(20)
  • calculated_at — TIMESTAMP

security_detail

  • product_id — BIGINT — Foreign key → products.product_id — NOT NULL
  • ticker — VARCHAR(20)
  • market — VARCHAR(20)
  • sub_type — VARCHAR(30)
  • expense_ratio — DECIMAL(5,2)
  • credit_rating — VARCHAR(10)
  • maturity_date — DATE

survey_response

  • response_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • question_code — VARCHAR(40) — NOT NULL
  • answer_value — VARCHAR(40)
  • answered_at — TIMESTAMP

users

  • user_id — BIGINT — Primary key — NOT NULL
  • age — INT
  • is_retired — BOOLEAN
  • pension_started — BOOLEAN
  • target_living_cost — DECIMAL(15,0)
  • medical_cost — DECIMAL(15,0)
  • created_at — TIMESTAMP