import * as Mongoose from "mongoose";
import mongoose from "mongoose";
import {IContainer} from "./IContainer";

export const ContainerSchema = new Mongoose.Schema<IContainer>({
    slot: {type: Number, required: true},
    volume: {type: Number, required: true, default: 1000},
    sensorType: String,
    sensorPin1: Number,
    sensorPin2: Number,
    rawData: Number,
    pumpPin: {type: Number, required: true},
    content: {type: mongoose.Types.ObjectId, ref: "Ingredient"},
    sensorDelta: Number, // V2: Now sensorDelta - Differenz, welche beim Einstellen der Zutat aus Gewicht(Sensor) - Volumen errechnet wird
    sensorTare: Number, // V2: Now sensorTare
    useProxy: { type: Boolean, default: false },
    filled: Number,
    enabled: {type: Boolean, default: false},
});

const Container = mongoose.model<IContainer>('Container', ContainerSchema);
export default Container;

