Files
node_learning_module_1/day1/models/shipping_dock.js
T
bolade 7b3fd1298d Add order, shipping dock, and transaction routes with CRUD operations and Swagger documentation
- Implemented GET, POST, PUT, and DELETE endpoints for orders, shipping docks, and transactions.
- Added Swagger annotations for API documentation.
- Included error handling for database operations.
- Configured pnpm workspace to ignore built dependencies for sqlite3.
2025-11-12 11:12:05 +01:00

34 lines
901 B
JavaScript

module.exports = (sequelize, DataTypes) => {
const shipping_dock = sequelize.define(
"shipping_dock",
{
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true,
},
name: {
type: DataTypes.STRING,
allowNull: false,
},
status: {
type: DataTypes.INTEGER,
allowNull: false,
defaultValue: 1,
comment: "1: active, 0: inactive",
},
created_at: DataTypes.DATE,
updated_at: DataTypes.DATE,
},
{
timestamps: true,
freezeTableName: true,
tableName: "shipping_dock",
createdAt: "created_at",
updatedAt: "updated_at",
}
);
return shipping_dock;
};