mirror of
https://github.com/hexastack/hexabot
synced 2024-12-26 22:02:48 +00:00
fix: attach botStats and nlpSampleEnity to the lifecyclehook
This commit is contained in:
parent
acf3663bd5
commit
a81f3f0c5a
@ -9,6 +9,7 @@
|
|||||||
import { ModelDefinition, Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
import { ModelDefinition, Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||||
|
|
||||||
import { BaseSchema } from '@/utils/generics/base-schema';
|
import { BaseSchema } from '@/utils/generics/base-schema';
|
||||||
|
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
||||||
import { THydratedDocument } from '@/utils/types/filter.types';
|
import { THydratedDocument } from '@/utils/types/filter.types';
|
||||||
|
|
||||||
export enum BotStatsType {
|
export enum BotStatsType {
|
||||||
@ -115,9 +116,9 @@ export class BotStats extends BaseSchema {
|
|||||||
|
|
||||||
export type BotStatsDocument = THydratedDocument<BotStats>;
|
export type BotStatsDocument = THydratedDocument<BotStats>;
|
||||||
|
|
||||||
export const BotStatsModel: ModelDefinition = {
|
export const BotStatsModel: ModelDefinition = LifecycleHookManager.attach({
|
||||||
name: BotStats.name,
|
name: BotStats.name,
|
||||||
schema: SchemaFactory.createForClass(BotStats),
|
schema: SchemaFactory.createForClass(BotStats),
|
||||||
};
|
});
|
||||||
|
|
||||||
export default BotStatsModel.schema;
|
export default BotStatsModel.schema;
|
||||||
|
@ -11,6 +11,7 @@ import { Transform, Type } from 'class-transformer';
|
|||||||
import { Schema as MongooseSchema } from 'mongoose';
|
import { Schema as MongooseSchema } from 'mongoose';
|
||||||
|
|
||||||
import { BaseSchema } from '@/utils/generics/base-schema';
|
import { BaseSchema } from '@/utils/generics/base-schema';
|
||||||
|
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
||||||
import {
|
import {
|
||||||
TFilterPopulateFields,
|
TFilterPopulateFields,
|
||||||
THydratedDocument,
|
THydratedDocument,
|
||||||
@ -103,10 +104,11 @@ export class NlpSampleEntityFull extends NlpSampleEntityStub {
|
|||||||
|
|
||||||
export type NlpSampleEntityDocument = THydratedDocument<NlpSampleEntity>;
|
export type NlpSampleEntityDocument = THydratedDocument<NlpSampleEntity>;
|
||||||
|
|
||||||
export const NlpSampleEntityModel: ModelDefinition = {
|
export const NlpSampleEntityModel: ModelDefinition =
|
||||||
name: NlpSampleEntity.name,
|
LifecycleHookManager.attach({
|
||||||
schema: SchemaFactory.createForClass(NlpSampleEntityStub),
|
name: NlpSampleEntity.name,
|
||||||
};
|
schema: SchemaFactory.createForClass(NlpSampleEntityStub),
|
||||||
|
});
|
||||||
|
|
||||||
export default NlpSampleEntityModel.schema;
|
export default NlpSampleEntityModel.schema;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user