From 214fe4ff505604ffb1cf0afe1ecb0ac49f3e8aaa Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Mon, 28 Sep 2026 16:35:40 +0100 Subject: [PATCH] fix(client): preserve tax mode in customs candidates --- src/modules/first-leg/api/unifiedOrders.ts | 4 +++- src/modules/first-leg/store/firstLegOrders.test.mjs | 4 ++++ src/modules/first-leg/store/firstLegOrders.ts | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/modules/first-leg/api/unifiedOrders.ts b/src/modules/first-leg/api/unifiedOrders.ts index d1e3d51..07464d0 100644 --- a/src/modules/first-leg/api/unifiedOrders.ts +++ b/src/modules/first-leg/api/unifiedOrders.ts @@ -1,5 +1,5 @@ import { ApiError, apiRequest } from '@/api/http' -import type { ApiContainerMode, ApiDestinationType, ApiFirstLegStatus, ApiPickupMethod, MerchantFirstLegOrderDetail, PageResult } from '@/modules/first-leg/api/firstLeg' +import type { ApiContainerMode, ApiDestinationType, ApiFirstLegStatus, ApiPickupMethod, ApiTaxMode, MerchantFirstLegOrderDetail, PageResult } from '@/modules/first-leg/api/firstLeg' export type ApiUnifiedOrderMainStatus = | 'PENDING_REVIEW' @@ -83,6 +83,8 @@ export interface MerchantUnifiedOrderRow { actualGrossWeightKg: number | null actualVolumeCbm: number | null pickupMethod: ApiPickupMethod | null + taxMode: ApiTaxMode | null + customsInspection: boolean | null requestedPickupAt: string | null containerMode: ApiContainerMode | null destinationType: ApiDestinationType | null diff --git a/src/modules/first-leg/store/firstLegOrders.test.mjs b/src/modules/first-leg/store/firstLegOrders.test.mjs index 0985d23..37d2c40 100644 --- a/src/modules/first-leg/store/firstLegOrders.test.mjs +++ b/src/modules/first-leg/store/firstLegOrders.test.mjs @@ -107,6 +107,8 @@ test('declares the final C02 row and detail contract in the API adapter', () => 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, /taxMode: ApiTaxMode \| null/) + assert.match(unifiedApiSource, /customsInspection: boolean \| null/) assert.match(unifiedApiSource, /loadingVersion: number/) assert.match(unifiedApiSource, /pickingVersion: number/) assert.match(unifiedApiSource, /summary: MerchantUnifiedOrderRow/) @@ -142,6 +144,8 @@ test('maps C02 authoritative status, transport, cargo and pickup snapshots', () assert.match(storeSource, /id: String\(summary\.orderId\)/) assert.match(storeSource, /transportMode: unifiedTransport\(summary\.containerMode\)/) assert.match(storeSource, /status: summary\.mainStatus/) + assert.match(storeSource, /taxMode: summary\.taxMode \?\? 'BUY_DECLARATION'/) + assert.match(storeSource, /customsInspection: summary\.customsInspection \?\? false/) assert.match(storeSource, /fulfillmentType: summary\.fulfillmentType \?\? 'STANDARD'/) assert.match(storeSource, /lxCode: summary\.lxCode \?\? ''/) assert.match(storeSource, /mapped\.fulfillmentType = detail\.summary\.fulfillmentType \?\? mapped\.fulfillmentType/) diff --git a/src/modules/first-leg/store/firstLegOrders.ts b/src/modules/first-leg/store/firstLegOrders.ts index edd4530..9a498d8 100644 --- a/src/modules/first-leg/store/firstLegOrders.ts +++ b/src/modules/first-leg/store/firstLegOrders.ts @@ -343,7 +343,7 @@ function mapUnifiedOrderRow(summary: MerchantUnifiedOrderRow, warehouses: Platfo createdAt: summary.createdAt, updatedAt: summary.updatedAt, tradeTerm: '', destinationCountryCode: '', destinationWarehouseId: summary.destinationWarehouseId == null ? '' : String(summary.destinationWarehouseId), destinationWarehouseName: summary.destinationWarehouseName ?? '', pickupMethod: summary.pickupMethod ?? 'SELF_EXPRESS', channelCode: '', - channelName: summary.channelName ?? '', pricingTaxMode: 'TAX_INCLUDED', carrierId: '', carrierName: '', taxMode: 'BUY_DECLARATION', customsInspection: false, + channelName: summary.channelName ?? '', pricingTaxMode: 'TAX_INCLUDED', carrierId: '', carrierName: '', taxMode: summary.taxMode ?? 'BUY_DECLARATION', customsInspection: summary.customsInspection ?? false, destinationType: summary.destinationType ?? 'PRIVATE', amazonWarehouseCode: summary.destinationCode ?? '', shipmentId: summary.shipmentId ?? '', requestedPickupAt: summary.requestedPickupAt ?? '', receivingTime: '', submittedAt: '', completedAt: '', }