feat(lastleg): redispatch returned cargo and reconcile source signatures
This commit is contained in:
@@ -9,7 +9,7 @@ const domesticSchemas = ['baiyue_auth', 'baiyue_iam', 'baiyue_order', 'baiyue_wa
|
||||
const overseasSchemas = ['baiyue_lastleg', 'baiyue_lastlag_warehouse']
|
||||
|
||||
test('两个入口分别只操作八个主业务库与两个仓储业务库,包括限定名引用', () => {
|
||||
for (const [sql, allowed, other, count] of [[cn, domesticSchemas, overseasSchemas, 226], [overseas, overseasSchemas, domesticSchemas, 152]]) {
|
||||
for (const [sql, allowed, other, count] of [[cn, domesticSchemas, overseasSchemas, 226], [overseas, overseasSchemas, domesticSchemas, 153]]) {
|
||||
assert.deepEqual([...sql.matchAll(/^CREATE DATABASE IF NOT EXISTS (\w+)/gm)].map(m => m[1]), allowed)
|
||||
assert.deepEqual([...new Set([...sql.matchAll(/^USE (\w+);/gm)].map(m => m[1]))], allowed)
|
||||
const body = sql.replace(/^--.*$/gm, '')
|
||||
@@ -28,7 +28,7 @@ test('纯初始化禁止迁移、数据回填、清理、重复建表和提前
|
||||
assert.doesNotMatch(body.replace(/^CREATE TRIGGER [\s\S]*?\$\$/gm, ''), /^\s*(?:UPDATE|DELETE FROM|REPLACE INTO)\b/gmi)
|
||||
assert.doesNotMatch(body, /CREATE TABLE IF NOT EXISTS/i)
|
||||
assert.equal((body.match(/AS initialization_status/g) ?? []).length, 1)
|
||||
assert.match(body.trim(), /SELECT 'PASS' AS initialization_status, '(CN|OVERSEAS)' AS region, (226|152) AS initialized_tables;$/)
|
||||
assert.match(body.trim(), /SELECT 'PASS' AS initialization_status, '(CN|OVERSEAS)' AS region, (226|153) AS initialized_tables;$/)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -44,6 +44,19 @@ test('车次直接成本按车次幂等并保留独立币种与不可变更正
|
||||
assert.match(history, /snapshot_json JSON NOT NULL/i)
|
||||
})
|
||||
|
||||
test('退回实收按真实流水唯一保存,重派拣货必须明确唯一来源', () => {
|
||||
const receipt = table(overseas, 'baiyue_lastleg', 'll_return_stock_receipt')
|
||||
assert.match(receipt, /UNIQUE KEY uk_return_stock_receipt_ledger\(customer_id,inventory_ledger_id\)/i)
|
||||
assert.match(receipt, /UNIQUE KEY uk_return_stock_receipt_no\(customer_id,receipt_no\)/i)
|
||||
assert.match(receipt, /CHECK\(received_packages>0\)/i)
|
||||
for (const name of ['ll_dispatch_item', 'll_dispatch_pallet_lock', 'll_dispatch_pda_pick_order']) {
|
||||
assert.match(table(overseas, 'baiyue_lastleg', name), /return_receipt_id BIGINT NULL/i)
|
||||
}
|
||||
const pick = table(overseas, 'baiyue_lastleg', 'll_dispatch_pda_pick_order')
|
||||
assert.match(pick, /\breceipt_id BIGINT NULL/i)
|
||||
assert.match(pick, /CHECK\(\(receipt_id IS NOT NULL AND return_receipt_id IS NULL\) OR \(receipt_id IS NULL AND return_receipt_id IS NOT NULL\)\)/i)
|
||||
})
|
||||
|
||||
test('车辆报价与实测记录保留业务去重和不可变版本', () => {
|
||||
const booking = table(overseas, 'baiyue_lastleg', 'll_fleet_external_booking')
|
||||
assert.match(booking, /quote_source_json JSON NULL/i)
|
||||
|
||||
Reference in New Issue
Block a user