test: synchronize initialization and dependency contracts

This commit is contained in:
2026-09-15 14:58:26 +08:00
parent c65389b2c2
commit 7edea222d8
9 changed files with 49 additions and 25 deletions
@@ -1959,20 +1959,6 @@ CREATE TABLE IF NOT EXISTS ll_cargo_discard_status_history (
KEY idx_ll_cargo_discard_history(customer_id,application_id,created_at)
) ENGINE=InnoDB COMMENT='货物废弃审批历史';
-- Backfill applications created before cargo discard became a first-class tail-leg order.
INSERT IGNORE INTO ll_order (
id,order_no,customer_id,order_type,inbound_code,inbound_order_no,source_region,source_inbound_id,
source_order_id,source_order_no,overseas_warehouse_id,overseas_warehouse_name,package_count,
current_status,version,source_event_id,source_loading_plan_id,source_payload_hash,created_at,updated_at
)
SELECT a.id,a.discard_no,a.customer_id,'CARGO_DISCARD',a.inbound_codes,a.discard_no,'LASTLEG_DISCARD',
CONCAT('CARGO_DISCARD:',a.id),CAST(a.id AS CHAR),a.discard_no,a.overseas_warehouse_id,a.overseas_warehouse_name,
a.total_packages,a.status,0,CONCAT('CARGO_DISCARD:',a.id),'CARGO_DISCARD',a.request_hash,a.created_at,a.updated_at
FROM ll_cargo_discard_application a
LEFT JOIN ll_order o ON o.customer_id=a.customer_id AND o.source_region='LASTLEG_DISCARD'
AND o.source_inbound_id=CONCAT('CARGO_DISCARD:',a.id)
WHERE o.id IS NULL;
CREATE TABLE IF NOT EXISTS ll_overseas_procurement_order (
id BIGINT NOT NULL COMMENT '主键ID', customer_id VARCHAR(128) NOT NULL COMMENT '客户租户ID',
customer_name VARCHAR(255) NULL COMMENT '客户名称快照', order_no VARCHAR(64) NOT NULL COMMENT '订单号',