import mongoose, { Schema } from 'mongoose';

export interface Processor extends Document {
    barcode_id: string;
    locality: string;
    name: string;
}

const ProcessorSchema = new Schema<Processor>(
    {
        barcode_id: { type: String, required: true },
        locality: { type: String, required: true },
        name: { type: String, required: true },
    },
    {
        minimize: true,
        timestamps: true,
    },
);

export default mongoose.models?.Processor || mongoose.model<Processor>('Processor', ProcessorSchema);
