改造实时事件缓存同步

This commit is contained in:
yml2213
2026-08-17 17:32:02 +08:00
parent be7c124d65
commit 2aa8769661
16 changed files with 837 additions and 351 deletions
@@ -32,7 +32,7 @@ import {
import { bindKuaishouIndustryVouchersToOrderTasks } from './voucher-binding-service.js'
import { parseAmountToFen } from '../../../utils/money.js'
import {
publishRealtimeEvent,
publishAdminOrderRealtimeChange,
publishWorkOrderRealtimeChange,
} from '../../realtime/realtime-event-service.js'
import type { KuaishouIndustryVoucherRow, OrderRow } from '../../../types/repository/rows.js'
@@ -136,12 +136,7 @@ export async function handleSendCode(rawBody: JsonObject = {}) {
now,
})
if (syncResult.orderId) {
publishRealtimeEvent({
type: 'order.changed',
entityId: syncResult.orderId,
scopes: ['admin_orders'],
admin: true,
})
publishAdminOrderRealtimeChange(syncResult.orderId)
}
for (const workOrderId of syncResult.workOrderIds) {
publishWorkOrderRealtimeChange({ workOrderId })