diff --git a/apps/backend/src/services/bootstrap/fulfillment-bootstrap-service.js b/apps/backend/src/services/bootstrap/fulfillment-bootstrap-service.ts similarity index 96% rename from apps/backend/src/services/bootstrap/fulfillment-bootstrap-service.js rename to apps/backend/src/services/bootstrap/fulfillment-bootstrap-service.ts index 857872db..8779d538 100644 --- a/apps/backend/src/services/bootstrap/fulfillment-bootstrap-service.js +++ b/apps/backend/src/services/bootstrap/fulfillment-bootstrap-service.ts @@ -68,6 +68,8 @@ const CORE_PROFILES = [ }, ] +type JsonObject = Record + 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') { diff --git a/docs/backend-typescript-migration-plan.md b/docs/backend-typescript-migration-plan.md index cde9f089..77900880 100644 --- a/docs/backend-typescript-migration-plan.md +++ b/docs/backend-typescript-migration-plan.md @@ -570,6 +570,14 @@ - `npm run typecheck` - `npm run build` - `npm test` 共 139 个用例通过 +132. 履约目录初始化服务迁移到 `.ts`: + - `src/services/bootstrap/fulfillment-bootstrap-service.ts` +133. 核心履约 profile 初始化、配置绑定同步、SKU 绑定与商品匹配规则重建已进入 TS 编译链路;profileMap、binding 与运行时 config 补齐动态对象类型 +134. Docker 内验证通过: + - `src/services/bootstrap/fulfillment-bootstrap-service.test.js` 共 2 个用例通过 + - `npm run typecheck` + - `npm run build` + - `npm test` 共 139 个用例通过 ## 下一步建议