forked from Shared/esg
19 lines
519 B
TypeScript
19 lines
519 B
TypeScript
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
|
import { HydratedDocument, Types } from 'mongoose';
|
|
|
|
export type FieldExpertDocument = HydratedDocument<FieldExpert>;
|
|
|
|
@Schema({ timestamps: true, collection: 'field_experts' })
|
|
export class FieldExpert {
|
|
@Prop({ required: true, trim: true })
|
|
name!: string;
|
|
|
|
@Prop({ required: true, unique: true })
|
|
expertCode!: number;
|
|
|
|
@Prop({ default: true })
|
|
active!: boolean;
|
|
}
|
|
|
|
export const FieldExpertSchema = SchemaFactory.createForClass(FieldExpert);
|