const mongoose = require("mongoose");
const Schema = mongoose.Schema;

const discussionFormSchema = new Schema({
    userId: {
        type: Schema.Types.ObjectId,
        ref: "User",
        required: true
    },
    technicianId: {
        type: Schema.Types.ObjectId,
        ref: "User",
        required: true
    },
    requestFormId: {
        type: Schema.Types.ObjectId,
        ref: "RequestForm",
        required: true
    },
    serviceId:{
        type: Schema.Types.ObjectId,
        ref: "Service",
        required: true
    },
    typeOfPest: {
        type: String,
        required: true
    },
    nameOfPest: {
        type: String
    },
    propertyType: {
        type: String,
        enum: ["Residential", "Commercial", "Industrial"],
        required: true
    }, 
    severity: {
        type: String,
        enum: ["High", "Low", "Medium"],
        required: true
    },
    date: {
        type: String,
        required: true
    },
    time: {
        type: String,
        required: true
    },
    Notes: {
        type: String
    },
    amount: {
        type: Number
    },
    status: {
        type: String,
        enum: ["Upcoming", "Start", "Stop", "Completed" , "Paid"],
        default: "Upcoming"
    }
}, { timestamps: true });

const discussionFormModel = mongoose.model("DiscussionForm", discussionFormSchema);
module.exports = discussionFormModel;