修复bug

This commit is contained in:
2026-07-31 15:34:22 +08:00
parent 151d76f77c
commit be7675954a
25 changed files with 224 additions and 204 deletions
+16 -5
View File
@@ -1,6 +1,6 @@
import assert from 'node:assert/strict'
import test from 'node:test'
import { createFirstLegPartySnapshot, DEMO_FIRST_LEG_PARTIES } from '../data/firstLegParties.ts'
import { createFirstLegPartySnapshot } from '../data/firstLegParties.ts'
import {
canClientCancelFirstLegOrder,
canClientEditFirstLegOrder,
@@ -11,6 +11,17 @@ import {
validateFirstLegOrderDraft,
} from './firstLegOrder.ts'
const shipperParty = {
id: 'CP001', code: 'SHIPPER-001', name: '测试发货企业', roles: ['SHIPPER'], contactName: '测试联系人',
phone: '13800000000', email: 'shipper@example.test', countryRegion: '中国', province: '浙江省', city: '宁波市',
postalCode: '315000', address: '测试发货地址', status: 'ACTIVE',
}
const consigneeParty = {
id: 'CP002', code: 'CONSIGNEE-001', name: 'TEST CONSIGNEE LLC', roles: ['CONSIGNEE'], contactName: 'Test Receiver',
phone: '+1 555 0100', email: 'receiver@example.test', countryRegion: '美国', province: 'California', city: 'Los Angeles',
postalCode: '90001', address: '100 Test Logistics Ave', status: 'ACTIVE',
}
function validDraft() {
return {
referenceNo: 'REF-001',
@@ -21,11 +32,11 @@ function validDraft() {
receivingWarehouseId: 'WH005',
expectedDepartureDate: '2026-08-08',
shipperPartyId: 'CP001',
shipperPartySnapshot: createFirstLegPartySnapshot(DEMO_FIRST_LEG_PARTIES[0], 'SHIPPER'),
shipper: '示例贸易有限公司',
shipperPartySnapshot: createFirstLegPartySnapshot(shipperParty, 'SHIPPER'),
shipper: shipperParty.name,
consigneePartyId: 'CP003',
consigneePartySnapshot: createFirstLegPartySnapshot(DEMO_FIRST_LEG_PARTIES[2], 'CONSIGNEE'),
consignee: 'DEMO GLOBAL LLC',
consigneePartySnapshot: createFirstLegPartySnapshot(consigneeParty, 'CONSIGNEE'),
consignee: consigneeParty.name,
priority: 'NORMAL',
customerRemark: '',
tradeTerm: 'FOB',