优化(直播履约): 改为订单快照事件驱动
This commit is contained in:
@@ -13,3 +13,20 @@ test('Outbox migration keeps header event id and payload eventId identical', ()
|
||||
assert.match(sql, /CREATE TABLE IF NOT EXISTS integration_outbox/)
|
||||
assert.match(sql, /CREATE TABLE IF NOT EXISTS integration_inbox/)
|
||||
})
|
||||
|
||||
test('订单项快照事件携带定向履约事实和稳定去重键', () => {
|
||||
const sql = readFileSync(
|
||||
new URL('../../db/migrations/172_platform_fulfillment_snapshot_contract.sql', import.meta.url),
|
||||
'utf8',
|
||||
)
|
||||
|
||||
assert.match(sql, /'sourceOrderItemId', oi\.id::text/)
|
||||
assert.match(sql, /'internalSkuKey', cfg\.sku_key/)
|
||||
assert.match(sql, /'orderCreatedAt'/)
|
||||
assert.match(sql, /'paidAt'/)
|
||||
assert.match(sql, /'fulfillmentStatus', f\.status/)
|
||||
assert.match(sql, /md5\(v_snapshot::text/)
|
||||
assert.match(sql, /platform_fulfillment\.order_snapshot/)
|
||||
assert.match(sql, /live_state_version/)
|
||||
assert.doesNotMatch(sql, /LIMIT 500/)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user