'use strict';
import { Schema, model, connect } from 'mongoose';
enum Action {
  OPEN = "open",
  IN_PROGRESS = "in_progress",
  RESOLVED = "resolved",
  CLOSED = "closed"
}
var contactUsReplySchema = new Schema(
    {
        contact_id: {
            type: Schema.Types.ObjectId,
            ref: 'Contact',
            required: true,
        },
        comment: {
            type: String,
        },
        attachment: {
            type: String,
        },
        status: {
            type: String,
            enum: Action,
            default: Action.OPEN
        },
        assigned_by_admin_id: {
            type: Schema.Types.ObjectId,   // (optional) same for admin if needed
            ref: 'Admin',
        },
        assigned_to_admin_id: {
            type: Schema.Types.ObjectId,   // (optional) same for admin if needed
            ref: 'Admin',
        },
        is_deleted: {
            type: Boolean,
            default: false
        }
    },
    {
        timestamps: true,
    },
);

let ContactReply = model('contact-reply', contactUsReplySchema)
module.exports = { ContactReply, contactUsReplySchema }