test

Tables (37)

account

  • account_id — BIGINT
  • member_id — BIGINT — Foreign key → member.member_id — NOT NULL
  • account_no — VARCHAR(30) — NOT NULL
  • account_type — VARCHAR(30) — NOT NULL
  • account_alias — VARCHAR(50)
  • balance — DECIMAL(15,2) — NOT NULL
  • account_status — VARCHAR(20) — NOT NULL
  • opened_at — DATETIME — NOT NULL
  • closed_at — DATETIME

account_transaction

  • tx_id — BIGINT
  • account_id — BIGINT — Foreign key → account.account_id — NOT NULL
  • tx_type — VARCHAR(30) — NOT NULL
  • direction — VARCHAR(10) — NOT NULL
  • amount — DECIMAL(15,2) — NOT NULL
  • balance_after — DECIMAL(15,2) — NOT NULL
  • ref_table — VARCHAR(50)
  • ref_id — BIGINT
  • description — VARCHAR(255)
  • occurred_at — DATETIME — NOT NULL
  • created_at — DATETIME — NOT NULL

alert_setting

  • alert_setting_id — BIGINT
  • member_id — BIGINT — Foreign key → member.member_id — NOT NULL
  • overspending_alert_enabled — CHAR(1) — NOT NULL
  • repayment_alert_enabled — CHAR(1) — NOT NULL
  • chatbot_marketing_enabled — CHAR(1) — NOT NULL
  • updated_at — DATETIME — NOT NULL

card_payment

  • payment_id — BIGINT
  • member_card_id — BIGINT — Foreign key → member_card.member_card_id — NOT NULL
  • member_id — BIGINT — Foreign key → member.member_id — NOT NULL
  • merchant_id — BIGINT — Foreign key → merchant.merchant_id
  • category_id — BIGINT — Foreign key → spending_category.category_id
  • payment_amount — DECIMAL(15,2) — NOT NULL
  • payment_status — VARCHAR(20) — NOT NULL
  • approved_at — DATETIME — NOT NULL
  • canceled_at — DATETIME
  • payment_channel — VARCHAR(20) — NOT NULL
  • description — VARCHAR(255)

card_product

  • card_product_id — BIGINT
  • product_name — VARCHAR(100) — NOT NULL
  • card_type — VARCHAR(20) — NOT NULL
  • annual_fee — DECIMAL(10,2) — NOT NULL
  • description — TEXT
  • is_active — CHAR(1) — NOT NULL
  • created_at — DATETIME — NOT NULL

card_repayment_setting

  • setting_id — BIGINT
  • member_card_id — BIGINT — Foreign key → member_card.member_card_id — NOT NULL
  • repayment_mode — VARCHAR(20) — NOT NULL
  • round_unit — INT
  • luxury_rate — DECIMAL(5,2)
  • essential_rate — DECIMAL(5,2)
  • min_balance_threshold — DECIMAL(15,2) — NOT NULL
  • is_auto_repayment_enabled — CHAR(1) — NOT NULL
  • started_at — DATETIME — NOT NULL
  • ended_at — DATETIME

chat_consult_summary

  • summary_id — BIGINT
  • chat_session_id — BIGINT — Foreign key → chat_session.chat_session_id — NOT NULL
  • summary_type — VARCHAR(30) — NOT NULL
  • summary_text — TEXT — NOT NULL
  • created_at — DATETIME — NOT NULL

chat_message

  • chat_message_id — BIGINT
  • chat_session_id — BIGINT — Foreign key → chat_session.chat_session_id — NOT NULL
  • sender_type — VARCHAR(20) — NOT NULL
  • message_text — TEXT — NOT NULL
  • intent_code — VARCHAR(50)
  • created_at — DATETIME — NOT NULL

chat_session

  • chat_session_id — BIGINT
  • member_id — BIGINT — Foreign key → member.member_id
  • session_type — VARCHAR(30) — NOT NULL
  • started_at — DATETIME — NOT NULL
  • ended_at — DATETIME
  • session_status — VARCHAR(20) — NOT NULL

consumption_report

  • report_id — BIGINT
  • member_id — BIGINT — Foreign key → member.member_id — NOT NULL
  • report_type — VARCHAR(20) — NOT NULL
  • period_start — DATE — NOT NULL
  • period_end — DATE — NOT NULL
  • total_spending — DECIMAL(15,2) — NOT NULL
  • essential_spending — DECIMAL(15,2) — NOT NULL
  • luxury_spending — DECIMAL(15,2) — NOT NULL
  • total_extra_repayment — DECIMAL(15,2) — NOT NULL
  • overspending_risk_level — VARCHAR(20)
  • created_at — DATETIME — NOT NULL

coupon

  • coupon_id — BIGINT
  • coupon_name — VARCHAR(100) — NOT NULL
  • coupon_type — VARCHAR(30) — NOT NULL
  • discount_amount — DECIMAL(15,2)
  • discount_rate — DECIMAL(5,2)
  • valid_days — INT — NOT NULL
  • is_active — CHAR(1) — NOT NULL

coupon_usage_history

  • usage_id — BIGINT
  • member_coupon_id — BIGINT — Foreign key → member_coupon.member_coupon_id — NOT NULL
  • loan_id — BIGINT — Foreign key → loan.loan_id — NOT NULL
  • applied_amount — DECIMAL(15,2) — NOT NULL
  • applied_at — DATETIME — NOT NULL

credit_score_factor_detail

  • factor_id — BIGINT
  • score_id — BIGINT — Foreign key → credit_score_snapshot.score_id — NOT NULL
  • factor_code — VARCHAR(50) — NOT NULL
  • factor_name — VARCHAR(100) — NOT NULL
  • factor_value — DECIMAL(10,2)
  • weight_value — DECIMAL(5,2)
  • factor_score — DECIMAL(5,2)

credit_score_snapshot

  • score_id — BIGINT
  • member_id — BIGINT — Foreign key → member.member_id — NOT NULL
  • score_value — INT — NOT NULL
  • grade — VARCHAR(10) — NOT NULL
  • repayment_ratio_score — DECIMAL(5,2)
  • spending_control_score — DECIMAL(5,2)
  • mission_score — DECIMAL(5,2)
  • delinquency_score — DECIMAL(5,2)
  • model_version — VARCHAR(50)
  • calculated_at — DATETIME — NOT NULL

financial_recommendation

  • recommendation_id — BIGINT
  • member_id — BIGINT — Foreign key → member.member_id — NOT NULL
  • recommendation_type — VARCHAR(30) — NOT NULL
  • target_product_type — VARCHAR(30)
  • target_product_id — BIGINT
  • reason_summary — VARCHAR(255)
  • recommendation_score — DECIMAL(5,2)
  • generated_at — DATETIME — NOT NULL

loan

  • loan_id — BIGINT
  • member_id — BIGINT — Foreign key → member.member_id — NOT NULL
  • loan_product_id — BIGINT — Foreign key → loan_product.loan_product_id — NOT NULL
  • loan_app_id — BIGINT — Foreign key → loan_application.loan_app_id — NOT NULL
  • repayment_account_id — BIGINT — Foreign key → account.account_id — NOT NULL
  • principal_amount — DECIMAL(15,2) — NOT NULL
  • interest_rate — DECIMAL(5,2) — NOT NULL
  • preferential_rate — DECIMAL(5,2) — NOT NULL
  • outstanding_principal — DECIMAL(15,2) — NOT NULL
  • loan_status — VARCHAR(20) — NOT NULL
  • executed_at — DATETIME — NOT NULL
  • maturity_date — DATE

loan_application

  • loan_app_id — BIGINT
  • member_id — BIGINT — Foreign key → member.member_id — NOT NULL
  • loan_product_id — BIGINT — Foreign key → loan_product.loan_product_id — NOT NULL
  • requested_amount — DECIMAL(15,2) — NOT NULL
  • requested_months — INT — NOT NULL
  • application_status — VARCHAR(30) — NOT NULL
  • agreed_at — DATETIME
  • submitted_at — DATETIME
  • reviewed_at — DATETIME

loan_application_step

  • app_step_id — BIGINT
  • loan_app_id — BIGINT — Foreign key → loan_application.loan_app_id — NOT NULL
  • step_code — VARCHAR(30) — NOT NULL
  • step_status — VARCHAR(20) — NOT NULL
  • completed_at — DATETIME
  • memo — VARCHAR(255)

loan_document

  • loan_doc_id — BIGINT
  • loan_app_id — BIGINT — Foreign key → loan_application.loan_app_id — NOT NULL
  • doc_type — VARCHAR(50) — NOT NULL
  • file_path — VARCHAR(255) — NOT NULL
  • upload_status — VARCHAR(20) — NOT NULL
  • uploaded_at — DATETIME — NOT NULL
  • verified_at — DATETIME

loan_product

  • loan_product_id — BIGINT
  • product_code — VARCHAR(30) — NOT NULL
  • product_name — VARCHAR(100) — NOT NULL
  • product_type — VARCHAR(30) — NOT NULL
  • base_interest_rate — DECIMAL(5,2) — NOT NULL
  • max_limit_amount — DECIMAL(15,2) — NOT NULL
  • min_limit_amount — DECIMAL(15,2) — NOT NULL
  • max_period_month — INT — NOT NULL
  • description — TEXT
  • is_active — CHAR(1) — NOT NULL
  • created_at — DATETIME — NOT NULL

loan_rate_benefit_history

  • benefit_id — BIGINT
  • loan_id — BIGINT — Foreign key → loan.loan_id — NOT NULL
  • benefit_type — VARCHAR(30) — NOT NULL
  • change_rate — DECIMAL(5,2) — NOT NULL
  • reason — VARCHAR(255)
  • applied_at — DATETIME — NOT NULL
  • expired_at — DATETIME

loan_repayment

  • repayment_id — BIGINT
  • loan_id — BIGINT — Foreign key → loan.loan_id — NOT NULL
  • repayment_type — VARCHAR(30) — NOT NULL
  • principal_paid — DECIMAL(15,2) — NOT NULL
  • interest_paid — DECIMAL(15,2) — NOT NULL
  • total_paid — DECIMAL(15,2) — NOT NULL
  • source_account_id — BIGINT — Foreign key → account.account_id
  • linked_payment_id — BIGINT — Foreign key → card_payment.payment_id
  • description — VARCHAR(255)
  • repaid_at — DATETIME — NOT NULL

member

  • member_id — BIGINT
  • login_id — VARCHAR(50) — NOT NULL
  • password_hash — VARCHAR(255) — NOT NULL
  • name — VARCHAR(50) — NOT NULL
  • nickname — VARCHAR(50) — NOT NULL
  • email — VARCHAR(100)
  • phone — VARCHAR(20)
  • birth_date — DATE
  • gender — CHAR(1)
  • member_status — VARCHAR(20) — NOT NULL
  • signup_type — VARCHAR(20) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

member_agreement

  • agreement_id — BIGINT
  • member_id — BIGINT — Foreign key → member.member_id — NOT NULL
  • term_code — VARCHAR(50) — NOT NULL
  • term_version — VARCHAR(20) — NOT NULL
  • is_agreed — CHAR(1) — NOT NULL
  • agreed_at — DATETIME — NOT NULL

member_card

  • member_card_id — BIGINT
  • member_id — BIGINT — Foreign key → member.member_id — NOT NULL
  • card_product_id — BIGINT — Foreign key → card_product.card_product_id — NOT NULL
  • linked_account_id — BIGINT — Foreign key → account.account_id — NOT NULL
  • card_no_masked — VARCHAR(30) — NOT NULL
  • card_token — VARCHAR(100) — NOT NULL
  • expiry_mm — CHAR(2) — NOT NULL
  • expiry_yy — CHAR(2) — NOT NULL
  • card_status — VARCHAR(20) — NOT NULL
  • issued_at — DATETIME — NOT NULL

member_consumption_style

  • style_id — BIGINT
  • member_id — BIGINT — Foreign key → member.member_id — NOT NULL
  • style_type — VARCHAR(30) — NOT NULL
  • avg_luxury_ratio — DECIMAL(5,2)
  • avg_monthly_spending — DECIMAL(15,2)
  • updated_at — DATETIME — NOT NULL

member_coupon

  • member_coupon_id — BIGINT
  • member_id — BIGINT — Foreign key → member.member_id — NOT NULL
  • coupon_id — BIGINT — Foreign key → coupon.coupon_id — NOT NULL
  • coupon_status — VARCHAR(20) — NOT NULL
  • issued_at — DATETIME — NOT NULL
  • expires_at — DATETIME — NOT NULL
  • used_at — DATETIME

member_mission

  • member_mission_id — BIGINT
  • member_id — BIGINT — Foreign key → member.member_id — NOT NULL
  • mission_id — BIGINT — Foreign key → mission.mission_id — NOT NULL
  • mission_date — DATE — NOT NULL
  • completion_status — VARCHAR(20) — NOT NULL
  • evidence_text — VARCHAR(255)
  • completed_at — DATETIME

member_profile

  • profile_id — BIGINT
  • member_id — BIGINT — Foreign key → member.member_id — NOT NULL
  • employment_status — VARCHAR(30)
  • monthly_income — DECIMAL(15,2)
  • housing_type — VARCHAR(30)
  • financial_goal — VARCHAR(100)
  • risk_grade — VARCHAR(20)
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

merchant

  • merchant_id — BIGINT
  • merchant_name — VARCHAR(100) — NOT NULL
  • business_no — VARCHAR(30)
  • mcc_code — VARCHAR(20)
  • created_at — DATETIME — NOT NULL

mission

  • mission_id — BIGINT
  • mission_name — VARCHAR(100) — NOT NULL
  • mission_type — VARCHAR(30) — NOT NULL
  • reward_point — INT — NOT NULL
  • mission_description — TEXT
  • is_active — CHAR(1) — NOT NULL
  • created_at — DATETIME — NOT NULL

notification

  • notification_id — BIGINT
  • member_id — BIGINT — Foreign key → member.member_id — NOT NULL
  • notification_type — VARCHAR(30) — NOT NULL
  • title — VARCHAR(100) — NOT NULL
  • content — VARCHAR(255) — NOT NULL
  • is_read — CHAR(1) — NOT NULL
  • sent_at — DATETIME — NOT NULL

payment_ai_analysis

  • analysis_id — BIGINT
  • payment_id — BIGINT — Foreign key → card_payment.payment_id — NOT NULL
  • predicted_category_id — BIGINT — Foreign key → spending_category.category_id — NOT NULL
  • essential_luxury_label — VARCHAR(20) — NOT NULL
  • confidence_score — DECIMAL(5,2) — NOT NULL
  • analysis_reason — VARCHAR(255)
  • model_version — VARCHAR(50)
  • analyzed_at — DATETIME — NOT NULL

payment_repayment_calc

  • calc_id — BIGINT
  • payment_id — BIGINT — Foreign key → card_payment.payment_id — NOT NULL
  • setting_id — BIGINT — Foreign key → card_repayment_setting.setting_id — NOT NULL
  • base_amount — DECIMAL(15,2) — NOT NULL
  • essential_rate_applied — DECIMAL(5,2)
  • luxury_rate_applied — DECIMAL(5,2)
  • round_up_amount — DECIMAL(15,2) — NOT NULL
  • extra_repayment_amount — DECIMAL(15,2) — NOT NULL
  • calc_status — VARCHAR(20) — NOT NULL
  • skip_reason — VARCHAR(255)
  • calculated_at — DATETIME — NOT NULL

point_history

  • point_history_id — BIGINT
  • wallet_id — BIGINT — Foreign key → point_wallet.wallet_id — NOT NULL
  • member_id — BIGINT — Foreign key → member.member_id — NOT NULL
  • point_type — VARCHAR(30) — NOT NULL
  • point_amount — INT — NOT NULL
  • ref_table — VARCHAR(50)
  • ref_id — BIGINT
  • description — VARCHAR(255)
  • occurred_at — DATETIME — NOT NULL

point_wallet

  • wallet_id — BIGINT
  • member_id — BIGINT — Foreign key → member.member_id — NOT NULL
  • current_point — INT — NOT NULL
  • updated_at — DATETIME — NOT NULL

spending_category

  • category_id — BIGINT
  • parent_category_id — BIGINT — Foreign key → spending_category.category_id
  • category_name — VARCHAR(50) — NOT NULL
  • category_type — VARCHAR(20) — NOT NULL
  • description — VARCHAR(255)
  • is_active — CHAR(1) — NOT NULL