This commit is contained in:
MohamedAliBouhaouala 2025-06-18 17:00:41 +01:00 committed by GitHub
commit b12e3d0e5c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 21 additions and 8 deletions

View File

@ -38,6 +38,7 @@ export class AttachmentStub extends BaseSchema {
@Prop({ @Prop({
type: String, type: String,
required: true, required: true,
index: true,
}) })
name: string; name: string;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright © 2024 Hexastack. All rights reserved. * Copyright © 2025 Hexastack. All rights reserved.
* *
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms: * Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission. * 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
@ -29,12 +29,14 @@ export class SubscriberStub extends BaseSchema {
@Prop({ @Prop({
type: String, type: String,
required: true, required: true,
index: true,
}) })
first_name: string; first_name: string;
@Prop({ @Prop({
type: String, type: String,
required: true, required: true,
index: true,
}) })
last_name: string; last_name: string;
@ -66,6 +68,7 @@ export class SubscriberStub extends BaseSchema {
@Prop({ @Prop({
type: String, type: String,
index: true,
}) })
foreign_id: string; foreign_id: string;
@ -154,7 +157,10 @@ export type SubscriberDocument = THydratedDocument<Subscriber>;
export const SubscriberModel: ModelDefinition = LifecycleHookManager.attach({ export const SubscriberModel: ModelDefinition = LifecycleHookManager.attach({
name: Subscriber.name, name: Subscriber.name,
schema: SchemaFactory.createForClass(SubscriberStub), schema: SchemaFactory.createForClass(SubscriberStub).index({
first_name: 1,
last_name: 1,
}),
}); });
export default SubscriberModel.schema; export default SubscriberModel.schema;

View File

@ -34,7 +34,7 @@ export class ContentStub extends BaseSchema {
/** /**
* The title of the content. * The title of the content.
*/ */
@Prop({ type: String, required: true }) @Prop({ type: String, required: true, index: true })
title: string; title: string;
/** /**

View File

@ -1,5 +1,5 @@
/* /*
* Copyright © 2024 Hexastack. All rights reserved. * Copyright © 2025 Hexastack. All rights reserved.
* *
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms: * Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission. * 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
@ -107,7 +107,10 @@ export type NlpSampleEntityDocument = THydratedDocument<NlpSampleEntity>;
export const NlpSampleEntityModel: ModelDefinition = export const NlpSampleEntityModel: ModelDefinition =
LifecycleHookManager.attach({ LifecycleHookManager.attach({
name: NlpSampleEntity.name, name: NlpSampleEntity.name,
schema: SchemaFactory.createForClass(NlpSampleEntityStub), schema: SchemaFactory.createForClass(NlpSampleEntityStub).index(
{ sample: 1, entity: 1, value: 1 },
{ unique: true },
),
}); });
export default NlpSampleEntityModel.schema; export default NlpSampleEntityModel.schema;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright © 2024 Hexastack. All rights reserved. * Copyright © 2025 Hexastack. All rights reserved.
* *
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms: * Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission. * 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
@ -26,7 +26,7 @@ export class NlpSampleStub extends BaseSchema {
/** /**
* The content of the sample. * The content of the sample.
*/ */
@Prop({ type: String, required: true }) @Prop({ type: String, required: true, index: true })
text: string; text: string;
/** /**

View File

@ -119,7 +119,10 @@ export type NlpValueDocument = THydratedDocument<NlpValue>;
export const NlpValueModel: ModelDefinition = LifecycleHookManager.attach({ export const NlpValueModel: ModelDefinition = LifecycleHookManager.attach({
name: NlpValue.name, name: NlpValue.name,
schema: SchemaFactory.createForClass(NlpValueStub), schema: SchemaFactory.createForClass(NlpValueStub).index(
{ value: 1, entity: 1 },
{ unique: true },
),
}); });
export default NlpValueModel.schema; export default NlpValueModel.schema;