移除核销回调电子凭证类型
This commit is contained in:
@@ -111,7 +111,6 @@ export async function consumeAdminKuaishouIndustryVoucherByCode(input: JsonObjec
|
|||||||
consumeTime: Date.now(),
|
consumeTime: Date.now(),
|
||||||
...(consumeType ? { consumeType } : {}),
|
...(consumeType ? { consumeType } : {}),
|
||||||
...(input.serialNum ? { serialNum: String(input.serialNum).trim() } : {}),
|
...(input.serialNum ? { serialNum: String(input.serialNum).trim() } : {}),
|
||||||
...(input.eticketType ? { eticketType: String(input.eticketType).trim() } : {}),
|
|
||||||
...(input.storeName ? { storeName: String(input.storeName).trim() } : {}),
|
...(input.storeName ? { storeName: String(input.storeName).trim() } : {}),
|
||||||
...(input.storeAddress ? { storeAddress: String(input.storeAddress).trim() } : {}),
|
...(input.storeAddress ? { storeAddress: String(input.storeAddress).trim() } : {}),
|
||||||
...(input.expressCode ? { expressCode: String(input.expressCode).trim() } : {}),
|
...(input.expressCode ? { expressCode: String(input.expressCode).trim() } : {}),
|
||||||
|
|||||||
+4
-2
@@ -3,7 +3,7 @@ import assert from 'node:assert/strict'
|
|||||||
|
|
||||||
import { buildConsumeCallbackBizParams } from './consume-callback-service.js'
|
import { buildConsumeCallbackBizParams } from './consume-callback-service.js'
|
||||||
|
|
||||||
test('buildConsumeCallbackBizParams omits eticket status', () => {
|
test('buildConsumeCallbackBizParams omits unsupported consume fields', () => {
|
||||||
const bizParams = buildConsumeCallbackBizParams({
|
const bizParams = buildConsumeCallbackBizParams({
|
||||||
oid: '2619000086068982',
|
oid: '2619000086068982',
|
||||||
etickets: [{
|
etickets: [{
|
||||||
@@ -14,13 +14,15 @@ test('buildConsumeCallbackBizParams omits eticket status', () => {
|
|||||||
status: 'CONSUMED',
|
status: 'CONSUMED',
|
||||||
consumeType: 'consume',
|
consumeType: 'consume',
|
||||||
consumeTime: 1783596649024,
|
consumeTime: 1783596649024,
|
||||||
|
eticketType: 'DINING_OPEN_TICKET',
|
||||||
token: 'ticket-token',
|
token: 'ticket-token',
|
||||||
seriallNum: 'CONSUME-KSVASXT6Q955WT4SS36',
|
seriallNum: 'CONSUME-KSVASXT6Q955WT4SS36',
|
||||||
})
|
} as any)
|
||||||
|
|
||||||
assert.deepEqual(bizParams.etickets, [{
|
assert.deepEqual(bizParams.etickets, [{
|
||||||
id: 'KSVASXT6Q955WT4SS36',
|
id: 'KSVASXT6Q955WT4SS36',
|
||||||
num: 1,
|
num: 1,
|
||||||
}])
|
}])
|
||||||
assert.equal(bizParams.consumeType, 'consume')
|
assert.equal(bizParams.consumeType, 'consume')
|
||||||
|
assert.equal('eticketType' in bizParams, false)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ export type ConsumeCallbackInput = {
|
|||||||
expressNo?: string
|
expressNo?: string
|
||||||
expressCode?: string
|
expressCode?: string
|
||||||
appointmentTime?: string
|
appointmentTime?: string
|
||||||
eticketType?: string
|
|
||||||
ext?: string
|
ext?: string
|
||||||
token: string
|
token: string
|
||||||
seriallNum?: string
|
seriallNum?: string
|
||||||
@@ -112,7 +111,6 @@ export function buildConsumeCallbackBizParams(input: ConsumeCallbackInput): Json
|
|||||||
if (input.expressNo) bizParams.expressNo = input.expressNo
|
if (input.expressNo) bizParams.expressNo = input.expressNo
|
||||||
if (input.expressCode) bizParams.expressCode = input.expressCode
|
if (input.expressCode) bizParams.expressCode = input.expressCode
|
||||||
if (input.appointmentTime) bizParams.appointmentTime = input.appointmentTime
|
if (input.appointmentTime) bizParams.appointmentTime = input.appointmentTime
|
||||||
if (input.eticketType) bizParams.eticketType = input.eticketType
|
|
||||||
if (input.ext) bizParams.ext = input.ext
|
if (input.ext) bizParams.ext = input.ext
|
||||||
if (input.seriallNum) bizParams.seriallNum = input.seriallNum
|
if (input.seriallNum) bizParams.seriallNum = input.seriallNum
|
||||||
if (input.consumePoiId != null) bizParams.consumePoiId = input.consumePoiId
|
if (input.consumePoiId != null) bizParams.consumePoiId = input.consumePoiId
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ export async function handleConsumeCode(rawBody: JsonObject = {}) {
|
|||||||
const consumed = await consumeKuaishouIndustryVoucher(voucher, {
|
const consumed = await consumeKuaishouIndustryVoucher(voucher, {
|
||||||
source: 'kuaishou_industry_consume_code',
|
source: 'kuaishou_industry_consume_code',
|
||||||
token: params.token,
|
token: params.token,
|
||||||
eticketType: params.eticketType,
|
|
||||||
consumeType: params.consumeType,
|
consumeType: params.consumeType,
|
||||||
consumeTime: params.consumeTime || Date.now(),
|
consumeTime: params.consumeTime || Date.now(),
|
||||||
storeName: params.storeName,
|
storeName: params.storeName,
|
||||||
@@ -107,7 +106,6 @@ export async function handleConsumeCode(rawBody: JsonObject = {}) {
|
|||||||
expressNo: params.expressNo,
|
expressNo: params.expressNo,
|
||||||
expressCode: params.expressCode,
|
expressCode: params.expressCode,
|
||||||
appointmentTime: params.appointmentTime,
|
appointmentTime: params.appointmentTime,
|
||||||
eticketType: params.eticketType,
|
|
||||||
ext: params.ext,
|
ext: params.ext,
|
||||||
token: params.token,
|
token: params.token,
|
||||||
seriallNum: params.seriallNum,
|
seriallNum: params.seriallNum,
|
||||||
|
|||||||
@@ -109,7 +109,6 @@ export async function consumeKuaishouIndustryVouchersForTask(
|
|||||||
input: {
|
input: {
|
||||||
source?: string
|
source?: string
|
||||||
token?: string
|
token?: string
|
||||||
eticketType?: string
|
|
||||||
consumeType?: string
|
consumeType?: string
|
||||||
consumeTime?: number
|
consumeTime?: number
|
||||||
storeName?: string
|
storeName?: string
|
||||||
@@ -130,7 +129,6 @@ export async function consumeKuaishouIndustryVouchersForTask(
|
|||||||
task,
|
task,
|
||||||
}
|
}
|
||||||
if (input.token !== undefined) consumeInput.token = input.token
|
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.storeName !== undefined) consumeInput.storeName = input.storeName
|
||||||
if (input.storeAddress !== undefined) consumeInput.storeAddress = input.storeAddress
|
if (input.storeAddress !== undefined) consumeInput.storeAddress = input.storeAddress
|
||||||
if (input.expressCode !== undefined) consumeInput.expressCode = input.expressCode
|
if (input.expressCode !== undefined) consumeInput.expressCode = input.expressCode
|
||||||
@@ -162,7 +160,6 @@ export async function consumeKuaishouIndustryVoucher(
|
|||||||
input: {
|
input: {
|
||||||
source?: string
|
source?: string
|
||||||
token?: string
|
token?: string
|
||||||
eticketType?: string
|
|
||||||
consumeType?: string
|
consumeType?: string
|
||||||
consumeTime?: number
|
consumeTime?: number
|
||||||
storeName?: string
|
storeName?: string
|
||||||
@@ -235,7 +232,6 @@ export async function consumeKuaishouIndustryVoucher(
|
|||||||
...(input.storeAddress ? { storeAddress: input.storeAddress } : {}),
|
...(input.storeAddress ? { storeAddress: input.storeAddress } : {}),
|
||||||
...(input.expressCode ? { expressCode: input.expressCode } : {}),
|
...(input.expressCode ? { expressCode: input.expressCode } : {}),
|
||||||
...(input.expressNo ? { expressNo: input.expressNo } : {}),
|
...(input.expressNo ? { expressNo: input.expressNo } : {}),
|
||||||
...(input.eticketType ? { eticketType: input.eticketType } : {}),
|
|
||||||
})
|
})
|
||||||
|
|
||||||
if (!callbackResult.success) {
|
if (!callbackResult.success) {
|
||||||
|
|||||||
Reference in New Issue
Block a user