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

export interface ISupportFeedback extends Document {
  name: string;
  email: string;
  subject: string;
  rating: number;
  message: string;
  createdAt: Date;
  updatedAt: Date;
}

const supportFeedbackSchema = new Schema<ISupportFeedback>(
  {
    name: { type: String, required: true, trim: true },
    email: { type: String, required: true, trim: true, lowercase: true },
    subject: { type: String, required: true, trim: true },
    rating: { type: Number, required: true, min: 1, max: 5 },
    message: { type: String, required: true, trim: true },
  },
  { timestamps: true }
);

export default mongoose.model<ISupportFeedback>('SupportFeedback', supportFeedbackSchema);
