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

const PredefinedActivity = sequelize.define('PredefinedActivity', {
    id: {
        type: DataTypes.INTEGER,
        primaryKey: true,
        autoIncrement: true,
    },
    name: {
        type: DataTypes.STRING,
        allowNull: false,
    },
    code: {
        type: DataTypes.STRING,
        allowNull: true,
    },
    description: {
        type: DataTypes.TEXT,
        allowNull: true,
    },
    drawingData: {
        type: DataTypes.TEXT,
        allowNull: true,
        comment: 'JSON string with metadata for Court Drawing Tool'
    },
    durationText: {
        type: DataTypes.STRING,
        allowNull: true,
    },
    duration: {
        type: DataTypes.INTEGER,
        allowNull: true,
    },
    imageLink: {
        type: DataTypes.STRING,
        allowNull: true,
    },
    excludeFromStats: {
        type: DataTypes.BOOLEAN,
        allowNull: false,
        defaultValue: false,
    },
}, {
    tableName: 'predefined_activities',
    timestamps: true,
    underscored: true,
});

export default PredefinedActivity;
