import { Factory } from "fishery"; import { ObjectId } from "mongodb"; import { faker } from "@faker-js/faker"; import type { Group, GroupContact, GroupDoc } from "../../../talkpilot"; export const groupContactFactory = Factory.define(() => ({ name: faker.person.firstName(), phone: { national: "500000000", національний: "500000000", nacionales: "500000000", национальные: "500000000", e164: "+972500000000" as const, region: "IL", countryCallingCode: "972", formatted: "+972 50-000-0000", }, gender: faker.helpers.arrayElement(["male", "female"]), })); export const groupFactory = Factory.define(() => ({ _id: new ObjectId(), clientId: faker.string.uuid(), createdAt: new Date(), updatedAt: new Date(), name: faker.company.name(), description: faker.lorem.sentence(), contacts: groupContactFactory.buildList(2), })); export function createGroup(overrides?: Partial): GroupDoc { return groupFactory.build(overrides); }