feat(health): 消息推送集成 — 定时任务启动 + 预约提醒事件
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

- erp-server: 启动逾期随访检查(6h)、积分过期(24h)、预约提醒(1h) 定时任务
- appointment_service: 新增 send_reminders 扫描明日确认预约发送事件
- erp-message: 订阅 appointment.reminder 事件,向患者发送提醒消息
This commit is contained in:
iven
2026-04-27 14:51:40 +08:00
parent dc5879228e
commit 13b23e90f4
4 changed files with 109 additions and 2 deletions

View File

@@ -414,8 +414,17 @@ async fn main() -> anyhow::Result<()> {
erp_workflow::WorkflowModule::start_timeout_checker(db.clone(), event_bus.clone());
tracing::info!("Timeout checker started");
// Start follow-up overdue checker (handled by HealthModule::on_startup)
tracing::info!("Follow-up overdue checker delegated to module on_startup");
// Start follow-up overdue checker (every 6h)
erp_health::HealthModule::start_overdue_checker(db.clone());
tracing::info!("Follow-up overdue checker started");
// Start points expiration checker (every 24h)
erp_health::HealthModule::start_points_expiration_checker(db.clone(), event_bus.clone());
tracing::info!("Points expiration checker started");
// Start appointment reminder scheduler (every 1h)
erp_health::HealthModule::start_appointment_reminder(db.clone(), event_bus.clone());
tracing::info!("Appointment reminder scheduler started");
let host = config.server.host.clone();
let port = config.server.port;