import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; import { Document, Types } from 'mongoose'; @Schema() export class ArticleVariant extends Document { @Prop({ type: Types.ObjectId, ref: 'Article', required: true }) articleId: Types.ObjectId; @Prop({ type: Types.ObjectId, ref: 'Manufacturer', required: true }) manufacturerId: Types.ObjectId; @Prop() supplierArticleNumber?: string; @Prop() packagingUnit?: string; // z. B. "Karton 12 Stk" @Prop({ type: Object }) extra?: Record; } export const ArticleVariantSchema = SchemaFactory.createForClass(ArticleVariant);