mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-11 00:08:37 +01:00
refactoring dashboard
This commit is contained in:
26
shared_global/schema/ai/AiChatSchema.ts
Normal file
26
shared_global/schema/ai/AiChatSchema.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { model, Schema } from 'mongoose';
|
||||
|
||||
export type TAiChatSchema = {
|
||||
_id: Schema.Types.ObjectId,
|
||||
project_id: Schema.Types.ObjectId,
|
||||
messages: any[],
|
||||
status: string,
|
||||
completed: boolean,
|
||||
title: string,
|
||||
deleted: boolean,
|
||||
created_at: Date,
|
||||
updated_at: Date
|
||||
}
|
||||
|
||||
const AiChatSchema = new Schema<TAiChatSchema>({
|
||||
project_id: { type: Schema.Types.ObjectId, index: 1 },
|
||||
status: { type: String },
|
||||
completed: { type: Boolean },
|
||||
messages: [{ _id: false, type: Schema.Types.Mixed }],
|
||||
title: { type: String, required: true },
|
||||
deleted: { type: Boolean, default: false },
|
||||
created_at: { type: Date, default: () => Date.now() },
|
||||
updated_at: { type: Date, default: () => Date.now() },
|
||||
});
|
||||
|
||||
export const AiChatModel = model<TAiChatSchema>('ai_chats', AiChatSchema);
|
||||
Reference in New Issue
Block a user