后端迁移91卡券平台订单服务

This commit is contained in:
yml
2026-05-21 15:55:42 +08:00
parent 5ba95b7a17
commit 711112790e
2 changed files with 12 additions and 5 deletions
@@ -1,5 +1,3 @@
// @ts-check
import { query } from '../../../db/client.js'
import { createOrder, findOrderByPlatformOrderId, getOrderById, updateOrder } from '../../../repositories/order-repo.js'
import { listOrderItemsByOrderId, replaceOrderItems } from '../../../repositories/order-item-repo.js'
@@ -17,7 +15,9 @@ import { nowIso } from '../../../utils/time.js'
export const OPEN_91_PENDING_CONFIG_STATUS = 'pending_config'
export const OPEN_91_MANUAL_FAILED_STATUS = 'manual_failed'
export function buildOpen91SourceEvent(payload = {}, config = {}) {
type JsonObject = Record<string, any>
export function buildOpen91SourceEvent(payload: JsonObject = {}, config: JsonObject = {}) {
const normalized = normalizeOpen91CreatePayload(payload)
const productNo = normalized.productNo
@@ -195,8 +195,7 @@ export async function listOpen91Orders({ page = 1, pageSize = 20, status = 'pend
'o.provider = $1',
'o.platform = $2',
]
/** @type {Array<string | number>} */
const params = [OPEN_91_PROVIDER, OPEN_91_PLATFORM]
const params: Array<string | number> = [OPEN_91_PROVIDER, OPEN_91_PLATFORM]
if (normalizedStatus && normalizedStatus !== 'all') {
params.push(normalizedStatus)