优化
This commit is contained in:
@@ -71,6 +71,9 @@ test('declares the final C02 row and detail contract in the API adapter', () =>
|
||||
assert.match(unifiedApiSource, /mainStatus: ApiUnifiedOrderMainStatus/)
|
||||
assert.match(unifiedApiSource, /nextAction: string \| null/)
|
||||
assert.match(unifiedApiSource, /customerRemark: string \| null/)
|
||||
for (const field of ['pickupMethod', 'requestedPickupAt', 'containerMode', 'destinationType', 'destinationCode', 'skuNos', 'totalQuantity', 'totalNetWeightKg', 'chargeableVolumeCbm', 'inboundCompletedAt', 'shipmentId', 'referenceId']) {
|
||||
assert.match(unifiedApiSource, new RegExp(`${field}:`))
|
||||
}
|
||||
assert.match(unifiedApiSource, /loadingVersion: number/)
|
||||
assert.match(unifiedApiSource, /pickingVersion: number/)
|
||||
assert.match(unifiedApiSource, /summary: MerchantUnifiedOrderRow/)
|
||||
@@ -99,9 +102,16 @@ test('routes supported filters to C02 without sending DRAFT as a main status', (
|
||||
assert.match(storeSource, /getMerchantUnifiedOrders\(unifiedQuery\)/)
|
||||
})
|
||||
|
||||
test('maps C02 rows by orderId and leaves absent transport details unknown', () => {
|
||||
test('maps C02 authoritative status, transport, cargo and pickup snapshots', () => {
|
||||
assert.match(storeSource, /id: String\(summary\.orderId\)/)
|
||||
assert.match(storeSource, /transportMode: null/)
|
||||
assert.match(storeSource, /transportMode: unifiedTransport\(summary\.containerMode\)/)
|
||||
assert.match(storeSource, /status: summary\.mainStatus/)
|
||||
assert.match(storeSource, /requestedPickupAt: summary\.requestedPickupAt \?\? ''/)
|
||||
assert.match(storeSource, /chargeableVolumeCbm: summary\.chargeableVolumeCbm \?\? null/)
|
||||
assert.match(storeSource, /inboundedAt: summary\.inboundCompletedAt \?\? ''/)
|
||||
assert.match(storeSource, /pickupMethod: summary\.pickupMethod \?\? 'SELF_EXPRESS'/)
|
||||
assert.match(storeSource, /destinationType: summary\.destinationType \?\? 'PRIVATE'/)
|
||||
assert.match(storeSource, /mapped\.requestedPickupAt = summary\.requestedPickupAt/)
|
||||
assert.match(storeSource, /summary\?\.loading\?\.loadingVersion/)
|
||||
assert.match(storeSource, /summary\?\.loading\?\.pickingVersion/)
|
||||
assert.match(storeSource, /summary\?\.inboundId == null \? '' : String\(summary\.inboundId\)/)
|
||||
|
||||
Reference in New Issue
Block a user