22 lines
980 B
JavaScript
22 lines
980 B
JavaScript
const { DataTypes } = require('sequelize');
|
|
const { sequelize } = require('../config/database');
|
|
|
|
const StaffContract = sequelize.define('staff_contracts', {
|
|
id: { type: DataTypes.UUID, defaultValue: DataTypes.UUIDV4, primaryKey: true },
|
|
teacher_id: { type: DataTypes.UUID, allowNull: false },
|
|
school_id: { type: DataTypes.UUID, allowNull: false },
|
|
contract_type: { type: DataTypes.ENUM('full_time', 'part_time', 'contract'), allowNull: false },
|
|
start_date: { type: DataTypes.DATE, allowNull: false },
|
|
end_date: { type: DataTypes.DATE },
|
|
salary: { type: DataTypes.DECIMAL(12, 2) },
|
|
status: { type: DataTypes.ENUM('active', 'expired', 'terminated'), defaultValue: 'active' },
|
|
created_at: { type: DataTypes.DATE, allowNull: false, defaultValue: DataTypes.NOW },
|
|
updated_at: { type: DataTypes.DATE, allowNull: false, defaultValue: DataTypes.NOW },
|
|
}, {
|
|
tableName: 'staff_contracts',
|
|
timestamps: true,
|
|
underscored: true,
|
|
});
|
|
|
|
module.exports = StaffContract;
|