feat(dialysis): 激活 erp-dialysis 独立模块 — 注册到 erp-server
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled

- workspace Cargo.toml 添加 erp-dialysis 依赖声明
- erp-server 注册 DialysisModule 并挂载透析路由
- 修复权限码:health.health-data.* → health.dialysis.list/manage
- 集成测试迁移:erp_health → erp_dialysis import + DialysisState
- TestApp 新增 dialysis_state() 方法
- cargo check 通过,erp-dialysis 10 个单元测试全部通过
This commit is contained in:
iven
2026-04-28 15:21:13 +08:00
parent 75cd305996
commit 5941a6b764
11 changed files with 81 additions and 47 deletions

View File

@@ -357,6 +357,14 @@ async fn main() -> anyhow::Result<()> {
"Points module initialized"
);
// Initialize dialysis module
let dialysis_module = erp_dialysis::DialysisModule;
tracing::info!(
module = dialysis_module.name(),
version = dialysis_module.version(),
"Dialysis module initialized"
);
// Initialize module registry and register modules
let registry = ModuleRegistry::new()
.register(auth_module)
@@ -365,7 +373,8 @@ async fn main() -> anyhow::Result<()> {
.register(message_module)
.register(health_module)
.register(ai_module)
.register(points_module);
.register(points_module)
.register(dialysis_module);
tracing::info!(
module_count = registry.modules().len(),
"Modules registered"
@@ -545,6 +554,7 @@ async fn main() -> anyhow::Result<()> {
.merge(erp_health::HealthModule::protected_routes())
.merge(erp_ai::AiModule::protected_routes())
.merge(erp_points::PointsModule::protected_routes())
.merge(erp_dialysis::DialysisModule::protected_routes())
.merge(handlers::audit_log::audit_log_router())
.route(
"/upload",

View File

@@ -132,3 +132,14 @@ impl FromRef<AppState> for erp_points::PointsState {
}
}
}
/// Allow erp-dialysis handlers to extract their required state.
impl FromRef<AppState> for erp_dialysis::DialysisState {
fn from_ref(state: &AppState) -> Self {
Self {
db: state.db.clone(),
event_bus: state.event_bus.clone(),
crypto: state.pii_crypto.clone(),
}
}
}