import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; import { Document, Types } from 'mongoose'; @Schema({ timestamps: false }) export class Stock extends Document { @Prop({ required: true }) name: string; @Prop({ type: Types.ObjectId, ref: 'Location', required: true }) locationId: Types.ObjectId; @Prop({ }) areas: Types.Array; } export const StockSchema = SchemaFactory.createForClass(Stock);