- functions 新增 openDoor/registerLicensePlate/enter/departure(规则表+权限分组) - 到货登记表 wms_inbox_arrival_register(含消费字段,离场闭环,货主收货群优先推送) - 回执 extend_props 持久化落库与定时补发送下发(重推兜底回读) - 车牌提取正则兼容异体字(粤/粵) - 售后类型/关键字/函数/回复 v2 模型与迁移 - INBOX V2 HTTP 测试报告与指南
82 lines
2.1 KiB
JavaScript
82 lines
2.1 KiB
JavaScript
'use strict';
|
||
|
||
module.exports = app => {
|
||
const { STRING, BIGINT, TINYINT, TEXT, DATE } = app.Sequelize;
|
||
|
||
const AfterSaleReply = app.model.define('afterSaleReply', {
|
||
id: {
|
||
type: BIGINT(20).UNSIGNED,
|
||
primaryKey: true,
|
||
autoIncrement: true,
|
||
comment: '主键',
|
||
},
|
||
warehouse_id: {
|
||
type: BIGINT(20).UNSIGNED,
|
||
allowNull: true,
|
||
defaultValue: null,
|
||
comment: '仓库ID(NULL=系统级默认回复;非NULL=仓库级自定义回复,覆盖系统级)',
|
||
},
|
||
sub_type_id: {
|
||
type: BIGINT(20).UNSIGNED,
|
||
allowNull: false,
|
||
comment: '售后子类型ID(关联 wms_after_sale_sub_type.id)',
|
||
},
|
||
reply: {
|
||
type: TEXT,
|
||
allowNull: false,
|
||
comment: '自定义回复文案(支持换行,可含占位符)',
|
||
},
|
||
is_reply: {
|
||
type: TINYINT(1),
|
||
allowNull: false,
|
||
defaultValue: 1,
|
||
comment: '是否回复:1=命中后回复,0=静默不回复',
|
||
},
|
||
no_number_hint: {
|
||
type: STRING(500),
|
||
allowNull: true,
|
||
defaultValue: null,
|
||
comment: '未取到单据号时的引导语(如:请提供运单号;为空则用默认引导语)',
|
||
},
|
||
is_enabled: {
|
||
type: TINYINT(1),
|
||
allowNull: false,
|
||
defaultValue: 1,
|
||
comment: '是否启用:1=启用,0=停用(停用视为未设置,回退系统级)',
|
||
},
|
||
created_at: {
|
||
type: DATE,
|
||
comment: '创建时间',
|
||
},
|
||
updated_at: {
|
||
type: DATE,
|
||
comment: '更新时间',
|
||
},
|
||
}, {
|
||
tableName: 'wms_after_sale_reply',
|
||
underscored: true,
|
||
timestamps: true,
|
||
createdAt: 'created_at',
|
||
updatedAt: 'updated_at',
|
||
paranoid: false,
|
||
comment: '售后自定义回复表(仓库级覆盖系统级)',
|
||
indexes: [
|
||
{
|
||
unique: true,
|
||
fields: [ 'warehouse_id', 'sub_type_id' ],
|
||
name: 'uk_warehouse_sub_type',
|
||
},
|
||
{
|
||
fields: [ 'sub_type_id' ],
|
||
name: 'idx_sub_type_id',
|
||
},
|
||
{
|
||
fields: [ 'is_enabled' ],
|
||
name: 'idx_is_enabled',
|
||
},
|
||
],
|
||
});
|
||
|
||
return AfterSaleReply;
|
||
};
|