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

const BillingUserSetting = sequelize.define('BillingUserSetting', {
  id: {
    type: DataTypes.INTEGER,
    primaryKey: true,
    autoIncrement: true,
    allowNull: false
  },
  clubId: {
    type: DataTypes.INTEGER,
    allowNull: false,
    field: 'club_id'
  },
  userId: {
    type: DataTypes.INTEGER,
    allowNull: false,
    field: 'user_id'
  },
  lastHourlyRate: {
    type: DataTypes.DECIMAL(10, 2),
    allowNull: false,
    defaultValue: 0,
    field: 'last_hourly_rate'
  },
  lastSelfRecipientName: {
    type: DataTypes.STRING(255),
    allowNull: true,
    field: 'last_self_recipient_name'
  },
  lastLocationText: {
    type: DataTypes.STRING(255),
    allowNull: true,
    field: 'last_location_text'
  }
}, {
  tableName: 'billing_user_setting',
  underscored: true,
  timestamps: true
});

export default BillingUserSetting;
