'use strict';
// var mongoose = require('mongoose');
import { Schema, model, connect } from 'mongoose';
enum Action {
    PENDING = 'PENDING',
    APPROVED = 'APPROVED',
    REJECTED = 'REJECTED',
    COMPLETED = 'COMPLETED'
}
var bookingAppointmentSchema = new Schema(
    {
        booking_id: {
            type: String,
        },
        consultation_reason: {
            type: String,
        },
        patient_id: {
            type: Schema.Types.ObjectId,
            ref: 'User'
        },
        hospital_doctor_id: {
            type: Schema.Types.ObjectId,
            ref: 'User'
        },
        rejected_by: {
            type: String,

        },
        reschedule_by: {
            type: String,
        },
        slot: {
            type: String
        },
        booking_date: {
            type: Date
        },
        booking_role_type: {
            type: Schema.Types.ObjectId,
            ref: 'Role'
        },
        booking_speciality: {
            type: Schema.Types.ObjectId,
            ref: 'Category'
        },
        status: {
            type: String,
            enum: Action,
            default: Action.PENDING
        },
        reschedule_date: {
            type: Date
        },
        rejected_reason: {
            type: String
        },
        reschedule_slot: {
            type: String,
        },
        document_file: {
            type: Array
        },
        document_file_from_doctor: {
            type: Array
        },
        guardian_id: {
            type: Schema.Types.ObjectId,
            ref: "User"
        },
        // Daily.co integration fields
        daily_room_name: { type: String },
        daily_room_url: { type: String },
        daily_room_token: { type: String },
        daily_room_created_at: { type: Date }
    },
    {
        timestamps: true,
    },
);

let BookingAppointment = model('booking', bookingAppointmentSchema)
//module.exports.User =  mongoose.model('User', userSchema);
module.exports = { BookingAppointment, bookingAppointmentSchema }