From 2dbb2140068fedd188df527f1c4620fe5ea1187b Mon Sep 17 00:00:00 2001 From: WuYongJie Date: Fri, 4 Sep 2026 17:59:40 +0800 Subject: [PATCH] fix(intake): move import rowNumber off the shared sku export row type the optional numeric rowNumber on NonIntegratedSkuExportRow broke the dynamic template column writes (string vs never) in the production build type check; import rows now use a dedicated NonIntegratedSkuImportRow type that extends the export row with a required rowNumber. --- .../src/lib/non-integrated-sku-export.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/furniture-3d-system/src/lib/non-integrated-sku-export.ts b/furniture-3d-system/src/lib/non-integrated-sku-export.ts index f75a8af6..60a20baa 100644 --- a/furniture-3d-system/src/lib/non-integrated-sku-export.ts +++ b/furniture-3d-system/src/lib/non-integrated-sku-export.ts @@ -24,12 +24,15 @@ export type NonIntegratedSkuExportRow = { batchNo: string batchChangeType: string dingTalkFlowNo: string - rowNumber?: number +} + +export type NonIntegratedSkuImportRow = NonIntegratedSkuExportRow & { + rowNumber: number } export function findSkuImportSpuPrefixErrors( rows: ReadonlyArray< - Pick & { rowNumber?: number } + Pick >, spu: string, ) { @@ -65,7 +68,7 @@ export type NonIntegratedSkuFuzzyImportRow = { export type NonIntegratedSkuWorkbookImport = | { mode: "standard" - rows: NonIntegratedSkuExportRow[] + rows: NonIntegratedSkuImportRow[] sheetName: string } | { @@ -389,7 +392,7 @@ export async function parseNonIntegratedSkuWorkbook( if (missingLabels.length === 0) { const rows = sheetRows .slice(headerRowIndex + 1) - .map((row, index) => { + .map((row, index): NonIntegratedSkuImportRow => { const importRow = createEmptyImportRow() for (const column of NON_INTEGRATED_SKU_TEMPLATE_COLUMNS) { const cellIndex = headerIndexByLabel.get(column.label) @@ -398,8 +401,7 @@ export async function parseNonIntegratedSkuWorkbook( ? '' : normalizeWorkbookCellValue(row[cellIndex]) } - importRow.rowNumber = headerRowIndex + index + 2 - return importRow + return { ...importRow, rowNumber: headerRowIndex + index + 2 } }) .filter((row) => NON_INTEGRATED_SKU_TEMPLATE_COLUMNS.some(