接入订单结账确认流程

This commit is contained in:
yml
2026-05-24 16:52:15 +08:00
parent 1693ee3167
commit 03e5d211dc
13 changed files with 818 additions and 124 deletions
@@ -18,3 +18,28 @@ DEALLOCATE PREPARE add_listing_in_transaction_stmt;
INSERT INTO system_configs (`key`, `value`, description)
VALUES ('order.pending_payment_timeout_minutes', '15', '订单待支付超时取消分钟数')
ON DUPLICATE KEY UPDATE `key` = VALUES(`key`);
CREATE TABLE IF NOT EXISTS order_checkouts (
id BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
order_id BIGINT UNSIGNED NOT NULL,
initiated_by BIGINT UNSIGNED NOT NULL,
status VARCHAR(32) NOT NULL DEFAULT 'submitted',
rent_amount DECIMAL(12,2) NOT NULL DEFAULT 0.00,
deposit_amount DECIMAL(12,2) NOT NULL DEFAULT 0.00,
consumable_amount DECIMAL(12,2) NOT NULL DEFAULT 0.00,
coin_consumed_m DECIMAL(12,2) NOT NULL DEFAULT 0.00,
other_amount DECIMAL(12,2) NOT NULL DEFAULT 0.00,
deposit_deduct_amount DECIMAL(12,2) NOT NULL DEFAULT 0.00,
renter_refund_amount DECIMAL(12,2) NOT NULL DEFAULT 0.00,
owner_income_amount DECIMAL(12,2) NOT NULL DEFAULT 0.00,
content TEXT NULL,
evidence_urls JSON NULL,
owner_adjustment_reason TEXT NULL,
owner_adjusted_at DATETIME NULL,
renter_confirmed_at DATETIME NULL,
renter_rejected_at DATETIME NULL,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
KEY idx_order_checkouts_order_id (order_id),
KEY idx_order_checkouts_status (status)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;