commerce-payment-system
Tables (9)
cart_items
- id — BIGINT
- cart_id — BIGINT — Foreign key → carts.id — NOT NULL
- product_id — BIGINT — Foreign key → products.id — NOT NULL
- quantity — INT — NOT NULL
- created_at — DATETIME(6) — NOT NULL
- updated_at — DATETIME(6) — NOT NULL
carts
- id — BIGINT
- member_id — BIGINT — Foreign key → members.id — NOT NULL
- created_at — DATETIME(6) — NOT NULL
- updated_at — DATETIME(6) — NOT NULL
members
- id — BIGINT
- email — VARCHAR(255) — NOT NULL
- password_hash — VARCHAR(255) — NOT NULL
- name — VARCHAR(100) — NOT NULL
- phone_number — VARCHAR(30) — NOT NULL
- point_balance — INT — NOT NULL
- membership_level — VARCHAR(30) — NOT NULL
- created_at — DATETIME(6) — NOT NULL
- updated_at — DATETIME(6) — NOT NULL
order_items
- id — BIGINT
- order_id — BIGINT — Foreign key → orders.id — NOT NULL
- product_id — BIGINT — Foreign key → products.id — NOT NULL
- product_name_snapshot — VARCHAR(150) — NOT NULL
- unit_price_snapshot — BIGINT — NOT NULL
- quantity — INT — NOT NULL
- line_total_amount — BIGINT — NOT NULL
- created_at — DATETIME(6) — NOT NULL
- updated_at — DATETIME(6) — NOT NULL
orders
- id — BIGINT
- order_number — VARCHAR(40) — NOT NULL
- member_id — BIGINT — Foreign key → members.id — NOT NULL
- order_status — VARCHAR(30) — NOT NULL
- total_amount — BIGINT — NOT NULL
- used_point_amount — BIGINT — NOT NULL
- pg_amount — BIGINT — NOT NULL
- created_at — DATETIME(6) — NOT NULL
- updated_at — DATETIME(6) — NOT NULL
- paid_at — DATETIME(6)
- canceled_at — DATETIME(6)
payments
- id — BIGINT
- order_id — BIGINT — Foreign key → orders.id — NOT NULL
- member_id — BIGINT — Foreign key → members.id — NOT NULL
- payment_status — VARCHAR(30) — NOT NULL
- payment_method_type — VARCHAR(30) — NOT NULL
- total_order_amount — BIGINT — NOT NULL
- used_point_amount — BIGINT — NOT NULL
- pg_amount — BIGINT — NOT NULL
- earned_point_amount — BIGINT — NOT NULL
- portone_payment_id — VARCHAR(100) — NOT NULL
- portone_transaction_id — VARCHAR(100)
- completed_at — DATETIME(6)
- failed_at — DATETIME(6)
- failure_reason — VARCHAR(255)
- created_at — DATETIME(6) — NOT NULL
- updated_at — DATETIME(6) — NOT NULL
point_ledgers
- id — BIGINT
- member_id — BIGINT — Foreign key → members.id — NOT NULL
- payment_id — BIGINT — Foreign key → payments.id
- point_type — VARCHAR(50) — NOT NULL
- amount — BIGINT — NOT NULL
- reason — VARCHAR(255) — NOT NULL
- created_at — DATETIME(6) — NOT NULL
- updated_at — DATETIME(6) — NOT NULL
products
- id — BIGINT
- category_code — VARCHAR(50) — NOT NULL
- name — VARCHAR(150) — NOT NULL
- description — TEXT — NOT NULL
- price — BIGINT — NOT NULL
- stock_quantity — INT — NOT NULL
- sale_status — VARCHAR(20) — NOT NULL
- created_at — DATETIME(6) — NOT NULL
- updated_at — DATETIME(6) — NOT NULL
refunds
- id — BIGINT
- payment_id — BIGINT — Foreign key → payments.id — NOT NULL
- order_id — BIGINT — Foreign key → orders.id — NOT NULL
- member_id — BIGINT — Foreign key → members.id — NOT NULL
- refund_status — VARCHAR(30) — NOT NULL
- reason — VARCHAR(255) — NOT NULL
- refund_total_amount — BIGINT — NOT NULL
- refund_point_amount — BIGINT — NOT NULL
- refund_pg_amount — BIGINT — NOT NULL
- created_at — DATETIME(6) — NOT NULL
- updated_at — DATETIME(6) — NOT NULL