'use strict';
// var mongoose = require('mongoose');
import { Schema, model, connect } from 'mongoose';
enum Action {
    PENDING = 'PENDING',
    APPROVED = 'APPROVED',
    REJECTED = 'REJECTED',
    COMPLETED = 'COMPLETED',
    RESCHEDULED= 'RESCHEDULED'  
}
var  bookingHistorySchema = new Schema(
    {
        booking_id:{
            type: Schema.Types.ObjectId,
            ref:'booking'
        },
        patient_id:{
            type: Schema.Types.ObjectId,
            ref:'User'
        },
        hospital_doctor_id:{
            type: Schema.Types.ObjectId,
            ref:'User'
        },
        action_by : {
            type: String,
        },
        status : {
            type: String,
            enum: Action,
            default: Action.PENDING
        },
        guardian_id : { 
            type : Schema.Types.ObjectId,
            ref : "User"
        }
    },
    {
        timestamps: true,
    },
);

let BookingHistory = model('booking-history', bookingHistorySchema)
//module.exports.User =  mongoose.model('User', userSchema);
module.exports = {BookingHistory, bookingHistorySchema}