feat(agent): 管理端 agent 支持陪诊员并按角色收敛工具
陪诊员身份以 Employee 在职档案为准,显式管理员优先;管理端小程序首次登录会写入 role:['user'],不能据此判断。管理员保留跨用户查询与医院资料写入,陪诊员只开放本人订单查询/改单(归属校验、状态与字段白名单、并发保护)与本人档案,患者档案与财务操作不可用。
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { buildEmployeeQueryTool } from "../query/employee_query.js";
|
||||
|
||||
/**
|
||||
* 陪诊员端员工查询工具
|
||||
*
|
||||
* 只允许查本人档案:强制按当前登录用户 ID 隔离,schema 不暴露 userId;
|
||||
* 输出走用户端白名单,不返回身份证、手机号、证书编号等敏感字段。
|
||||
*/
|
||||
const createAttendantEmployeeQueryTool = (userInfo) =>
|
||||
buildEmployeeQueryTool({ userId: userInfo?._id });
|
||||
|
||||
export { createAttendantEmployeeQueryTool };
|
||||
Reference in New Issue
Block a user