feat(health): 积分触发扩展 + 随访模板关联 — Phase 3

- 新增 follow_up.completed 事件积分消费者,随访完成触发 30 积分
- follow_up_task 新增 template_id FK 关联随访模板
- follow_up_record 新增 form_data JSONB 存储结构化表单数据
- 新增 POST /health/follow-up-tasks/from-template 基于模板创建随访任务端点
- 数据库迁移 160:follow_up_task.template_id + follow_up_record.form_data + 积分规则种子
This commit is contained in:
iven
2026-05-21 00:50:29 +08:00
parent 5877342a4d
commit ec7f76127d
11 changed files with 341 additions and 0 deletions

View File

@@ -159,6 +159,9 @@ mod m20260519_000154_seed_ai_knowledge_permissions;
mod m20260519_000155_fix_ai_menus_and_add_chat;
mod m20260519_000156_fix_ai_menus_round2;
mod m20260520_000157_follow_up_source_and_points_rules;
mod m20260521_000158_alerts_add_source_columns;
mod m20260521_000159_patient_phone_and_consent_seed;
mod m20260521_000160_follow_up_task_template_id_and_record_form_data;
pub struct Migrator;
@@ -325,6 +328,9 @@ impl MigratorTrait for Migrator {
Box::new(m20260519_000155_fix_ai_menus_and_add_chat::Migration),
Box::new(m20260519_000156_fix_ai_menus_round2::Migration),
Box::new(m20260520_000157_follow_up_source_and_points_rules::Migration),
Box::new(m20260521_000158_alerts_add_source_columns::Migration),
Box::new(m20260521_000159_patient_phone_and_consent_seed::Migration),
Box::new(m20260521_000160_follow_up_task_template_id_and_record_form_data::Migration),
]
}
}