Files
repo-home/apps/backend/src/catalog/_entities/article-variant.entity.ts
T

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);