优化核销展示
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
listKuaishouIndustryVouchersForAdmin,
|
||||
updateKuaishouIndustryVoucherByCode,
|
||||
type KuaishouIndustryVoucherAdminListQuery,
|
||||
type KuaishouIndustryVoucherAdminListRow,
|
||||
} from '../../repositories/kuaishou-industry-voucher-repo.js'
|
||||
import { getOrderById } from '../../repositories/order-repo.js'
|
||||
import { getTaskById } from '../../repositories/task-repo.js'
|
||||
@@ -395,19 +396,23 @@ function sanitizeOpenApiRequest(request: JsonObject | undefined): JsonObject | n
|
||||
}
|
||||
|
||||
function mapAdminKuaishouIndustryVoucher(
|
||||
voucher: KuaishouIndustryVoucherRow,
|
||||
voucher: KuaishouIndustryVoucherRow | KuaishouIndustryVoucherAdminListRow,
|
||||
shopNameBySellerId: Map<string, string> = buildKuaishouIndustryShopNameMap(),
|
||||
) {
|
||||
const sellerId = String(voucher.seller_id || '').trim()
|
||||
const listRow = voucher as KuaishouIndustryVoucherAdminListRow
|
||||
return {
|
||||
id: voucher.id,
|
||||
voucherCode: voucher.voucher_code,
|
||||
oid: voucher.oid,
|
||||
orderId: voucher.order_id,
|
||||
taskId: voucher.task_id,
|
||||
taskNo: String(listRow.task_no || '').trim(),
|
||||
unitIndex: voucher.unit_index,
|
||||
sellerId,
|
||||
shopName: shopNameBySellerId.get(sellerId) || '',
|
||||
skuCode: String(listRow.sku_code || '').trim(),
|
||||
skuName: String(listRow.sku_name || '').trim(),
|
||||
tokenMasked: maskSecret(voucher.token),
|
||||
status: voucher.status,
|
||||
validStartTime: Number(voucher.valid_start_time || 0) || 0,
|
||||
|
||||
Reference in New Issue
Block a user