/**
* 订单状态表
*/
'use strict'

module.exports = function (db, DataTypes) {
	return db.define('oproductprocess', {
		productId: {type: DataTypes.STRING, field: 'product_id', allowNull: true, comment:'产品ID' },
		// name: { type: DataTypes.STRING(200), field: 'name', allowNull: false, defaultValue:"", comment:'产品名称'},
		// status: {type: DataTypes.STRING, field: 'status', allowNull: true, comment:'状态' },
		func: { type: DataTypes.STRING, field: 'func', allowNull: false, comment:'状态执行方法名称'},
		nextStatus: {type: DataTypes.STRING, field: 'next_status', allowNull: true, comment:'下一个状态'},
		name1: { type: DataTypes.STRING, field: 'name1', allowNull: true, comment:'状态1'},
		name2: {type: DataTypes.STRING, field: 'name2', allowNull: true, comment:'状态2' },
		name3: { type: DataTypes.STRING, field: 'name3', allowNull: true, comment:'状态3'},
		name4: {type: DataTypes.STRING, field: 'name4', allowNull: true, comment:'状态4' },
		sort: {type: DataTypes.INTEGER, field: 'sort', allowNull: false, defaultValue:1, comment:'排序' },
    createdAt: { type: DataTypes.DATE, field: 'created_at', allowNull: false, defaultValue: DataTypes.NOW },
    updatedAt: { type: DataTypes.DATE, field: 'updated_at', allowNull: false, defaultValue: DataTypes.NOW },
    deletedAt: { type: DataTypes.DATE, field: 'deleted_at', allowNull: true },
	},
	{
		timestamps: true,
		underscore: true,
    paranoid: true,
    version: true,
		tableName: 'o_product_process',
		comment: '产品状态表',
	});
}

