移除核销回调电子凭证类型

This commit is contained in:
yml2213
2026-07-09 20:04:00 +08:00
parent 01171c1761
commit a075b8acf7
5 changed files with 4 additions and 11 deletions
@@ -111,7 +111,6 @@ export async function consumeAdminKuaishouIndustryVoucherByCode(input: JsonObjec
consumeTime: Date.now(),
...(consumeType ? { consumeType } : {}),
...(input.serialNum ? { serialNum: String(input.serialNum).trim() } : {}),
...(input.eticketType ? { eticketType: String(input.eticketType).trim() } : {}),
...(input.storeName ? { storeName: String(input.storeName).trim() } : {}),
...(input.storeAddress ? { storeAddress: String(input.storeAddress).trim() } : {}),
...(input.expressCode ? { expressCode: String(input.expressCode).trim() } : {}),
@@ -3,7 +3,7 @@ import assert from 'node:assert/strict'
import { buildConsumeCallbackBizParams } from './consume-callback-service.js'
test('buildConsumeCallbackBizParams omits eticket status', () => {
test('buildConsumeCallbackBizParams omits unsupported consume fields', () => {
const bizParams = buildConsumeCallbackBizParams({
oid: '2619000086068982',
etickets: [{
@@ -14,13 +14,15 @@ test('buildConsumeCallbackBizParams omits eticket status', () => {
status: 'CONSUMED',
consumeType: 'consume',
consumeTime: 1783596649024,
eticketType: 'DINING_OPEN_TICKET',
token: 'ticket-token',
seriallNum: 'CONSUME-KSVASXT6Q955WT4SS36',
})
} as any)
assert.deepEqual(bizParams.etickets, [{
id: 'KSVASXT6Q955WT4SS36',
num: 1,
}])
assert.equal(bizParams.consumeType, 'consume')
assert.equal('eticketType' in bizParams, false)
})
@@ -18,7 +18,6 @@ export type ConsumeCallbackInput = {
expressNo?: string
expressCode?: string
appointmentTime?: string
eticketType?: string
ext?: string
token: string
seriallNum?: string
@@ -112,7 +111,6 @@ export function buildConsumeCallbackBizParams(input: ConsumeCallbackInput): Json
if (input.expressNo) bizParams.expressNo = input.expressNo
if (input.expressCode) bizParams.expressCode = input.expressCode
if (input.appointmentTime) bizParams.appointmentTime = input.appointmentTime
if (input.eticketType) bizParams.eticketType = input.eticketType
if (input.ext) bizParams.ext = input.ext
if (input.seriallNum) bizParams.seriallNum = input.seriallNum
if (input.consumePoiId != null) bizParams.consumePoiId = input.consumePoiId
@@ -47,7 +47,6 @@ export async function handleConsumeCode(rawBody: JsonObject = {}) {
const consumed = await consumeKuaishouIndustryVoucher(voucher, {
source: 'kuaishou_industry_consume_code',
token: params.token,
eticketType: params.eticketType,
consumeType: params.consumeType,
consumeTime: params.consumeTime || Date.now(),
storeName: params.storeName,
@@ -107,7 +106,6 @@ export async function handleConsumeCode(rawBody: JsonObject = {}) {
expressNo: params.expressNo,
expressCode: params.expressCode,
appointmentTime: params.appointmentTime,
eticketType: params.eticketType,
ext: params.ext,
token: params.token,
seriallNum: params.seriallNum,
@@ -109,7 +109,6 @@ export async function consumeKuaishouIndustryVouchersForTask(
input: {
source?: string
token?: string
eticketType?: string
consumeType?: string
consumeTime?: number
storeName?: string
@@ -130,7 +129,6 @@ export async function consumeKuaishouIndustryVouchersForTask(
task,
}
if (input.token !== undefined) consumeInput.token = input.token
if (input.eticketType !== undefined) consumeInput.eticketType = input.eticketType
if (input.storeName !== undefined) consumeInput.storeName = input.storeName
if (input.storeAddress !== undefined) consumeInput.storeAddress = input.storeAddress
if (input.expressCode !== undefined) consumeInput.expressCode = input.expressCode
@@ -162,7 +160,6 @@ export async function consumeKuaishouIndustryVoucher(
input: {
source?: string
token?: string
eticketType?: string
consumeType?: string
consumeTime?: number
storeName?: string
@@ -235,7 +232,6 @@ export async function consumeKuaishouIndustryVoucher(
...(input.storeAddress ? { storeAddress: input.storeAddress } : {}),
...(input.expressCode ? { expressCode: input.expressCode } : {}),
...(input.expressNo ? { expressNo: input.expressNo } : {}),
...(input.eticketType ? { eticketType: input.eticketType } : {}),
})
if (!callbackResult.success) {