asd
Tables (5)
orders
- id — BIGINT
- user_id — BIGINT — NOT NULL
- order_number — VARCHAR(64) — NOT NULL
- total_amount — BIGINT — NOT NULL
- status — ENUM('PAYMENT_COMPLETED', 'CANCELLED', 'PARTIAL_REFUND', 'FULL_REFUND', 'FAILED') — NOT NULL
- payment_method — ENUM('CARD', 'EASY_PAY') — NOT NULL
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME
payment_history
- id — BIGINT
- order_id — BIGINT — NOT NULL
- pg_provider — ENUM('HECTO', 'SMARTRO') — NOT NULL
- event_type — ENUM('PAYMENT', 'REFUND') — NOT NULL
- status — ENUM('IN_PROGRESS', 'SUCCESS', 'FAILED', 'CANCELLED', 'EXPIRED') — NOT NULL
- amount — BIGINT — NOT NULL
- tid — VARCHAR(128)
- reason — TEXT
- response_json — JSON
- created_at — DATETIME — NOT NULL
product_order
- id — BIGINT
- order_id — BIGINT — NOT NULL
- product_id — BIGINT — NOT NULL
- product_name — VARCHAR(255) — NOT NULL
- unit_price — BIGINT — NOT NULL
- quantity — INT — NOT NULL
- status — ENUM('READY', 'USED', 'REFUNDED', 'CANCELLED') — NOT NULL
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME
product_unit
- id — BIGINT
- product_order_id — BIGINT — NOT NULL
- serial_no — VARCHAR(64) — NOT NULL
- status — ENUM('READY', 'USED', 'REFUNDED', 'EXPIRED') — NOT NULL
- activated_at — DATETIME
- refunded_at — DATETIME
refund_product_unit
- id — BIGINT
- payment_history_id — BIGINT — NOT NULL
- product_unit_id — BIGINT — NOT NULL
- refunded_amount — BIGINT — NOT NULL
- refunded_at — DATETIME — NOT NULL