- 新增 order_checkouts 表,支持结账明细(消耗/押金扣除/退回/号主入账) - 租客发起结账 → 号主确认 → 已完成(正常路径) - 号主修改结账 → 租客确认修正 → 已完成(修正路径) - 结账阶段任一方发起争议 → 后台仲裁 → 已完成/已关闭/异常(争议路径) - 争议模块适配结账争议类型,仲裁结果新增 mark_abnormal - 超时任务适配新的 pending_checkout_confirm 状态 - 前端结账明细面板、发起结账/确认/修正/拒绝表单全部实现 - 移除旧的 SubmitReturn/ConfirmReturn 接口
25 lines
1.1 KiB
SQL
25 lines
1.1 KiB
SQL
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;
|