import { Factory } from "fishery"; import { ObjectId } from "mongodb"; import { faker } from "@faker-js/faker"; import type { ContextNote, ContextNoteEntry } from "../../../talkpilot"; export const contextNoteEntryFactory = Factory.define(() => ({ _id: new ObjectId(), title: faker.lorem.words(3), content: faker.lorem.sentences(2), activeFrom: new Date(), expiresAt: null, createdAt: new Date(), updatedAt: new Date(), })); export const contextNoteFactory = Factory.define< ContextNote & { _id: ObjectId } >(() => ({ _id: new ObjectId(), clientId: faker.string.uuid(), product: "Municipal", notes: [], })); export function createContextNoteEntry( overrides?: Partial, ): ContextNoteEntry { return { ...contextNoteEntryFactory.build(), ...overrides, } as ContextNoteEntry; } export function createContextNote( overrides?: Partial, ): ContextNote & { _id: ObjectId } { return { ...contextNoteFactory.build(), ...overrides } as ContextNote & { _id: ObjectId; }; }