24 lines
524 B
TypeScript
24 lines
524 B
TypeScript
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
|
import mongoose, { HydratedDocument } from 'mongoose';
|
|
|
|
export type DiscountTypeDocument = HydratedDocument<DiscountType>;
|
|
|
|
|
|
@Schema({ timestamps: true })
|
|
export class DiscountType {
|
|
|
|
@Prop({required:true})
|
|
Name: string;
|
|
|
|
@Prop()
|
|
Description: string;
|
|
|
|
@Prop({required:true,unique: true})
|
|
ID: string;
|
|
|
|
@Prop()
|
|
Code:number;
|
|
}
|
|
|
|
export const DiscountTypeSchema = SchemaFactory.createForClass(DiscountType);
|
|
DiscountTypeSchema.index({ ID: 1 }); |