Skip to content

Commit cc1c703

Browse files
committed
Add history tracking plugin to Agents schema for auditing purposes
1 parent eee401e commit cc1c703

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/core/agents/_schemas/agents.schema.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { AbstractSchema } from '~/_common/abstracts/schemas/abstract.schema';
33
import { StatePart, StatePartSchema } from '~/core/agents/_schemas/_parts/state.part.schema';
44
import { SecurityPart, SecurityPartSchema } from '~/core/agents/_schemas/_parts/security.part.schema';
55
import { MixedValue } from '~/_common/types/mixed-value.type';
6+
import { historyPlugin } from '~/_common/plugins/mongoose/history.plugin';
67

78
const DEFAULT_THIRD_PARTY_AUTH = 'local';
89

@@ -70,4 +71,10 @@ export class Agents extends AbstractSchema {
7071
public customFields?: { [key: string]: MixedValue };
7172
}
7273

73-
export const AgentsSchema = SchemaFactory.createForClass(Agents);
74+
export const AgentsSchema = SchemaFactory.createForClass(Agents)
75+
.plugin(historyPlugin, {
76+
collectionName: Agents.name,
77+
ignoredFields: [
78+
'password',
79+
],
80+
});

0 commit comments

Comments
 (0)