forked from Chatbot/v3-api
first commit v3 initialiazed a temporary repository for darmanet client
This commit is contained in:
77
src/database/model/dictionaries.model.ts
Normal file
77
src/database/model/dictionaries.model.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||
import { QuestionsModel } from './questions.model';
|
||||
|
||||
export interface UpdatedBy {
|
||||
name: string; // User's mobile number
|
||||
updatedAt: {
|
||||
time: string; // Time of update
|
||||
date: string; // Date of update
|
||||
};
|
||||
}
|
||||
|
||||
@Schema({
|
||||
timestamps: false,
|
||||
versionKey: false,
|
||||
collection: 'dictionaries',
|
||||
_id: true,
|
||||
})
|
||||
export class DictionariesModel {
|
||||
@Prop({ type: String })
|
||||
title: string;
|
||||
|
||||
@Prop({ type: 'string' })
|
||||
category: string;
|
||||
|
||||
@Prop({ type: String })
|
||||
type: 'Regulation' | 'Method';
|
||||
|
||||
@Prop()
|
||||
questions: QuestionsModel[];
|
||||
|
||||
@Prop({ type: Boolean })
|
||||
isActive: boolean;
|
||||
|
||||
@Prop({ type: [String] })
|
||||
fileId: string[];
|
||||
|
||||
@Prop({ type: String })
|
||||
icon: string;
|
||||
|
||||
@Prop({ type: String, required: false })
|
||||
aiCollectionId: string;
|
||||
|
||||
@Prop({ type: String, required: false })
|
||||
aiCollectionName: string;
|
||||
|
||||
/** Cached from AI get-collections-with-descriptions / get-collection-description. */
|
||||
@Prop({ type: String, required: false })
|
||||
description?: string;
|
||||
|
||||
@Prop({ type: [String], default: [] })
|
||||
keywords?: string[];
|
||||
|
||||
/**
|
||||
* Sync bookkeeping vs AI SoT.
|
||||
* ok | missing | deactivated | stale
|
||||
*/
|
||||
@Prop({ type: String, required: false, default: 'ok' })
|
||||
aiSyncStatus?: string;
|
||||
|
||||
@Prop({ type: Date, required: false })
|
||||
lastSyncedAt?: Date;
|
||||
|
||||
@Prop({ type: Array })
|
||||
createdAt: [];
|
||||
|
||||
@Prop({ type: Date })
|
||||
createdISO: Date;
|
||||
|
||||
@Prop({ type: Date })
|
||||
updatedAt: Date;
|
||||
|
||||
@Prop({ type: [Object] })
|
||||
updatedBy: UpdatedBy[];
|
||||
}
|
||||
|
||||
export const DictionariesSchema =
|
||||
SchemaFactory.createForClass(DictionariesModel);
|
||||
Reference in New Issue
Block a user