    'use strict';
    import { Schema, model } from 'mongoose';
    var ticketSchema = new Schema(
        {        
            title: { 
                type: String,
                trim : true ,
                index : true 
            },
            description : 
            {
                type: String,
                trim : true ,
                index : true 
            },
            media : {type : Array , default : []},
            createdBy : { type : Schema.Types.ObjectId , ref :'User'},
            comments : [{type : Schema.Types.ObjectId , ref : 'Comments'}],
            is_completed : { type : Boolean , default : false},
            status : { 
                type : String , 
                enum : ['OPEN' , 'PENDING' , 'COMPLETED' , 'CLOSED' , 'REOPEN', 'INPROGRESS' ],
                default : 'OPEN'
            },
            is_deleted : { type : Boolean , default : false }
        },
        {
            timestamps: true,
        },
    );

let Ticket = model('Ticket', ticketSchema);
module.exports = {Ticket, ticketSchema}