start for tag Module1
This commit is contained in:
parent
b1099cc38a
commit
58c823745e
|
|
@ -0,0 +1,42 @@
|
||||||
|
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||||
|
import { HydratedDocument, Types } from 'mongoose';
|
||||||
|
|
||||||
|
|
||||||
|
@Schema()
|
||||||
|
export class Tag {
|
||||||
|
|
||||||
|
@Prop({ required: true, unique: true })
|
||||||
|
ID: string;
|
||||||
|
|
||||||
|
@Prop()
|
||||||
|
Name: string;
|
||||||
|
|
||||||
|
@Prop()
|
||||||
|
Data: string;
|
||||||
|
|
||||||
|
@Prop({ enum: ['user', 'system'] })
|
||||||
|
Type: string;
|
||||||
|
|
||||||
|
@Prop({ type: Types.ObjectId, ref: 'User' })
|
||||||
|
User: Types.ObjectId;
|
||||||
|
|
||||||
|
@Prop()
|
||||||
|
Status: boolean;
|
||||||
|
|
||||||
|
@Prop({ enum: ['shop', 'product','shopCategory','shopCategoryDocument','productCategory','productCategoryDocument'] })
|
||||||
|
TagType: string;
|
||||||
|
|
||||||
|
@Prop()
|
||||||
|
EndTime: Date;
|
||||||
|
|
||||||
|
@Prop()
|
||||||
|
AdminStatus: boolean;
|
||||||
|
|
||||||
|
@Prop({ type: Date, default: Date.now })
|
||||||
|
createdAt: Date;
|
||||||
|
|
||||||
|
@Prop({ type: Date, default: Date.now })
|
||||||
|
updatedAt: Date;
|
||||||
|
}
|
||||||
|
export const TagSchema = SchemaFactory.createForClass(Tag);
|
||||||
|
TagSchema.index({ ID: 1 })
|
||||||
Loading…
Reference in New Issue