import { faker } from '@faker-js/faker'; import { LogLevel, LogPayload } from '../LogPayload'; type DeepPartial = { [K in keyof T]?: T[K] extends object ? DeepPartial : T[K]; }; export const createMockLogPayload = (partialRecord: DeepPartial): LogPayload => { return { message: faker.lorem.words(), ...partialRecord, meta: { traceid: faker.string.uuid(), level: faker.helpers.objectValue(LogLevel), timestamp: faker.date.recent().toISOString(), tenant: faker.string.uuid(), jobName: faker.string.uuid(), ...partialRecord.meta, }, }; };