feat(escort): 陪诊记录新增问诊信息(病历与诉求)字段与写入白名单

This commit is contained in:
lik
2026-11-05 22:01:46 +08:00
parent 8802a6490c
commit 1e1c5499e4
3 changed files with 34 additions and 8 deletions
+6 -6
View File
@@ -18,23 +18,23 @@ class HandlerEscortRecord {
// 白名单:只允许写入 schema 定义的顶层字段(兼容 'patient.name' 等点号路径)
static RECORD_FIELDS = [
"userId", "healthProfileId", "patient", "escort",
"attendant", "hospital", "schedule", "payment", "notes", "status",
"attendant", "hospital", "schedule", "payment", "notes", "inquiry", "status",
"shippingAddress",
];
// 用户自助可改字段按订单状态区分(费用、状态、陪诊员分配、档案归属一律由平台控制):
// - 待支付/已支付:可改医院与排期(改期会写审计时间)
// - 进行中:服务已开始,仅可补充就诊人备注,排期与医院不允许用户单方变更
// - 进行中:服务已开始,仅可补充病历与诉求,排期与医院不允许用户单方变更
// - 终态:全部不可改
static OWNER_NOTE_FIELDS = ["notes.patientNote"];
static OWNER_NOTE_FIELDS = ["notes.patientNote", "inquiry.medicalHistory", "inquiry.demand"];
static OWNER_BOOKING_FIELDS = [
"hospital.province", "hospital.name", "hospital.address", "hospital.department",
"hospital.doctor", "hospital.medicalRecordNo", "schedule.date", "schedule.startTime",
];
static OWNER_EDITABLE_BY_STATUS = {
pending: ["notes.patientNote", "payment.payChannel", ...HandlerEscortRecord.OWNER_BOOKING_FIELDS],
confirmed: ["notes.patientNote", "payment.payChannel", ...HandlerEscortRecord.OWNER_BOOKING_FIELDS],
in_progress: ["notes.patientNote"],
pending: [...HandlerEscortRecord.OWNER_NOTE_FIELDS, "payment.payChannel", ...HandlerEscortRecord.OWNER_BOOKING_FIELDS],
confirmed: [...HandlerEscortRecord.OWNER_NOTE_FIELDS, "payment.payChannel", ...HandlerEscortRecord.OWNER_BOOKING_FIELDS],
in_progress: [...HandlerEscortRecord.OWNER_NOTE_FIELDS],
};
// 用户端只能发起取消,服务完成由平台确认,避免用户端重复写入终态。