24 lines
618 B
TypeScript
24 lines
618 B
TypeScript
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<string, any>;
|
|
}
|
|
|
|
|
|
export const ArticleVariantSchema = SchemaFactory.createForClass(ArticleVariant);
|