fix(agent): 医院工具切换至 hospital 集合并补齐支付约束

hospital_info_list/query/set 改为读写 hospital 集合,适配 entityName/nicknames/fudanRank;医院子代理与提示词同步字段口径;health_profile_set 更新启用 schema 校验;escort_record_set 限制线下收款方式,存在未支付流水时禁止改价。
This commit is contained in:
lik
2026-11-06 17:38:28 +08:00
parent 623ecf2651
commit 9ab2a39d08
8 changed files with 342 additions and 343 deletions
@@ -106,10 +106,11 @@ const healthProfileSetTool = tool(
}
update["meta.updatetime"] = new Date();
// 与接口层一致:身高/体重范围、性别枚举等 schema 约束必须在更新时生效
const updated = await DBModel.HealthProfile.findByIdAndUpdate(
profileId,
{ $set: update },
{ new: true }
{ new: true, runValidators: true }
);
if (!updated) {
return { success: false, error: `未找到 ID 为 ${profileId} 的健康档案` };