后端迁移91卡券平台订单服务
This commit is contained in:
+4
-5
@@ -1,5 +1,3 @@
|
|||||||
// @ts-check
|
|
||||||
|
|
||||||
import { query } from '../../../db/client.js'
|
import { query } from '../../../db/client.js'
|
||||||
import { createOrder, findOrderByPlatformOrderId, getOrderById, updateOrder } from '../../../repositories/order-repo.js'
|
import { createOrder, findOrderByPlatformOrderId, getOrderById, updateOrder } from '../../../repositories/order-repo.js'
|
||||||
import { listOrderItemsByOrderId, replaceOrderItems } from '../../../repositories/order-item-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_PENDING_CONFIG_STATUS = 'pending_config'
|
||||||
export const OPEN_91_MANUAL_FAILED_STATUS = 'manual_failed'
|
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 normalized = normalizeOpen91CreatePayload(payload)
|
||||||
const productNo = normalized.productNo
|
const productNo = normalized.productNo
|
||||||
|
|
||||||
@@ -195,8 +195,7 @@ export async function listOpen91Orders({ page = 1, pageSize = 20, status = 'pend
|
|||||||
'o.provider = $1',
|
'o.provider = $1',
|
||||||
'o.platform = $2',
|
'o.platform = $2',
|
||||||
]
|
]
|
||||||
/** @type {Array<string | number>} */
|
const params: Array<string | number> = [OPEN_91_PROVIDER, OPEN_91_PLATFORM]
|
||||||
const params = [OPEN_91_PROVIDER, OPEN_91_PLATFORM]
|
|
||||||
|
|
||||||
if (normalizedStatus && normalizedStatus !== 'all') {
|
if (normalizedStatus && normalizedStatus !== 'all') {
|
||||||
params.push(normalizedStatus)
|
params.push(normalizedStatus)
|
||||||
@@ -562,6 +562,14 @@
|
|||||||
- `npm run typecheck`
|
- `npm run typecheck`
|
||||||
- `npm run build`
|
- `npm run build`
|
||||||
- `npm test` 共 139 个用例通过
|
- `npm test` 共 139 个用例通过
|
||||||
|
129. 91卡券平台订单服务迁移到 `.ts`:
|
||||||
|
- `src/services/platforms/ninetyone/order-service.ts`
|
||||||
|
130. 91 卡券 source event 构造、待补配置订单落库、后台重试 / 手动失败、后台订单列表映射已进入 TS 编译链路;动态 payload / config 与 SQL 参数数组补齐类型
|
||||||
|
131. Docker 内验证通过:
|
||||||
|
- `src/services/platforms/ninetyone/order-service.test.js`、`src/services/open-91/shared.test.js` 共 7 个用例通过
|
||||||
|
- `npm run typecheck`
|
||||||
|
- `npm run build`
|
||||||
|
- `npm test` 共 139 个用例通过
|
||||||
|
|
||||||
## 下一步建议
|
## 下一步建议
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user