refactor(escort): 取消状态与 status 解耦

- 新增 cancelStatus(none/requested/cancelled),status 只描述服务生命周期
- record_state 拆分 canCancelTransition 与 CANCEL_TRANSITIONS
- 管理端 Agent 工具、查询工具与接口层统一走取消状态机
- 列表默认隐藏已取消订单,支持 cancelStatus / includeCancelled 筛选
This commit is contained in:
lik
2026-11-05 18:54:52 +08:00
parent 23b9de16a6
commit fb1210106e
8 changed files with 286 additions and 74 deletions
@@ -59,13 +59,17 @@ function buildAttendantEscortRecordSetTool({ attendantId = null } = {}) {
};
}
if ((record.cancelStatus || "none") !== "none" || record.status === "cancelled") {
return {
success: false,
error: "订单已取消或正在取消,不能修改。",
};
}
if (!EDITABLE_RECORD_STATUS.includes(record.status)) {
return {
success: false,
error:
record.status === "pending"
? "订单还未确认,不能操作,请联系管理员确认。"
: "订单已取消,不能修改。",
error: "订单还未确认或已结束,不能操作。",
};
}