import { sequelize } from '../../utils/sequelize.js';
import { DataTypes } from 'sequelize';

const UserParamType = sequelize.define('user_param_type', {
    description: {
        type: DataTypes.STRING,
        allowNull: false
    },
    minAge: { 
        type: DataTypes.INTEGER,
        allowNull: true
    },
    gender: {
        type: DataTypes.STRING,
        allowNull: true
    },
    datatype: {
        type: DataTypes.STRING,
        allowNull: false,
        defaultValue: 'string'
    },
    settingsId: {
        type: DataTypes.INTEGER,
        allowNull: false
    },
    orderId: {
        type: DataTypes.INTEGER,
        allowNull: false,
        defaultValue: 0
    }, 
    unit: {
        type: DataTypes.STRING,
        allowNull: true 
    },
    immutable: {
        type: DataTypes.BOOLEAN,
        allowNull: false,
        defaultValue: false
    }
}, {
    tableName: 'user_param',
    schema: 'type',
    underscored: true
});

export default UserParamType;
