module.exports = function(sequelize, DataTypes) {
  return sequelize.define(
    "workspace_settings",
    {
      id: { type: DataTypes.STRING(32), primaryKey: true },
      practice_name: { type: DataTypes.TEXT },
      logo_url: { type: DataTypes.TEXT },
      coach_name: { type: DataTypes.TEXT },
      coach_photo_url: { type: DataTypes.TEXT },
      coach_bio: { type: DataTypes.TEXT },
      coach_credentials: { type: DataTypes.TEXT },
      coach_niche: { type: DataTypes.TEXT },
      brand_color: { type: DataTypes.STRING(16), allowNull: false, defaultValue: "teal" },
      default_booking_url: { type: DataTypes.TEXT },
      contact_email: { type: DataTypes.TEXT },
      custom_domain: { type: DataTypes.TEXT },
      social_links: { type: DataTypes.JSONB, allowNull: false, defaultValue: [] },
      packages: { type: DataTypes.JSONB, allowNull: false, defaultValue: [] },
      testimonials: { type: DataTypes.JSONB, allowNull: false, defaultValue: [] },
      published: { type: DataTypes.BOOLEAN, allowNull: false, defaultValue: false },
      legal_entity_name: { type: DataTypes.TEXT },
      legal_contact_email: { type: DataTypes.TEXT },
      legal_terms_effective_date: { type: DataTypes.DATEONLY },
      legal_review_confirmed: { type: DataTypes.BOOLEAN, allowNull: false, defaultValue: false },
      reminders_enabled: { type: DataTypes.BOOLEAN, allowNull: false, defaultValue: true },
      default_reminder_minutes: { type: DataTypes.INTEGER, allowNull: false, defaultValue: 60 },
      timezone: { type: DataTypes.TEXT, allowNull: false, defaultValue: "UTC" },
      updatedById: { type: DataTypes.UUID },
    },
    { timestamps: true, freezeTableName: true },
  );
};
