'use strict'; module.exports = app => { const { STRING, INTEGER, BIGINT, TINYINT, DATE } = app.Sequelize; const AfterSaleFunction = app.model.define('afterSaleFunction', { id: { type: BIGINT(20).UNSIGNED, primaryKey: true, autoIncrement: true, comment: '主键', }, function_code: { type: STRING(50), allowNull: false, comment: '处理函数编码(与 inbox functions registry 注册名一致)', }, name: { type: STRING(100), allowNull: false, comment: '处理函数名称', }, description: { type: STRING(500), allowNull: true, defaultValue: null, comment: '处理函数说明', }, is_enabled: { type: TINYINT(1), allowNull: false, defaultValue: 1, comment: '是否启用:1=启用,0=停用', }, sort_order: { type: INTEGER(11), allowNull: false, defaultValue: 0, comment: '排序值,越小越靠前', }, created_at: { type: DATE, comment: '创建时间', }, updated_at: { type: DATE, comment: '更新时间', }, }, { tableName: 'wms_after_sale_function', underscored: true, timestamps: true, createdAt: 'created_at', updatedAt: 'updated_at', paranoid: false, comment: '售后处理函数表(子类型处理链路)', indexes: [ { unique: true, fields: [ 'function_code' ], name: 'uk_function_code', }, ], }); return AfterSaleFunction; };