彻底重构-3

This commit is contained in:
yml
2026-04-09 12:24:14 +08:00
parent 606ef875e2
commit 60054adcc4
37 changed files with 1324 additions and 3630 deletions
@@ -64,10 +64,7 @@ export async function ensureFulfillmentCatalogBootstrapped() {
}
}
const configuredBindings = normalizeConfiguredBindings(runtimeConfig.orders?.fulfillmentBindings)
const bindingsToApply = configuredBindings.length > 0
? configuredBindings
: inferDefaultBindingsFromSkuMappings(runtimeConfig.orders?.skuMappings)
const bindingsToApply = normalizeConfiguredBindings(runtimeConfig.orders?.fulfillmentBindings)
for (const binding of bindingsToApply) {
const profile = profileMap[binding.profileKey] || await getFulfillmentProfileByKey(binding.profileKey)
@@ -108,19 +105,3 @@ function normalizeConfiguredBindings(bindings) {
}))
.filter((binding) => binding.skuCode)
}
function inferDefaultBindingsFromSkuMappings(skuMappings) {
const values = Object.values(skuMappings || {})
const uniqueSkuCodes = [...new Set(values.map((value) => String(value || '').trim()).filter(Boolean))]
return uniqueSkuCodes.map((skuCode) => ({
skuCode,
provider: '',
platform: '',
shopId: '',
profileKey: 'tencent_claim_redeem',
enabled: true,
priority: 100,
config: {},
}))
}