import mongoose, { Schema, Document } from 'mongoose';

export interface IAppSettings extends Document {
  passwordHash: string;
  jwtSecret: string;
  createdAt: Date;
  updatedAt: Date;
}

const AppSettingsSchema: Schema = new Schema(
  {
    passwordHash: { type: String, required: true },
    jwtSecret: { type: String, required: true },
  },
  { timestamps: true }
);

export default mongoose.models.AppSettings ||
  mongoose.model<IAppSettings>('AppSettings', AppSettingsSchema);
