44 lines
1.1 KiB
JavaScript
44 lines
1.1 KiB
JavaScript
|
|
module.exports = (sequelize, DataTypes) => {
|
||
|
|
const transaction = sequelize.define(
|
||
|
|
"transaction",
|
||
|
|
{
|
||
|
|
id: {
|
||
|
|
type: DataTypes.INTEGER,
|
||
|
|
primaryKey: true,
|
||
|
|
autoIncrement: true,
|
||
|
|
},
|
||
|
|
order_id: {
|
||
|
|
type: DataTypes.INTEGER,
|
||
|
|
allowNull: false,
|
||
|
|
},
|
||
|
|
user_id: {
|
||
|
|
type: DataTypes.INTEGER,
|
||
|
|
allowNull: false,
|
||
|
|
},
|
||
|
|
shipping_dock_id: {
|
||
|
|
type: DataTypes.INTEGER,
|
||
|
|
allowNull: false,
|
||
|
|
},
|
||
|
|
amount: {
|
||
|
|
type: DataTypes.DECIMAL(10, 2),
|
||
|
|
allowNull: false,
|
||
|
|
},
|
||
|
|
notes: {
|
||
|
|
type: DataTypes.TEXT,
|
||
|
|
allowNull: true,
|
||
|
|
},
|
||
|
|
created_at: DataTypes.DATE,
|
||
|
|
updated_at: DataTypes.DATE,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
timestamps: true,
|
||
|
|
freezeTableName: true,
|
||
|
|
tableName: "transaction",
|
||
|
|
createdAt: "created_at",
|
||
|
|
updatedAt: "updated_at",
|
||
|
|
}
|
||
|
|
);
|
||
|
|
|
||
|
|
return transaction;
|
||
|
|
};
|