import mongoose from "mongoose";
import {IJob} from "./IJob";


export const JobSchema = new mongoose.Schema<IJob>({
    drink: {type: mongoose.Types.ObjectId, ref: "Drink"},
    amounts: [{ingredient: {type: mongoose.Types.ObjectId, ref: "Ingredient"}, amount: Number, container: { type: mongoose.Types.ObjectId, ref: "Container" }}],
    completeAmount: Number,
    startedAt: Date,
    endAt: Date,
    estimatedTime: Number,
    successful: Boolean
});


const Job = mongoose.model<IJob>('Job', JobSchema);
export default Job;