import { Schema, model } from 'mongoose';

const settingsSchema = new Schema({
  theme: { type: String, default: 'light' },
  language: { type: String, default: 'en' },
  notificationsEnabled: { type: Boolean, default: true },
  maintenanceMode: { type: Boolean, default: false },
  platformName: { type: String, default: 'Trading Journal' },
  currencyFormat: { type: String, default: 'USD' },
  timeZone: { type: String, default: 'UTC' },
  brokerIntegrations: [{ type: String }],
  securitySettings: {
    twoFactorRequired: { type: Boolean, default: false },
    sessionTimeout: { type: Number, default: 3600 },
    passwordComplexity: { type: String, enum: ['low', 'medium', 'high'], default: 'medium' },
  },
}, { timestamps: true });

// @ts-ignore
export const SettingsModel = model('Settings', settingsSchema);
