fix(intake): restore structured sku sales status normalization
This commit is contained in:
parent
21572d3377
commit
2ccb52e75b
@ -4100,12 +4100,31 @@ const DEFAULT_ASSET_VARIANT_EXECUTE_STANDARD = 'GB/T3324-2024'
|
||||
const DEFAULT_STEEL_ASSET_VARIANT_EXECUTE_STANDARD = 'GB/T3325-2024'
|
||||
const DEFAULT_ASSET_VARIANT_NATIONAL_STANDARD_COMPLIANT = '是'
|
||||
const DEFAULT_ASSET_VARIANT_SALES_STATUS = '销售'
|
||||
const JST_SKU_SALES_STATUSES = new Set(['销售', '停产', '退市'])
|
||||
|
||||
function normalizeSkuSalesStatusText(value: string | null | undefined) {
|
||||
const normalizedValue = value?.trim() ?? ''
|
||||
return normalizedValue || DEFAULT_ASSET_VARIANT_SALES_STATUS
|
||||
}
|
||||
|
||||
function normalizeStructuredSkuSalesStatusText(params: {
|
||||
value: string | null | undefined
|
||||
source?: string | null
|
||||
sourceTable?: string | null
|
||||
}) {
|
||||
const normalizedValue = params.value?.trim() ?? ''
|
||||
const isJstSkuSource = [params.source, params.sourceTable].some((value) => {
|
||||
const normalizedSource = value?.trim().toLowerCase().replace(/-/g, '_') ?? ''
|
||||
return normalizedSource === 'jst_sku' || normalizedSource === 'jstsku'
|
||||
})
|
||||
|
||||
if (isJstSkuSource) {
|
||||
return JST_SKU_SALES_STATUSES.has(normalizedValue) ? normalizedValue : ''
|
||||
}
|
||||
|
||||
return normalizeSkuSalesStatusText(normalizedValue)
|
||||
}
|
||||
|
||||
function isWorkspaceConfirmationNewlyEnabled(
|
||||
existingProduct: SharedNonIntegratedProductRecord,
|
||||
nextProduct: SharedNonIntegratedProductRecord,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user