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
@@ -159,6 +159,12 @@ test('海外空库基线为固定平台管理员提供完整version0授权投影
assert.equal(inline.replace(/\r\n/g, '\n').trim(), lastlegBaseline.replace(/\r\n/g, '\n').trim())
})
test('当前海外基线不从废弃申请回填历史尾程订单', () => {
for (const source of [lastlegBaseline, overseasSql]) {
assert.doesNotMatch(source, /INSERT IGNORE INTO ll_order\s*\([\s\S]*?SELECT a\.id,a\.discard_no/)
}
})
test('国内统一初始化补齐入库费用人工调整基线字段', () => {
assert.match(sql, /baseline_chargeable_quantity DECIMAL\(18,6\) NOT NULL/)
assert.match(sql, /SET baseline_chargeable_quantity = chargeable_quantity[\s\S]*?WHERE baseline_chargeable_quantity IS NULL/)
@@ -44,7 +44,7 @@ test('backend never appends a generic STATUS_UPDATE and current operation replay
assert.match(smartLoadingTest, /void replaysBeforeVersionCheck\(\)/)
assert.match(smartLoadingTest, /void exactWarehouseRemarkReplayIsReadOnly\(\)/)
assert.match(smartLoadingTest, /replaysBeforeVersionCheck[\s\S]{0,1200}verify\(repository, never\(\)\)\.candidate/)
assert.match(smartLoadingTest, /exactWarehouseRemarkReplayIsReadOnly[\s\S]{0,1200}verify\(repository, never\(\)\)\.updateWarehouseRemark/)
assert.match(smartLoadingTest, /exactWarehouseRemarkReplayIsReadOnly[\s\S]{0,1200}verify\(repository, never\(\)\)\.updateRemarks/)
})
test('operationId is projected end-to-end for identity-based frontend deduplication', () => {
@@ -14,10 +14,17 @@ test('manual matrix retains only DRAFT and RELEASED ocean booking states', () =>
test('truck matrix remains independent while retaining its own lifecycle', () => {
for (const status of ['DRAFT', 'PENDING_DISPATCH', 'DISPATCHED', 'PICKUP_IN_PROGRESS',
'ARRIVED_WAREHOUSE', 'LOADING', 'DEPARTED', 'COMPLETED', 'RESCHEDULED', 'EXCEPTION', 'CANCELLED']) {
'ARRIVED_WAREHOUSE', 'LOADING', 'RESCHEDULED', 'EXCEPTION', 'CANCELLED']) {
assert.match(source, new RegExp(`['\"]${status}['\"]`))
}
assert.match(source, /page=1&size=100&status=/)
assert.match(source, /category=TRUCKING&status=ACTIVE/)
assert.match(source, /carrierId: id\(carrier\.id\), carrierName: carrier\.name/)
const completion = readFileSync(new URL('../../firstleg/src/main/java/com/baiyue/firstleg/service/TruckAppointmentCompletionService.java', import.meta.url), 'utf8')
const statuses = readFileSync(new URL('../../firstleg/src/main/java/com/baiyue/firstleg/domain/TruckAppointmentStatus.java', import.meta.url), 'utf8')
assert.doesNotMatch(statuses, /\bDEPARTED\b/)
assert.match(statuses, /\bCOMPLETED\b/)
assert.match(completion, /if \(!allDeparted\(rows\)\) return/)
assert.match(completion, /history\.setAction\("AUTO_COMPLETE"\)/)
assert.match(completion, /history\.setToStatus\("COMPLETED"\)/)
})