const { DataTypes } = require('sequelize');
const sequelize = require('../config/database');

const License = sequelize.define('License', {
  license_key: { type: DataTypes.STRING, allowNull: false, unique: true },
  account_number: { type: DataTypes.STRING, allowNull: false },
  broker_name: { type: DataTypes.STRING, allowNull: true },
  broker_server: { type: DataTypes.STRING, allowNull: true },
  status: { type: DataTypes.ENUM('Active', 'Expired', 'Revoked'), defaultValue: 'Active' },
  expired_at: { type: DataTypes.DATE, allowNull: true }
}, { timestamps: true });

module.exports = License;
