WMS_MAIN/database/migrations/20260917100000-add-template-reply-enabled-to-inbox-group.js
liufumingren c2a761ca26 feat(inbox): 新增开门/到货/进场/离场车牌登记与 extend_props 持久化
- functions 新增 openDoor/registerLicensePlate/enter/departure(规则表+权限分组)
- 到货登记表 wms_inbox_arrival_register(含消费字段,离场闭环,货主收货群优先推送)
- 回执 extend_props 持久化落库与定时补发送下发(重推兜底回读)
- 车牌提取正则兼容异体字(粤/粵)
- 售后类型/关键字/函数/回复 v2 模型与迁移
- INBOX V2 HTTP 测试报告与指南
2026-09-17 02:41:43 +08:00

31 lines
1.0 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use strict';
/**
* wms_inbox_group 增加「是否模板消息回复」开关列。
* 与 ai_enabled(是否AI回复)并列:ai_enabled 控制是否启用 AI 处理,
* template_reply_enabled 控制命中处理后是否以模板消息形式回复(关闭则走普通文本回复)。
*/
const TABLE_NAME = 'wms_inbox_group';
module.exports = {
up: async (queryInterface, Sequelize) => {
const columns = await queryInterface.describeTable(TABLE_NAME);
if (columns.template_reply_enabled) return;
await queryInterface.addColumn(TABLE_NAME, 'template_reply_enabled', {
type: Sequelize.TINYINT(1),
allowNull: false,
defaultValue: 0,
comment: '是否启用模板消息回复: 0=关闭(普通文本回复) 1=开启(模板消息回复)',
after: 'ai_enabled',
});
},
down: async queryInterface => {
const columns = await queryInterface.describeTable(TABLE_NAME);
if (!columns.template_reply_enabled) return;
await queryInterface.removeColumn(TABLE_NAME, 'template_reply_enabled');
},
};