yml2213
fcd9b607d4
refactor(cost-center): 共享层按职责拆为四个模块
cost-center-shared.ts 804 行同时装枚举、行类型、映射、归一化,任何一处改动都会
让 8 个引用方重新编译。按职责拆开,本文件退化为统一出口(export *):
- cost-center-constants.ts 131 枚举、常量、SQL 片段
- cost-center-types.ts 220 行结构与 DTO 类型
- cost-center-mappers.ts 250 行映射与口径判断(含 CostPreview)
- cost-center-normalizers.ts 254 入参归一化与断言
同时消掉一个类型环:CostPreview 用 ReturnType<typeof mapProduct> 反推 mapper 的
返回类型,导致 types → mappers → types 互指;CostPreview 随 mapper 一起放进
mappers,依赖恢复单向。
出口保持向后兼容,8 个引用方无需改动;71 个导出逐一比对无缺失。
验证:typecheck / lint / 773 测试通过。
2026-10-25 12:02:36 +08:00
..
2026-10-25 12:02:36 +08:00
2026-10-22 10:04:05 +08:00
2026-09-19 11:06:32 +08:00
2026-10-25 11:14:12 +08:00