From 8e97fd6a9f58670c892a1a6656df6db08dcd0992 Mon Sep 17 00:00:00 2001 From: liuyihe <2513762445@qq.com> Date: Tue, 27 Oct 2026 18:30:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/platformOverseasBusiness.test.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/modules/overseas-business/api/platformOverseasBusiness.test.ts b/src/modules/overseas-business/api/platformOverseasBusiness.test.ts index e28a4baa..084ef4e6 100644 --- a/src/modules/overseas-business/api/platformOverseasBusiness.test.ts +++ b/src/modules/overseas-business/api/platformOverseasBusiness.test.ts @@ -36,6 +36,24 @@ const looseboardSummary = { describe('platform overseas business API adapter', () => { beforeEach(() => vi.clearAllMocks()) + it('loads the six-table procurement projection without requiring legacy facts', async () => { + overseas.get.mockResolvedValue(envelope({ + customerView: { order: { ...purchaseSummary, status: 'RECEIVING', version: '1', purchaseQuantity: '10' }, boxes: [], shipments: [], fees: [] }, + purchaseFacts: {}, physical: { dispositions: [], receipts: [], cartons: [] }, + transport: { overseasCargo: [], domesticCargo: [], shipments: [] }, + controls: { notes: [], remaining: [], closures: [], closureItems: [] }, + fees: [], feeCorrections: [], operations: [], actions: [], reviewHistory: [], internalRemark: null, + files: [{ id: '901', fileId: '9007199254740995', sizeBytes: '123' }], + })) + const detail = await getOverseasPurchase('OP-1', '10001') + expect(detail.customerView.order.version).toBe(1) + expect(detail.customerView.order.purchaseQuantity).toBe(10) + expect(detail.files[0]).toMatchObject({ id: '901', fileId: '9007199254740995', sizeBytes: 123 }) + expect(detail.physical.receipts).toEqual([]) + expect(detail.actions).toEqual([]) + expect(overseas.get).toHaveBeenCalledTimes(1) + }) + it('normalizes wire integer strings before building replayable procurement commands', async () => { overseas.get.mockResolvedValue(envelope({ customerView: { order: { ...purchaseSummary, version: '0', purchaseQuantity: '1' }, boxes: [{ quantity: '1' }], shipments: [{ quantity: '1' }], fees: [{ version: '2' }] },