import { Document, Schema, Types } from 'mongoose'; export interface WaybillSchema extends Document { operation: 'in' | 'out'; productId: string; quantity: number; contractorId: string; status: 'waiting' | 'executed' | 'cancelled'; } export const waybillSchema = new Schema({ operation: { type: String, required: true, }, contractorId: { type: Types.ObjectId, required: true, }, productId: { type: Types.ObjectId, required: true, }, quantity: { type: Number, min: 1, }, status: { type: String, default: 'waiting', }, }, { timestamps: true });