后端迁移履约初始化服务

This commit is contained in:
yml
2026-05-21 15:57:52 +08:00
parent 711112790e
commit ed659ea232
2 changed files with 13 additions and 3 deletions
@@ -68,6 +68,8 @@ const CORE_PROFILES = [
},
]
type JsonObject = Record<string, any>
export async function ensureFulfillmentCatalogBootstrapped() {
const profileMap = await ensureCoreProfiles()
await syncConfiguredFulfillmentBindings(profileMap)
@@ -104,7 +106,7 @@ async function ensureCoreProfiles() {
return profileMap
}
export async function syncConfiguredFulfillmentBindings(profileMap = {}) {
export async function syncConfiguredFulfillmentBindings(profileMap: JsonObject = {}) {
const timestamp = nowIso()
const bindingsToApply = [
...getLegacyOrderFulfillmentBindingConfigs(),
@@ -164,11 +166,11 @@ export async function syncConfiguredFulfillmentBindings(profileMap = {}) {
}
}
export function resolveBindingMatchShopIds(binding = {}) {
export function resolveBindingMatchShopIds(binding: JsonObject = {}) {
return [String(binding.shopId || '').trim()]
}
function resolveBindingRuntimeConfig(binding = {}) {
function resolveBindingRuntimeConfig(binding: JsonObject = {}) {
const baseConfig = isPlainObject(binding.config) ? { ...binding.config } : {}
if (String(binding.provider || '').trim() === '91kaquan' && String(binding.platform || '').trim() === 'kuaishou') {