forked from Chatbot/v3-api
first commit v3 initialiazed a temporary repository for darmanet client
This commit is contained in:
42
src/database/model/botReact.model.ts
Normal file
42
src/database/model/botReact.model.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||
import { Types } from 'mongoose';
|
||||
import { ReactEnum } from 'src/common/types/react.type';
|
||||
import { Sender } from 'src/common/types/sender.type';
|
||||
|
||||
@Schema({
|
||||
timestamps: { createdAt: 'createdAt' },
|
||||
collection: 'reacts',
|
||||
versionKey: false,
|
||||
_id: true,
|
||||
})
|
||||
|
||||
export class ReactsModel {
|
||||
@Prop({ _id: true, default: new Types.ObjectId() })
|
||||
sessionId: Types.ObjectId;
|
||||
|
||||
@Prop({ _id: true, default: new Types.ObjectId() })
|
||||
messageId: Types.ObjectId;
|
||||
|
||||
@Prop({ _id: true, default: new Types.ObjectId() })
|
||||
userId: Types.ObjectId;
|
||||
|
||||
@Prop({ default: false })
|
||||
question: string;
|
||||
|
||||
@Prop({ default: false })
|
||||
answer: string;
|
||||
|
||||
@Prop({ default: null, type: String, enum: Sender })
|
||||
sender: Sender;
|
||||
|
||||
@Prop({ default: null, enum: ReactEnum })
|
||||
react: string;
|
||||
|
||||
@Prop({ type: [String], required: true })
|
||||
createdAt: [string, string]; // [time, date]
|
||||
|
||||
@Prop({ type: Date, default: Date.now })
|
||||
createdISO: Date;
|
||||
}
|
||||
|
||||
export const ReactSchema = SchemaFactory.createForClass(ReactsModel);
|
||||
Reference in New Issue
Block a user