import { Schema } from 'mongoose'; import { IRequirement } from '../models/requirement.model'; import { IStock, StockStatus, StockType } from '../models/stock.model'; const stockSchema = new Schema({ process: { type: Schema.Types.ObjectId, ref: 'processSchema', index: true }, requirement: { type: Schema.Types.ObjectId, ref: 'requirementSchema', index: true }, '#select': { type: Boolean, default: false }, productType: { type: String }, lot: { type: String }, sku: { type: String }, designation: { type: String }, stage: { type: String }, warehouse: { type: String }, quantity: { type: Number }, srcQty: { type: Number }, quibble: { type: Number }, returnDate: { type: Date }, warehouseLocation: { type: String }, container: { type: String }, typeMO: { type: String }, serie: { type: String }, multiMO: { type: Boolean, default: false }, qtyWeek: { type: Number }, eqLoad: { type: Number }, status: { type: String, enum: Object.values(StockStatus), default: StockStatus.UNLOCK, }, stockType: { type: String, enum: Object.values(StockType), default: StockType.UNCUT, }, convertQty: { type: Number }, ncom: { type: String }, }); export { stockSchema };