import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'
import { Document, Types } from 'mongoose'

export type FeedbackDocument = Feedback & Document

@Schema({ timestamps: true })
export class Feedback {
  @Prop({ type: Types.ObjectId, ref: 'User', required: true })
  userId: Types.ObjectId

  @Prop({ default: 'suggestion' })
  type: string

  @Prop({ required: true })
  content: string

  @Prop({ default: '' })
  contact: string

  @Prop({ default: 'pending' })
  status: string
}

export const FeedbackSchema = SchemaFactory.createForClass(Feedback)
