import { Prop, Schema, SchemaFactory } from "@nestjs/mongoose";
import { Document, STATES } from "mongoose";
import * as moment from "moment";

let status = ["PENDING", "RESOLVE", "REJECT"];

@Schema()
export class ContactUss extends Document {

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

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

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

    @Prop({ required: true })
    message: string
    
    @Prop({ type: String, default: 0 })
    phone_no: String;
  
    @Prop({ type: String, default: null })
    country_code: string;
  
    @Prop({ default: 'PENDING', enum: status })
    status: string

    @Prop()
    type: string

    @Prop({ default: +new Date() })
    created_at: number = +new Date()

    @Prop({ default: +new Date() })
    updated_at: number = +new Date()

}

export const ContactSchema = SchemaFactory.createForClass(ContactUss);